-
Notifications
You must be signed in to change notification settings - Fork 139
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
feat(apple pay): add support for recurringPaymentRequest
, move to options.paymentRequest
#804
Conversation
recurringPaymentRequest
recurringPaymentRequest
, move to options.paymentRequest
a9a27fc
to
1fd0816
Compare
The tests here just need an update to comply with the changeset in #802 |
Can be specified as the option or will be generated if the `total` line item is set to `paymentTiming='recurring'`: ```typescript const total: ApplePayLineItem = { label: 'My Subscription', paymentTiming: 'recurring', amount: '29.00', recurringPaymentIntervalUnit: 'month', recurringPaymentIntervalCount: 1, recurringPaymentStartDate: new Date(), }; const applePay = recurly.ApplePay({ total, recurringPaymentRequest: { paymentDescription: 'A recurring subscription', regularBilling: total, billingAgreement: 'Will recur forever', } }); ```
1fd0816
to
8bab08b
Compare
…equest` Cleans up the interface for calling into `recurly.ApplePay` so that the properties that drift down to the resulting payment request are not intermixed with the SDK specific parameters. As a result, deprecates `options.requiredShippingContactFields` in favor of reading it off of the `paymentRequest.requiredShippingContactFields`. Adds `options.recurring` that, when provided in combination with `options.total`, will create a total that will include a monthly recurring charge on the payment sheet. `options.paymentRequest` will be treated as the source of truth, except for when `options.pricing` is provided. This maintains the stance that Pricing controls the `total` and `lineItems`.
8bab08b
to
f630b36
Compare
else return this.initError = this.error('apple-pay-factory-only'); | ||
|
||
if (options.form) this.config.form = options.form; | ||
if (options.recurring) this.config.recurring = options.recurring; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this being a boolean will prevent it from setting through consistently when the option is provided. The side-effect of this will result in success, since false
and undefined
are functionally equivalent to the way this option is interpreted.
Simple fix would be to do if ('recurring' in options) /* ... */
or if (typeof options.recurring !== 'undefined')
[Full Changelog](v4.22.9...v4.23.0) **Merged Pull Requests** - chore(paypal): add types for display options [#812](#812) ([cbarton](https://github.com/cbarton)) - fix(apple pay): Do not teardown Braintree on cancel [#811](#811) ([cbarton](https://github.com/cbarton)) - fix(types): add type definition for Recurly#ready [#810](#810) ([cbarton](https://github.com/cbarton)) - feat(google pay): add support for the paymentDataRequest [#809](#809) ([cbarton](https://github.com/cbarton)) - feat(Apple Pay): allow for customization of event updates [#808](#808) ([cbarton](https://github.com/cbarton)) - Update config type with requiredShippingContactFields [#806](#806) ([BARK-RMILLER](https://github.com/BARK-RMILLER)) - feat(apple pay): add support for `recurringPaymentRequest`, move to `options.paymentRequest` [#804](#804) ([cbarton](https://github.com/cbarton)) - fix(apple pay): emit events when restore pricing addresses [#803](#803) ([cbarton](https://github.com/cbarton)) - chore(apple pay): capture async test errors to fail faster [#802](#802) ([cbarton](https://github.com/cbarton)) - feat(apple pay): populate contacts with pricing addresses [#801](#801) ([cbarton](https://github.com/cbarton)) - feat(apple pay): allow for supportedNetworks selection [#800](#800) ([cbarton](https://github.com/cbarton)) - feat(apple pay): update tax when billing/shipping contact changes [#798](#798) ([cbarton](https://github.com/cbarton)) - feat(apple pay): populate billingContact with form address fields [#797](#797) ([cbarton](https://github.com/cbarton)) - feat(Apple Pay): validate and support more ApplePayPaymentRequest features [#794](#794) ([cbarton](https://github.com/cbarton)) - [feat][google-pay] send raw payment data to server [#789](#789) ([cbarton](https://github.com/cbarton)) **Closed Issues** - property 'ready' does not exist on type 'Recurly'.ts [#795](#795) - Missing types definitions for `coupon` method [#698](#698) - If formRef unmounts during call, recurly.token fails silently. [#697](#697) - The user can enter 4 digits as the month value in the expiration date field. [#678](#678) ##### Minified MD5 Checksum ``` 75584733b78f6ca6c6a65267b07fb9ad ./build/recurly.min.js ``` ##### [SRI Hash](https://www.srihash.org/) ``` pX41INy9qepZfHHYL13noWEbReg+bDOqU2jzjgkC3kkDh36KlPFeiJBxUgca8DtP ```
Cleans up the interface for calling into
recurly.ApplePay
so that theproperties that drift down to the resulting payment request are not
intermixed with the SDK specific parameters.
As a result, deprecates
options.requiredShippingContactFields
in favorof reading it off of the
paymentRequest.requiredShippingContactFields
.Adds
options.recurring
that, when provided in combination withoptions.total
, will create a total that will include a monthlyrecurring charge on the payment sheet.
options.paymentRequest
will be treated as the source of truth, exceptfor when
options.pricing
is provided. This maintains the stance thatPricing controls the
total
andlineItems
.Can be will be generated if the
total
line item is set topaymentTiming='recurring'
:OR specified as the
recurringPaymentRequest
option: