-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Apple Pay): allow for customization of event updates
Adds the `options.callbacks` option which supports the following callbacks: - `onPaymentMethodSelected` - `onShippingContactSelected` - `onShippingMethodSelected` - `onPaymentAuthorized` to correspond with the `ApplePaySession` events. A callback must return either the Apple Pay update object or a Promise that resolves with that object. That update object will be used to complete the `ApplePaySession` event to open up the ability to fetch custom taxes on payment method selection, update shipping costs on shipping contact/method selection and validate email/phone addresses on authorization. This does not remove the existing events being emitted but the workflow should be updated to prefer using `onPaymentAuthorized` to complete the purchase instead of async on the `token` event. The event that is sent to that callback includes the `payment.recurlyToken` for use. This also enhances the `token` event to include the raw payment event as the second argument.
- Loading branch information
Showing
2 changed files
with
238 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.