airwallex-payment-elements
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -33,3 +33,3 @@ import { css, html, LitElement } from 'lit-element'; | ||
handleEvent(data) { | ||
const myEvent = new CustomEvent('airwallex-checkout', { | ||
const event = new CustomEvent('airwallex-checkout', { | ||
detail: data, | ||
@@ -39,3 +39,3 @@ bubbles: true, | ||
}); | ||
this.dispatchEvent(myEvent); | ||
this.dispatchEvent(event); | ||
} | ||
@@ -46,6 +46,8 @@ checkoutEventHandler(event) { | ||
console.log(`Airwallex Checkout Message: [${JSON.stringify(event.data)}]`); | ||
const parameters = `attemptId=${event.data.attemptId}&instrumentId=${event.data.instrumentId}&transactionId=${event.data.transactionId}`; | ||
const parameters = `attemptId=${event.data.payment_transaction_id}&instrumentId=${event.data.instrument_id}&transactionId=${event.data.payment_attempt_id}`; | ||
if (this.successUrl) { | ||
window.location.href = | ||
this.successUrl.indexOf('?') === -1 ? `${this.successUrl}?${parameters}` : `${this.successUrl}&${parameters}`; | ||
this.successUrl.indexOf('?') === -1 | ||
? `${this.successUrl}?${parameters}` | ||
: `${this.successUrl}&${parameters}`; | ||
} | ||
@@ -52,0 +54,0 @@ else { |
{ | ||
"name": "airwallex-payment-elements", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
@@ -41,7 +41,8 @@ import { css, html, LitElement } from 'lit-element'; | ||
handleEvent(data) { | ||
const myEvent = new CustomEvent('airwallex-checkout', { | ||
const event = new CustomEvent('airwallex-checkout', { | ||
detail: data, | ||
bubbles: true, | ||
composed: true }); | ||
this.dispatchEvent(myEvent); | ||
composed: true | ||
}); | ||
this.dispatchEvent(event); | ||
} | ||
@@ -53,10 +54,12 @@ checkoutEventHandler(event) { | ||
console.log(`Airwallex Checkout Message: [${JSON.stringify(event.data)}]`); | ||
const parameters = `attemptId=${event.data.attemptId}&instrumentId=${event.data.instrumentId}&transactionId=${event.data.transactionId}`; | ||
const parameters = `attemptId=${event.data.payment_transaction_id}&instrumentId=${event.data.instrument_id}&transactionId=${event.data.payment_attempt_id}`; | ||
if (this.successUrl) { | ||
window.location.href = | ||
this.successUrl.indexOf('?') === -1 ? `${this.successUrl}?${parameters}` : `${this.successUrl}&${parameters}`; | ||
this.successUrl.indexOf('?') === -1 | ||
? `${this.successUrl}?${parameters}` | ||
: `${this.successUrl}&${parameters}`; | ||
} else { | ||
this.handleEvent(event.data); | ||
} | ||
} else if (event.data.code === 'AWX_CHECKOUT_CANCEL') { | ||
} else if (event.data.code === 'AWX_CHECKOUT_CANCEL') { | ||
// tslint:disable-next-line: no-console | ||
@@ -69,3 +72,3 @@ console.log(`Airwallex Checkout Message: [${JSON.stringify(event.data)}]`); | ||
} | ||
} else if (event.data.code === 'AWX_CHECKOUT_ERROR') { | ||
} else if (event.data.code === 'AWX_CHECKOUT_ERROR') { | ||
// tslint:disable-next-line: no-console | ||
@@ -78,3 +81,3 @@ console.log(`Airwallex Checkout Message: [${JSON.stringify(event.data)}]`); | ||
} | ||
} else { | ||
} else { | ||
// ❌Should never get here! | ||
@@ -81,0 +84,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
2838059
3026