This topic provides step-by-step instructions for integrating Secure Remote Commerce (SRC) with the In-App Payments SDK on an iOS device.
To enable SRC with the In-App Payments SDK on iOS, the following must be true:
- You're a US-based Square seller. SRC for the In-App Payments SDK is only available for Square sellers based in the United States.
- You've followed the instructions in Build on iOS. This topic doesn't cover the general setup of the In-App Payments SDK.
- You've read and will adhere to Mastercard brand guidelines.
- SRC isn't supported in the Square Sandbox.
Create the image for your Click to Pay button by following the guidance on the Mastercard Branding Requirements page. Choose Use in digital payments and then choose Signaling Mastercard Click to Pay enablement. The image you create should look like the following:
The examples on this page assume that you've created a PNG file (
src_logo_button) and added it as an image in Assets.xcassetes.
Taking an SRC payment from your payment view controller involves the following steps:
Create an instance of
Create a payment request, specifying the payment amount and a completion handler. Replace
YourPaymentViewControllerwith the view controller that the payment sheet shows on top of.
Get the payment token from the completion handler by reading the
// #3 herewith the following code: