airwallex-payment-elements 0.2.98 → 0.2.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -19,8 +19,8 @@ stages:
19
19
  # Unit Test
20
20
 
21
21
  .bucket_deploy_script: &bucket_deploy_script |-
22
- ls
23
- gsutil -m cp -r ./output/* gs://${BUCKET_NAME}
22
+ cd docs
23
+ gsutil -m cp -r ./public/* gs://${BUCKET_NAME}
24
24
  gsutil -m setmeta -r -h "Cache-Control:no-store,no-cache,max-age=0" gs://${BUCKET_NAME}/index.html
25
25
 
26
26
 
@@ -45,32 +45,47 @@ build:
45
45
  stage: build
46
46
  script:
47
47
  - yarn build
48
+ artifacts:
49
+ paths:
50
+ - dist
51
+ - lib
52
+ - public
53
+
54
+ build-doc:
55
+ image: node:18.1-alpine
56
+ stage: build
57
+ script:
48
58
  - yarn typedoc
59
+ - cd docs
60
+ - yarn
61
+ - yarn typedoc-prepare
62
+ - apk update && apk upgrade && apk add --no-cache bash git openssh
63
+ - yarn build
49
64
  artifacts:
50
65
  paths:
51
66
  - dist
52
67
  - lib
53
68
  - public
54
- - output
69
+ - docs
55
70
 
56
71
  deploy-doc-staging:
57
72
  image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
58
73
  tags:
59
74
  - acquiring
60
75
  - staging
61
- artifacts:
62
- paths:
63
- - output
64
76
  only:
65
77
  - master
66
78
  when: manual
79
+ artifacts:
80
+ paths:
81
+ - docs
67
82
  script:
68
83
  - *bucket_deploy_script
69
84
  stage: deploy-doc-staging
70
85
  variables:
71
86
  BUCKET_NAME: awx-staging-asia-element-integration-doc
72
87
  needs:
73
- - job: build
88
+ - job: build-doc
74
89
  artifacts: true
75
90
 
76
91
  # Publish github package
@@ -0,0 +1,66 @@
1
+ # This file is only used by DevHub devhub.awx.im to display software metadata.
2
+ # It can contain multiple catalog entities, separated by ---.
3
+
4
+ # To learn more about configuring this file, see:
5
+ # - Backstage official Doc: https://backstage.io/docs/features/software-catalog/descriptor-format
6
+ # - Backstage System Model: https://backstage.io/docs/features/software-catalog/system-model
7
+ # - Airwallex catalog files: https://gitlab.awx.im/common/backstage-catalog
8
+ # - Airwallex FAQ and troubleshooting Doc: https://gitlab.awx.im/common/backstage-catalog/-/tree/master/docs
9
+
10
+ # To onboard your software to DevHub,
11
+ # 1. Remove the first # symbol in the following lines
12
+ # 2. Replace the Change_Me placeholder with your custom values
13
+
14
+ ---
15
+ #apiVersion: backstage.io/v1alpha1 # [required]
16
+ #kind: Component # [required] https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component
17
+ #metadata: # [required]
18
+ # # Note: The name should be a K8s service name or a library name because a GitLab repository can contain multiple services.
19
+ # name: Change_Me # [required] Must be unique per Kind. Must consist of sequences of [a-z0-9A-Z] possibly separated by one of [-_.].
20
+ #
21
+ # # description: Change_Me_Or_Comment_Out_This_Line # [optional] A human readable description of the entity, to be shown in DevHub.
22
+ #
23
+ # annotations: # [optional] Consumed by plugins.
24
+ # # Used by GitLab plugins to display PRs, Pipelines and so on. The value format is <gitlab-group>/<gitlab-repo-name>, e.g. gtpn/airwallex-ocs.
25
+ # gitlab.com/project-slug: acquiring/airwallex-payment-elements
26
+ # # Used by Kubernetes plugin to display k8s serviceboards. The value is your k8s service name.
27
+ # backstage.io/kubernetes-id: Change_Me_Or_Comment_Out_This_Line
28
+ # # Used by Opsgenie plugin to display Who Is On-Call. The value is Opsgenie team name, e.g. "CN DevOps".
29
+ # opsgenie.com/team: Change_Me_Or_Comment_Out_This_Line
30
+ # # Used by Opsgenie plugin to display alerts
31
+ # # This annotation accepts any valid Opsgenie Search queries for alerts, see
32
+ # # https://support.atlassian.com/opsgenie/docs/search-queries-for-alerts/
33
+ # opsgenie.com/component-selector: 'Change_Me_Or_Comment_Out_This_Line'
34
+ #
35
+ # links: # [optional] A list of links to be shown on entity page.
36
+ # - url: https://gitlab.awx.im/acquiring/airwallex-payment-elements
37
+ # title: GitLab Repo
38
+ # icon: github # [optional] Available icons: chat, dashboard, docs, email, github, group, help, search, user, warning
39
+ #
40
+ # # labels: # [optional] Labels are optional key/value pairs that are attached to the entity.
41
+ # # key1: value2
42
+ # # key2: value2
43
+ #
44
+ # # tags: # [optional] A list of single-valued strings.
45
+ # # - value1
46
+ # # - value2
47
+ #
48
+ #spec: # [required]
49
+ # type: service # [required] The value is service, library and so on.
50
+ # lifecycle: production # [required] The value is one of the experimental, production, deprecated.
51
+ # # Note: Use only the available group names at https://devhub.awx.im/catalog?filters%5Bkind%5D=group&filters%5Buser%5D=all
52
+ # owner: Change_Me_Only_Use_Group_Name_in_DevHub # [required] Group or User in DevHub, e.g. a feature team team-cloud-infra, or a user email prefix andy.wang.
53
+ #
54
+ # # system: Change_Me_Or_Comment_Out_This_Line # [optional] An entity reference to the system that the component belongs to.
55
+ #
56
+ # # dependsOn: # [optional] An array of entity references to the components and resources that the component depends on.
57
+ # # - resource:default/Change_Me
58
+ # # - component:default/Change_Me
59
+ #
60
+ # # providesApis: # [optional] An array of entity references to the APIs that are provided by the component.
61
+ # # - Change_Me
62
+ # # - Change_Me
63
+ #
64
+ # # consumesApis: # [optional] An array of entity references to the APIs that are consumed by the component.
65
+ # # - Change_Me
66
+ # # - Change_Me
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [0.2.98] */
1
+ /* Airwallex Checkout Component Version [0.2.99] */
2
2
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js",t=e=>{const r=document.createElement("script");r.src=`${e}${o}`;const t=document.head||document.body;if(!t)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return t.appendChild(r),r};exports.confirmPaymentIntent=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},exports.confirmPaymentIntentWithSavedCard=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},exports.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),exports.createPaymentConsent=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},exports.createPaymentMethod=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},exports.destroyElement=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),exports.get3dsReturnUrl=e=>window.Airwallex.get3dsReturnUrl(e),exports.getBrowserInfo=e=>window.Airwallex.getBrowserInfo(e),exports.getDeviceFingerprint=e=>window.Airwallex.getDeviceFingerprint(e),exports.getElement=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),exports.getGatewayUrl=r,exports.getPaymentIntent=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},exports.handle3ds=e=>window.Airwallex.handle3ds(e),exports.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},exports.loadAirwallex=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let n=0;const l=async()=>{const n=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||t(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{n.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),n.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),n.remove&&n.remove()}))}))};for(;n<3;)try{return await l()}catch(e){n++,await new Promise((e=>window.setTimeout(e,500)))}return null},exports.loadAirwallexJs=t,exports.redirectToCheckout=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")};
3
3
  //# sourceMappingURL=airwallex.cjs.js.map
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [0.2.98] */
1
+ /* Airwallex Checkout Component Version [0.2.99] */
2
2
  const e={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},r=r=>`https://${e[r]||e.prod}`,o="/assets/elements.bundle.min.js",l=e=>{const r=document.createElement("script");r.src=`${e}${o}`;const l=document.head||document.body;if(!l)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return l.appendChild(r),r},n=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let n=0;const i=async()=>{const n=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||l(r((null==e?void 0:e.env)||"prod"));return new Promise(((r,o)=>{n.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),n.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),n.remove&&n.remove()}))}))};for(;n<3;)try{return await i()}catch(e){n++,await new Promise((e=>window.setTimeout(e,500)))}return null},i=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},t=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},w=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),a=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),d=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),c=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},s=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},x=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},m=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},A=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},u=e=>window.Airwallex.getBrowserInfo(e),f=e=>window.Airwallex.getDeviceFingerprint(e),h=e=>window.Airwallex.get3dsReturnUrl(e),y=e=>window.Airwallex.handle3ds(e);export{c as confirmPaymentIntent,s as confirmPaymentIntentWithSavedCard,w as createElement,A as createPaymentConsent,x as createPaymentMethod,a as destroyElement,h as get3dsReturnUrl,u as getBrowserInfo,f as getDeviceFingerprint,d as getElement,r as getGatewayUrl,m as getPaymentIntent,y as handle3ds,i as init,n as loadAirwallex,l as loadAirwallexJs,t as redirectToCheckout};
