feat: Accelerated Checkouts#230
Merged
Merged
Conversation
812f820 to
8c61152
Compare
f59f299 to
d48d9a7
Compare
d9a710d to
07e60da
Compare
fe1e7ce to
8999ab7
Compare
07e60da to
590f709
Compare
2e8b5bc to
ceb880a
Compare
590f709 to
c354c9d
Compare
40bdbd7 to
159c224
Compare
markmur
commented
Aug 21, 2025
Comment on lines
+1
to
+29
| BasedOnStyle: LLVM | ||
| Language: ObjC | ||
| UseTab: Never | ||
| IndentWidth: 2 | ||
| ContinuationIndentWidth: 2 | ||
| ColumnLimit: 120 | ||
|
|
||
| # Keep long macro calls (e.g., RCT_EXTERN_METHOD) readable | ||
| AlignAfterOpenBracket: DontAlign | ||
| BinPackArguments: false | ||
| BinPackParameters: false | ||
| PenaltyBreakBeforeFirstCallParameter: 200 | ||
| ReflowComments: false | ||
|
|
||
| # Objective-C specifics | ||
| ObjCSpaceAfterProperty: true | ||
| ObjCSpaceBeforeProtocolList: true | ||
| ObjCBreakBeforeNestedBlockParam: true | ||
| PointerAlignment: Left | ||
| BreakBeforeBraces: Attach | ||
| SpaceBeforeParens: ControlStatements | ||
| SortIncludes: false | ||
|
|
||
| # Treat common React Native macros as statements for nicer wrapping | ||
| StatementMacros: | ||
| - RCT_EXTERN_METHOD | ||
| - RCT_EXTERN_MODULE | ||
| - RCT_EXPORT_VIEW_PROPERTY | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Helps with the formatting of the .mm files
markmur
commented
Aug 21, 2025
| // MARK: - Apple Pay Button | ||
|
|
||
| @available(iOS 16.0, *) | ||
| extension PayWithApplePayButtonLabel { |
Contributor
Author
There was a problem hiding this comment.
The native PayWithApplePayButtonLabel export from PassKit is a struct with static properties. It is unfortunately not an enum which can be initialized from a rawValue
markmur
commented
Aug 21, 2025
| var applePayConfiguration: ShopifyAcceleratedCheckouts.ApplePayConfiguration? | ||
|
|
||
| // TODO: Replace this with public defaults from the kit when available | ||
| var defaultWallets: [Wallet] = [.applePay, .shopPay] |
Contributor
Author
There was a problem hiding this comment.
Need this to be publicly available as a property on the kit before removing here
markmur
commented
Aug 21, 2025
markmur
commented
Aug 21, 2025
Comment on lines
+169
to
+170
| case .error: | ||
| return ["state": "error"] |
Contributor
Author
There was a problem hiding this comment.
TODO: Expose reason here when available (not a blocker for this PR)
markmur
commented
Aug 21, 2025
Comment on lines
+91
to
+97
| const available = await instance.current?.configureAcceleratedCheckouts( | ||
| configuration.acceleratedCheckouts, | ||
| ); | ||
| setAcceleratedCheckoutsAvailable(available); | ||
| } | ||
|
|
||
| instance.current?.setConfig(configuration); |
Contributor
Author
There was a problem hiding this comment.
These configuration calls could potentially be conflated
c4c9beb to
58413ac
Compare
f83bc98 to
7b2228d
Compare
7b2228d to
1947e00
Compare
f7aedc1 to
ce5878a
Compare
ce5878a to
6627150
Compare
1e4ccf9 to
f1ab9f9
Compare
kieran-osgood-shopify
approved these changes
Aug 26, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integration guide
<ShopifyCheckoutSheetProvider config={{ ...checkoutKitConfigDefaults, + acceleratedCheckouts: { + storefrontDomain: env.STOREFRONT_DOMAIN!, + storefrontAccessToken: env.STOREFRONT_ACCESS_TOKEN!, + wallets: { + applePay: { + contactFields: [ApplePayContactField.email, ApplePayContactField.phone], + merchantIdentifier: env.STOREFRONT_MERCHANT_IDENTIFIER!, + }, + }, } }} > + <AcceleratedCheckoutButtons + applePayLabel={ApplePayLabel.buy} + cartId={cartId} + cornerRadius={10} + wallets={[ + AcceleratedCheckoutWallet.applePay, + AcceleratedCheckoutWallet.shopPay, + ]} + /> </ShopifyCheckoutSheetProvider>Not included in this PR
Manual Testing
iOS
AcceleratedCheckoutButtonsrenders as expected withcartIdAcceleratedCheckoutButtonsrenders as expected withvariantIdandquantityAcceleratedCheckoutButtonsthrows in development ifvariantIdis empty orquantityis less than 1AcceleratedCheckoutButtonsrenders nothing whenwallets={[]}AcceleratedCheckoutButtonsdo not render on iOS devices < 16cornerRadiusrenders as expectedapplePayLabelrenders as expectedShopifyCheckoutSheetProvidercontext providerAndroid
Expectation: Buttons do not show on Android and occupy 0 space.
PR Checklist
Important
package.jsonfile.Tip
See the Contributing documentation for instructions on how to publish a new version of the library.