Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fraud params to Apple-Pay token #915

Merged
merged 1 commit into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
browser:
- Chrome
- Firefox
- Electron
steps:
- uses: browser-actions/setup-chrome@v1
- uses: browser-actions/setup-firefox@v1
Expand All @@ -50,11 +49,11 @@ jobs:
browser:
- Safari-Remote
- Edge-Remote
- iOS-16-Remote
- iOS-15-Remote
- iOS-18-Remote
- iOS-17-Remote
- Android-14-Remote
- Android-13-Remote
- Android-12-Remote
- Android-11-Remote
steps:
- uses: actions/checkout@v3
- name: Unit test
Expand All @@ -80,11 +79,11 @@ jobs:
- Firefox-Remote
- Safari-Remote
- Edge-Remote
- iOS-16-Remote
- iOS-15-Remote
- iOS-18-Remote
- iOS-17-Remote
- Android-14-Remote
- Android-13-Remote
- Android-12-Remote
- Android-11-Remote
steps:
- uses: actions/checkout@v3
- name: End-to-end test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules
tmp
npm-debug.log
local.log
logs/
1 change: 1 addition & 0 deletions browserstack.err
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[object Object]
16 changes: 15 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,26 @@ 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) {
return;
}

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

if (Object.keys(fraud).length > 0) {
inputs.fraud = fraud;
}
return { ...inputs };
}

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