3
3
  //# sourceMappingURL=airwallex.es.js.map
@@ -1,3 +1,3 @@
1
- /* Airwallex Checkout Component Version [0.2.98] */
1
+ /* Airwallex Checkout Component Version [0.2.99] */
2
2
  var Airwallex=function(e){"use strict";const r={prod:"checkout.airwallex.com",demo:"checkout-demo.airwallex.com",staging:"checkout-staging.airwallex.com",qa:"checkoutui.qa.awx.im",preview:"checkoutui.preview.awx.im",dev:"localhost:3000"},n=e=>`https://${r[e]||r.prod}`,o="/assets/elements.bundle.min.js",l=e=>{const r=document.createElement("script");r.src=`${e}${o}`;const n=document.head||document.body;if(!n)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return n.appendChild(r),r};return e.confirmPaymentIntent=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},e.confirmPaymentIntentWithSavedCard=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntentWithSavedCard(e);{const e="Please loadAirwallex() before confirmPaymentIntentWithSavedCard();";throw console.error(e),new Error(e)}},e.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),e.createPaymentConsent=async e=>{if(window.Airwallex)return window.Airwallex.createPaymentConsent(e);{const e="Please loadAirwallex() before createPaymentConsent();";throw console.error(e),new Error(e)}},e.createPaymentMethod=async(e,r)=>{if(window.Airwallex)return window.Airwallex.createPaymentMethod(e,r);{const e="Please loadAirwallex() before createPaymentMethod();";throw console.error(e),new Error(e)}},e.destroyElement=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),e.get3dsReturnUrl=e=>window.Airwallex.get3dsReturnUrl(e),e.getBrowserInfo=e=>window.Airwallex.getBrowserInfo(e),e.getDeviceFingerprint=e=>window.Airwallex.getDeviceFingerprint(e),e.getElement=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),e.getGatewayUrl=n,e.getPaymentIntent=async(e,r)=>{if(window.Airwallex)return window.Airwallex.getPaymentIntent(e,r);{const e="Please loadAirwallex() before getPaymentIntent();";throw console.error(e),new Error(e)}},e.handle3ds=e=>window.Airwallex.handle3ds(e),e.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},e.loadAirwallex=async e=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;let r=0;const t=async()=>{const r=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||l(n((null==e?void 0:e.env)||"prod"));return new Promise(((n,o)=>{r.addEventListener("load",(()=>{window.Airwallex?(window.Airwallex.init(e),n(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))})),r.addEventListener("error",(()=>{o(new Error("Failed to load Airwallex scripts")),r.remove&&r.remove()}))}))};for(;r<3;)try{return await t()}catch(e){r++,await new Promise((e=>window.setTimeout(e,500)))}return null},e.loadAirwallexJs=l,e.redirectToCheckout=e=>{if(window.Airwallex)return window.Airwallex.redirectToCheckout(e);console.error("Please loadAirwallex() before redirectToCheckout();")},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
