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 8f01391
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/recurly/apple-pay/apple-pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 8f01391

Please sign in to comment.