Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
Since the SDK supports iOS 12 as a minimum right now, it was time to move away from Apple Pay iOS 10 delegate methods to iOS 11 delegate methods, this allows other developers to validate and provide custom errors through Apple Pay error objects such as
Instead of just showing "Shipping address is invalid", developers will be able to show specific error message which ultimately allows for a better customization when presenting Shopify's Apple Pay Modal.
This PR introduces breaking changes to PaySessionDelegate, all delegate methods now include extra error array in provide closures, and the final call which has completeTransaction closure now has associated type on its failure case to include array of errors, in order to display them on the UI.
While implementing Shopify's Apple Pay modal, a requirement was defined that I need to validate all the user inputs and display custom messages on the UI. There was no way except for forking this and rolling my own implementation. I suppose this will be helpful for other developers that would face the same challenge.
Code Design / Convention / Tests
The PR ensures that the new implementation does not break the design of the code, naming conventions and all tests are passing.
What this does
Since the SDK supports iOS 12 as a minimum right now, it was time to move away from Apple Pay iOS 10 delegate methods to iOS 11 delegate methods, this allows other developers to validate and provide custom errors through Apple Pay error objects such as
Instead of just showing "Shipping address is invalid", developers will be able to show specific error message which ultimately allows for a better customization when presenting Shopify's Apple Pay Modal.
This PR introduces breaking changes to
PaySessionDelegate
, all delegate methods now include extraerror
array inprovide
closures, and the final call which hascompleteTransaction
closure now has associated type on its failure case to include array of errors, in order to display them on the UI.PaySessionDelegate Changes
Incentive
While implementing Shopify's Apple Pay modal, a requirement was defined that I need to validate all the user inputs and display custom messages on the UI. There was no way except for forking this and rolling my own implementation. I suppose this will be helpful for other developers that would face the same challenge.
Code Design / Convention / Tests
The PR ensures that the new implementation does not break the design of the code, naming conventions and all tests are passing.