3
3
  //# sourceMappingURL=airwallex.iife.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airwallex-payment-elements",
3
- "version": "0.2.98",
3
+ "version": "0.2.99",
4
4
  "module": "lib/bin/airwallex.es.js",
5
5
  "main": "lib/bin/airwallex.cjs.js",
6
6
  "bin": "lib/bin/airwallex.cjs.js",
@@ -102,6 +102,8 @@
102
102
  "dependencies": {
103
103
  "@types/applepayjs": "^3.0.3",
104
104
  "@types/googlepay": "^0.6.4",
105
- "csstype": "^3.0.6"
105
+ "csstype": "^3.0.6",
106
+ "typedoc-plugin-markdown": "^3.14.0",
107
+ "typedoc-plugin-merge-modules": "^4.0.1"
106
108
  }
107
109
  }
package/typedocconfig.js CHANGED
@@ -2,7 +2,7 @@ module.exports = {
2
2
  entryPoints: ['src/index.ts'],
3
3
  entryPointStrategy: 'Expand',
4
4
  tsconfig: 'tsconfig.json',
5
- out: './output',
5
+ out: './docs/source/sdk-reference',
6
6
  excludePrivate: true,
7
7
  excludeProtected: true,
8
8
  excludeExternals: true,
@@ -10,12 +10,12 @@ module.exports = {
10
10
  readme: 'README.md',
11
11
  name: 'airwallex-payment-elements',
12
12
  favicon: 'public/favicon.ico',
13
- customTitle: 'Airwallex payment element integration doc',
14
- customDescription:
15
- 'This airwallex-payment-elements library is a lightweight javascript SDK that allows merchants to conveniently integrate the Airwallex checkout flow on their website.',
16
- sidebarLinks: {
17
- 'Integration Examples': 'https://github.com/airwallex/airwallex-payment-demo/tree/master/integrations',
18
- },
13
+ categorizeByGroup: true,
14
+ mergeModulesRenameDefaults: true,
15
+ allReflectionsHaveOwnDocument: true,
16
+ categoryOrder: ['modules', 'functions', 'interfaces', 'types'],
17
+ mergeModulesMergeMode: 'off',
18
+ hideBreadcrumbs: 'true',
19
19
  externalSymbolLinkMappings: {
20
20
  // used by {@link !Promise}
21
21
  global: {
@@ -113,6 +113,7 @@ export type PaymentMethodType =
113
113
  | 'applepay'
114
114
  | 'card'
115
115
  | 'wechatpay'
116
+ | 'airwallex_pay'
116
117
  | PaymentMethodWithRedirect
117
118
  | DirectDebitPaymentMethod;
118
119