stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.13k stars 984 forks source link

[Feature] Support coupon code on Apple Pay #2278

Closed JoeyLeeMEA closed 4 months ago

JoeyLeeMEA commented 1 year ago

Is your feature request related to a problem? Please describe.

STRApplePayContext class is used for Apple Pay implementation and it provides a simple interface defined in ApplePayContextDelegate which is great. But unfortunately it doesn't support coupons which was introduced on iOS 15. Currently there is no way to detect if users enter the coupon code on the Apple Pay dialog.

Describe the solution you'd like

Plesase internally implement paymentAuthorizationViewController(_:didChangeCouponCode:handler:) defined in PKPaymentAuthorizationViewControllerDelegate protocol. https://developer.apple.com/documentation/passkit/pkpaymentauthorizationviewcontrollerdelegate/3752107-paymentauthorizationviewcontroll

And provide a relevant function in ApplePayContextDelegate.

Additional context

To enable the coupon code text field on Apple Pay dialog(PKPaymentAuthorizationViewController), set supportsCouponCode to true in PKPaymentRequest

For example:

let paymentRequest = StripeAPI.paymentRequest(withMerchantIdentifier: merchantIdentifier, country: "US", currency: "USD")
paymentRequest.supportsCouponCode = true
eurias-stripe commented 1 year ago

Thanks for the suggestion @JoeyLeeMEA, we'll look into it and prioritize it accordingly.

jaredmg75 commented 9 months ago

Has this feature request been implemented or is it going to be prioritized in the near future?

JoeyLeeMEA commented 4 months ago

@eurias-stripe Could we get an update on this feature request? The delay is impacting our project, and we would appreciate any info on the timeline.

yuki-stripe commented 4 months ago

@JoeyLeeMEA @jaredmg75 This has been added in 23.28.0

JoeyLeeMEA commented 4 months ago

@JoeyLeeMEA @jaredmg75 This has been added in 23.28.0

That's fantastic news! Thank you very much for the update. @yuki-stripe