airwallex-payment-elements
Advanced tools
Comparing version 0.0.81 to 0.0.82
@@ -1,4 +0,4 @@ | ||
/* Airwallex Checkout Component Version [0.0.81] */ | ||
"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]||"checkout.airwallex.com"),o=`/assets/bundle.${[0,0,81].join(".")}.min.js`;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.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),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.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.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},exports.loadAirwallex=e=>Promise.resolve().then(()=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;const l=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||(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})(r((null==e?void 0:e.env)||"prod"));return new Promise((r,o)=>{l.addEventListener("load",()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))}),l.addEventListener("error",()=>{o(new Error("Failed to load Airwallex scripts"))})})}),exports.redirectToCheckout=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")}; | ||
/* Airwallex Checkout Component Version [0.0.82] */ | ||
"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]||"checkout.airwallex.com"),o=`/assets/bundle.${[0,0,82].join(".")}.min.js`;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.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),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.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.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},exports.loadAirwallex=e=>Promise.resolve().then(()=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;const l=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||(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})(r((null==e?void 0:e.env)||"prod"));return new Promise((r,o)=>{l.addEventListener("load",()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))}),l.addEventListener("error",()=>{o(new Error("Failed to load Airwallex scripts"))})})}),exports.redirectToCheckout=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")}; | ||
/* Airwallex @Charlie.Lang */ | ||
//# sourceMappingURL=airwallex.cjs.js.map |
@@ -1,4 +0,4 @@ | ||
/* Airwallex Checkout Component Version [0.0.81] */ | ||
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]||"checkout.airwallex.com"),o=`/assets/bundle.${[0,0,81].join(".")}.min.js`,l=e=>Promise.resolve().then(()=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;const l=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||(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})(r((null==e?void 0:e.env)||"prod"));return new Promise((r,o)=>{l.addEventListener("load",()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))}),l.addEventListener("error",()=>{o(new Error("Failed to load Airwallex scripts"))})})}),n=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},i=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")},t=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),a=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),d=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},c=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)}},s=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)}};export{d as confirmPaymentIntent,t as createElement,c as createPaymentMethod,w as destroyElement,a as getElement,r as getGatewayUrl,s as getPaymentIntent,n as init,l as loadAirwallex,i as redirectToCheckout}; | ||
/* Airwallex Checkout Component Version [0.0.82] */ | ||
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]||"checkout.airwallex.com"),o=`/assets/bundle.${[0,0,82].join(".")}.min.js`,l=e=>Promise.resolve().then(()=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;const l=document.querySelector(`script[src="${o}"], script[src="${o}/"]`)||(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})(r((null==e?void 0:e.env)||"prod"));return new Promise((r,o)=>{l.addEventListener("load",()=>{window.Airwallex?(window.Airwallex.init(e),r(window.Airwallex)):o(new Error("Failed to load Airwallex on load event"))}),l.addEventListener("error",()=>{o(new Error("Failed to load Airwallex scripts"))})})}),n=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},i=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")},t=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),w=e=>window.Airwallex?window.Airwallex.destroyElement(e):(console.error("Please loadAirwallex() before destroyElement();"),!1),a=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),d=async e=>{if(window.Airwallex)return window.Airwallex.confirmPaymentIntent(e);{const e="Please loadAirwallex() before confirmPaymentIntent();";throw console.error(e),new Error(e)}},c=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)}},s=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)}};export{d as confirmPaymentIntent,t as createElement,c as createPaymentMethod,w as destroyElement,a as getElement,r as getGatewayUrl,s as getPaymentIntent,n as init,l as loadAirwallex,i as redirectToCheckout}; | ||
/* Airwallex @Charlie.Lang */ | ||
//# sourceMappingURL=airwallex.es.js.map |
@@ -1,4 +0,4 @@ | ||
/* Airwallex Checkout Component Version [0.0.81] */ | ||
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"},o=e=>"https://"+(r[e]||"checkout.airwallex.com"),l=`/assets/bundle.${[0,0,81].join(".")}.min.js`;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.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),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.getElement=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),e.getGatewayUrl=o,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.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},e.loadAirwallex=e=>Promise.resolve().then(()=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;const r=document.querySelector(`script[src="${l}"], script[src="${l}/"]`)||(e=>{const r=document.createElement("script");r.src=`${e}${l}`;const o=document.head||document.body;if(!o)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return o.appendChild(r),r})(o((null==e?void 0:e.env)||"prod"));return new Promise((o,l)=>{r.addEventListener("load",()=>{window.Airwallex?(window.Airwallex.init(e),o(window.Airwallex)):l(new Error("Failed to load Airwallex on load event"))}),r.addEventListener("error",()=>{l(new Error("Failed to load Airwallex scripts"))})})}),e.redirectToCheckout=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")},e}({}); | ||
/* Airwallex Checkout Component Version [0.0.82] */ | ||
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"},o=e=>"https://"+(r[e]||"checkout.airwallex.com"),l=`/assets/bundle.${[0,0,82].join(".")}.min.js`;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.createElement=(e,r)=>window.Airwallex?window.Airwallex.createElement(e,r):(console.error("Please loadAirwallex() before createElement();"),null),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.getElement=e=>window.Airwallex?window.Airwallex.getElement(e):(console.error("Please loadAirwallex() before getElement();"),null),e.getGatewayUrl=o,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.init=e=>{window.Airwallex?window.Airwallex.init(e):console.error("Please loadAirwallex() before init();")},e.loadAirwallex=e=>Promise.resolve().then(()=>{if("undefined"==typeof window)return null;if(window.Airwallex)return window.Airwallex;const r=document.querySelector(`script[src="${l}"], script[src="${l}/"]`)||(e=>{const r=document.createElement("script");r.src=`${e}${l}`;const o=document.head||document.body;if(!o)throw new Error("Airwallex payment scripts requires a <head> or <body> html element in order to be loaded.");return o.appendChild(r),r})(o((null==e?void 0:e.env)||"prod"));return new Promise((o,l)=>{r.addEventListener("load",()=>{window.Airwallex?(window.Airwallex.init(e),o(window.Airwallex)):l(new Error("Failed to load Airwallex on load event"))}),r.addEventListener("error",()=>{l(new Error("Failed to load Airwallex scripts"))})})}),e.redirectToCheckout=e=>{window.Airwallex?window.Airwallex.redirectToCheckout(e):console.error("Please loadAirwallex() before redirectToCheckout();")},e}({}); | ||
/* Airwallex @Charlie.Lang */ | ||
//# sourceMappingURL=airwallex.iife.js.map |
{ | ||
"name": "airwallex-payment-elements", | ||
"version": "0.0.81", | ||
"version": "0.0.82", | ||
"module": "lib/bin/airwallex.es.js", | ||
@@ -31,3 +31,4 @@ "main": "lib/bin/airwallex.cjs.js", | ||
"test-sonar": "sonar-scanner", | ||
"semantic-release": "semantic-release" | ||
"semantic-release": "semantic-release", | ||
"type-coverage": "type-coverage --detail" | ||
}, | ||
@@ -34,0 +35,0 @@ "author": "Charlie.Lang", |
@@ -33,3 +33,3 @@ # airwallex-payment-elements | ||
```html | ||
<script src="https://checkout.airwallex.com/assets/bundle.0.0.79.min.js"></script> | ||
<script src="https://checkout.airwallex.com/assets/bundle.0.0.82.min.js"></script> | ||
``` | ||
@@ -257,2 +257,95 @@ | ||
## Below are universal javascript in browser to testing | ||
```html | ||
<body> | ||
<h1>Airwallex checkout integration</h1> | ||
<!-- HPP --> | ||
<script> | ||
const intentId = 'replace-with-your-intent-id'; | ||
const client_secret = 'replace-with-your-client-secret'; | ||
Airwallex.redirectToCheckout({ | ||
env: 'dev', | ||
intentId: intentId, | ||
client_secret | ||
}) | ||
</script> | ||
<!-- DropIn integration--> | ||
<h2>DropIn integration</h2> | ||
<div id='dropIn'></div> | ||
<script> | ||
Airwallex.init({ | ||
env: 'dev', | ||
origin: window.location.origin, | ||
}); | ||
const dropIn = Airwallex.createElement('dropIn', { | ||
intent: { | ||
id: intentId, | ||
client_secret | ||
} | ||
}); | ||
dropIn.mount('dropIn'); | ||
</script> | ||
<!-- Card integration--> | ||
<h2>Card integration</h2> | ||
<div id='card'></div> | ||
<script> | ||
Airwallex.init({ | ||
origin: window.location.origin, | ||
env: 'dev' | ||
}); | ||
const card = Airwallex.createElement('card', { | ||
intent: { | ||
id: intentId, | ||
client_secret | ||
} | ||
}); | ||
card.mount('card'); | ||
</script> | ||
<!-- Card elements integration--> | ||
<h2>Card elements integration</h2> | ||
<label> | ||
Card number | ||
<div id='cardNumber'></div> | ||
</label> | ||
<label> | ||
Expiry | ||
<div id='expiry'></div> | ||
</label> | ||
<label> | ||
CVC | ||
<div id='cvc'></div> | ||
</label> | ||
<br> | ||
<button id='submit'>Submit</button> | ||
<script> | ||
Airwallex.init({ | ||
env: 'dev', | ||
origin: window.location.origin, | ||
}); | ||
const cardNumber = Airwallex.createElement('cardNumber'); | ||
const expiry = Airwallex.createElement('expiry'); | ||
const cvc = Airwallex.createElement('cvc'); | ||
cardNumber.mount('cardNumber'); | ||
expiry.mount('expiry'); | ||
cvc.mount('cvc'); | ||
document.getElementById('submit').addEventListener('click', () => { | ||
Airwallex.confirmPaymentIntent({ | ||
element: cardNumber, | ||
payment_method: { | ||
card: { | ||
name: 'card_name' | ||
}, | ||
}, | ||
intentId, | ||
client_secret | ||
}).then((response) => { | ||
/* handle confirm response */ | ||
console.info(response); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
``` | ||
## Below are the live demo site you can play with | ||
@@ -259,0 +352,0 @@ |
@@ -37,6 +37,10 @@ import { Element, ElementType } from './element'; | ||
* Indicate which airwallex integration env your merchant site would like to connect with | ||
* If not provide default will be prod which point to: 'https://checkout.airwallex.com' | ||
* If not provide default will be prod which point to [Airwallex Checkout](https://checkout.airwallex.com) | ||
*/ | ||
env?: AirwallexEnv; | ||
/** | ||
* Your checkout website origin url, aka merchant checkout page's 'window.location.origin' field | ||
*/ | ||
origin?: string; | ||
/** | ||
* i18n localization config | ||
@@ -52,3 +56,3 @@ */ | ||
/** | ||
* Supported customized pseudo css style for 'cardNumber' | 'expiry' | 'cvc' elements | ||
* Supported customized pseudo css style for `cardNumber` | `expiry` | `cvc` elements | ||
* https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes | ||
@@ -65,3 +69,3 @@ */ | ||
* 1. Reference: https://github.com/frenic/csstype | ||
* 2. Extend with element variations for 'hpp' | 'card' | 'dropIn', following the best practices of https://material-ui.com/api/input-base/ | ||
* 2. Extend with element variations for `hpp` | `card` | `dropIn`, following the best practices of https://material-ui.com/api/input-base/ | ||
* 3. To support customized Popup overlay width and height | ||
@@ -71,9 +75,12 @@ */ | ||
/** | ||
* Input variation for 'hpp' | 'card' | 'dropIn' integration | ||
* Input variation for `hpp` | `card` | `dropIn` integration | ||
*/ | ||
variant?: 'outlined' | 'filled' | 'standard' | 'bootstrap'; | ||
/** | ||
* Customized Popup overlay width and height like 3DS payment flow | ||
* Customized Popup overlay width like 3DS payment flow | ||
*/ | ||
popupWidth?: number; | ||
/** | ||
* Customized Popup overlay height like 3DS payment flow | ||
*/ | ||
popupHeight?: number; | ||
@@ -108,3 +115,3 @@ } | ||
* The payment intent you would like to checkout | ||
* Refer to https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro | ||
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro) | ||
*/ | ||
@@ -132,3 +139,3 @@ intent?: Intent; | ||
* Indicate which airwallex integration env your merchant site would like to connect with | ||
* If not provide default will be prod which point to: 'https://checkout.airwallex.com' | ||
* If not provide default will be prod which point to [Airwallex Checkout](https://checkout.airwallex.com) | ||
*/ | ||
@@ -149,3 +156,3 @@ env?: AirwallexEnv; | ||
/** | ||
* Checkout for know customer, refer to https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro | ||
* Checkout for know customer, refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Customers/Intro) | ||
*/ | ||
@@ -222,14 +229,13 @@ customer_id?: string; | ||
* Interface to confirm a payment intent with card payment method, the full api request payload can be found: | ||
* https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/_api_v1_pa_payment_intents__id__confirm/post | ||
* [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/_api_v1_pa_payment_intents__id__confirm/post) | ||
* | ||
* BACKGROUNDS: | ||
* ------------ | ||
* Due to PCI CSS https://www.pcisecuritystandards.org/ Airwallex js SDK will load Airwallex javascript to handle all sensitive information | ||
* Due to [PCI CSS](https://www.pcisecuritystandards.org/) Airwallex js SDK will load Airwallex javascript to handle all sensitive information | ||
* The PCI Security Standards Council (SSC) defines `cardholder data` which must also be protected: | ||
* Primary Account Number (PAN) or the full PAN along with any of the following elements: | ||
* Cardholder name | ||
* Expiration date | ||
* Service code | ||
* | ||
* Primary Account Number (PAN) or the full PAN along with any of the following elements: `Cardholder name` `Expiration date` `Service code` | ||
* | ||
* Sensitive Authentication Data, which must also be protected, includes full magnetic stripe data, CAV2, CVC2, CVV2, CID, PINs, PIN blocks | ||
* Only apply to Card elements (cardNumber | cvc | expiry) integration, refer to ElementType | ||
* Only apply to Card elements (`cardNumber` | `cvc` | `expiry`) integration, refer to ElementType | ||
* | ||
@@ -239,2 +245,3 @@ * SOLUTIONS: | ||
* The javascript SDK will fulfill collection of all the sensitive information required by PCI DSS | ||
* | ||
* You checkout page can collect the rest of NON-PCI DSS data and call confirmPaymentIntent using below interface to pass them to Airwallex checkout | ||
@@ -257,3 +264,3 @@ */ | ||
* The payment intent you would like to checkout | ||
* Refer to https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro | ||
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro) | ||
*/ | ||
@@ -316,6 +323,9 @@ intentId?: string; | ||
/** | ||
* Element integration `step #1` | ||
* Element integration `step #1.1` (optional) | ||
* | ||
* Optional if you already call `loadAirwallex: (options?: InitOptions | undefined)` | ||
* | ||
* The first method call to init element integration after loadAirwallex successfully return | ||
* Exceptional: not needed for HPP integration, means you can call redirectToCheckout right after loadAirwallex succeeded | ||
* | ||
* ***Exceptional***: not needed for HPP integration, means you can call redirectToCheckout right after loadAirwallex succeeded | ||
*/ | ||
@@ -322,0 +332,0 @@ export declare const init: (options?: InitOptions | undefined) => void; |
/** | ||
* The payment intent you would like to checkout | ||
* Refer to https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro | ||
* Hint: this interface only contain the necessary information when shopper checkout | ||
* Refer to [Airwallex Client API](https://www.airwallex.com/docs/api#/Payment_Acceptance/Payment_Intents/Intro) | ||
* | ||
* ***Hint***: | ||
* This interface only contain the necessary information when shopper checkout | ||
* For the detail meaning of each field you can refer to above api document | ||
@@ -6,0 +8,0 @@ */ |
@@ -24,8 +24,9 @@ import { ElementOptions } from './airwallex'; | ||
| 'onBlur' | ||
| 'onChange' | ||
| 'onClick'; | ||
| 'onChange'; | ||
/** | ||
* The event object your checkout page can listen to by below implementation: | ||
* Using html CustomEvent: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent | ||
* | ||
* Using html [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent) | ||
* | ||
* window.addEventListener(code: EventCode, (event: { detail: ElementEvent }) => /* Your code here *\/ ); | ||
@@ -75,4 +76,8 @@ */ | ||
* Functions and external fields can be using in your integration flow with airwallex element | ||
* | ||
* Two ways to get elements, by call createElement function or getElement | ||
* IMPORTANT: once element destroy by call function destroyElement, the element reference should not be using anymore | ||
* | ||
* ***IMPORTANT*** | ||
* | ||
* Once element destroy by call function destroyElement, the element reference should not be using anymore | ||
*/ | ||
@@ -79,0 +84,0 @@ export interface Element { |
@@ -37,3 +37,20 @@ export * from './cardNumber'; | ||
/** | ||
* Element integration `step #1` | ||
* For integration using `yarn add` or `npm install` the very beginning step method to load all element stuff | ||
* | ||
* An equal step for using UMD build in your HTML: | ||
* ```html | ||
* <script src="https://checkout.airwallex.com/assets/bundle.0.0.79.min.js"></script> | ||
* ``` | ||
* | ||
* For element integration there are ***4*** steps in total, the remain steps are | ||
* | ||
* 2. integrate with `createElement` function in this package to create element on demand | ||
* | ||
* 3. using element create from #2 to mount on your dom by call `element.mount` function | ||
* | ||
* 4. collect non-pci fields (i.e billing, card name etc, except card number, cvc, expiry) and integrate with `confirmPaymentIntent` in this package | ||
* | ||
* After integrate with above 4 steps, you can listen on the event define by interface `ElementEvent` for user interaction. | ||
* | ||
*/ | ||
@@ -43,3 +60,3 @@ export declare const loadAirwallex: (options?: InitOptions | undefined) => Promise<Airwallex | null>; | ||
/** | ||
* Global Airwallex const be created after loadAirwallex, you can call it will all supported methods | ||
* Global Airwallex const be created after loadAirwallex, you can use all supported methods of `window.Airwallex` | ||
*/ | ||
@@ -46,0 +63,0 @@ export interface Window { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
615
358
58741
13