Skip to content

Commit

Permalink
Add fraud params to Apple-Pay token
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanderson1130 committed Feb 28, 2025
1 parent f72582b commit 0443f57
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/recurly/apple-pay/apple-pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export class ApplePay extends Emitter {
*
* @private
*/
mapPaymentData (event) {
mapPaymentData(event) {
const {
billingContact,
token: { paymentData, paymentMethod },
Expand All @@ -438,12 +438,22 @@ export class ApplePay extends Emitter {
return {
paymentData,
paymentMethod,
...(this.config.form && normalize(this.config.form, NON_ADDRESS_FIELDS, { parseCard: false }).values),
...combinedInputs.call(this),
...transformAddress(billingContact, { to: 'address', except: ['emailAddress'] }),
};
}
}

function combinedInputs () {
if (this.config.form) {
const { values: inputs } = normalize(this.config.form, NON_ADDRESS_FIELDS, { parseCard: false });
const fraud = this.recurly.fraud.params(inputs);

inputs.fraud = fraud;
return { ...inputs };
}
}

function makeCallback (applePay, callbackName) {
const callback = applePay.config.callbacks?.[callbackName];
const eventName = CALLBACK_EVENT_MAP[callbackName];
Expand Down

0 comments on commit 0443f57

Please sign in to comment.