BUYPaymentButton

The iOS Buy SDK includes a BUYPaymentButton: an open-sourced, vector-based Apple Pay button that supports all iOS 8 versions at any resolution.

BUYPaymentButton vs. PKPaymentButton

In iOS 8.3, Apple released PKPaymentButton an Apple Pay UIButton subclass that makes it much easier to add an Apple Pay button in an app than previous iOS 8 versions. Unfortunately, supporting and creating Apple Pay buttons in earlier versions of iOS 8 is tedious.

Our solution to that problem is BUYPaymentButton, available on GitHub here: https://github.com/Shopify/buypaymentbutton or as part of the iOS Buy SDK API Reference.

BUYPaymentButtonPKPaymentButton

BUYPaymentButton is a single class that can be used on any version of iOS 8.

You simply create the BUYPaymentButton like you would a PKPaymentButton:

BUYPaymentButton *paymentButton = [BUYPaymentButton buttonWithType:BUYPaymentButtonTypeBuy style:BUYPaymentButtonStyleBlack];

Button types and styles

We support the same types and styles as PKPaymentButton and we'll automatically return the appropriate button based on the iOS version the app is running on; a custom vector-based UIButton for earlier iOS 8 versions and Apple's PKPaymentButton on iOS 8.3 and later.

Since BUYPaymentButton is vector-based you can use it at any resolution without it looking pixelated. Auto Layout is supported.

The BUYPaymentButton GitHub repo includes a sample project that can be built and run on iOS 8.0 and above to show the differences between the Shopify BUYPaymentButton and Apple's PKPaymentButton.