Using Payment Links, Payment Page, payment extensions, Payouts, POS, or the Reconciliation API? View the classic product documentation

Home/Mobile SDKs/iOS Native

iOS Native SDK

Integrate the SDK into your iOS app using Swift

Minimum: iOS 15.1+

Prerequisites

Before you start integrating, make sure you have a suitable Xcode setup, Peach Orchestration credentials, a backend server that can create Payment Intents, and the Xcode capabilities the payment methods you plan to accept require.

Development environment

  • Xcode 14.0 or later.
  • An iOS 15.1+ deployment target.
  • Swift 5.0 or later.

Peach Payments account

Don't have an account yet? Sign up first.

Already have an account? Collect your credentials from the Dashboard:

Log in to the Dashboard

You can log in to the Dashboard using one of the following methods:

  • Using a magic link; this is the default login method. After entering your email address, Dashboard sends you a magic link that you click to log in.
  • Using a password.
i

Info

You must use two-factor authentication to log in to the Peach Payments Dashboard. If you have not enrolled, or if an owner or administrator has reset your two-factor authentication enrolment, you must enrol before you can access the Dashboard. See Enrol in two-factor authentication.

Log in using a magic link

To access the Dashboard:

  1. Visit https://dashboard.peachpayments.com.
  2. Enter your company email address and click Submit.
  3. In your email inbox, click the Login to Dashboard link that you received from Peach Payments (if you've got multiple login emails, click the latest link). If the email isn't in your inbox, check your spam folder. The magic link expires after five minutes, but you can redo this procedure to receive a new link.
  4. When the Dashboard prompts you for two-factor authentication:
    1. On your phone, open your authenticator app and note the 6-digit authentication code for Peach Payments.
      Example Google Authenticator authentication code.
      Example Google Authenticator authentication code.
    2. In your browser, in the Verify Your Identity window, enter the authentication code.
    3. Select Remember this device for 30 days if you don't want the Dashboard to ask for an authentication code for the next 30 days.
    4. Click Continue.
!

Warning

If clicking the Login to Dashboard link takes you back to the Dashboard login page, enter your company email address and click Submit again. In your email inbox, copy the login URL, paste it into your browser, and press Enter. If this doesn't work, and if you're using Mimecast for email security, ask your Mimecast administrator to add the Peach Payments domain to your allowlist. If neither of these solutions work, try to log in using your password, and if that fails, contact support for assistance.

Log in using a password

When you first gain access to the Dashboard, the email contains a link to either log in using a magic link, or to complete your account by setting a password. Use the password that you set there for all future logins, unless you reset it. If you can't find the initial email, you can set your first password using the reset your password functionality.

To access the Dashboard:

  1. Visit https://dashboard.peachpayments.com.
  2. Click Username & Password beneath the Submit button.
  3. Enter your company email address and password, and click Log in.
  4. When the Dashboard prompts you for two-factor authentication:
    1. On your phone, open your authenticator app and note the 6-digit authentication code for Peach Payments.
    2. In your browser, in the Verify Your Identity window, enter the authentication code.
    3. Select Remember this device for 30 days if you don't want the Dashboard to ask for an authentication code for the next 30 days.
    4. Click Continue.
  1. In the left sidebar, click Peach Orchestration.
  2. Under Peach Orchestration credentials, copy your profile ID (pro_xxx) and publishable key (pk_snd_xxx for sandbox, pk_prd_xxx for live). The publishable key is safe to use in client-side code.
  3. Under API keys, click New API key + to create a merchant API key (snd_xxx for sandbox, prd_xxx for live).
✕

Never ship your merchant API key

The merchant API key belongs on your server only. Never expose it in client-side code — a web page, a mobile app bundle, or anything else a shopper can read.

Can't find these credentials, or don't see the Peach Orchestration section? Contact support to request access.

Backend server

You need a server to create Payment Intents.

✕

Never expose your secret key

Your secret key belongs on your server only. Never put it in the iOS app — anything shipped in an app bundle can be read.

Required capabilities in Xcode

  • If you are using Apple Pay, add the Apple Pay capability.
  • If you are using the in-app browser, no additional capabilities are needed.

Wallet prerequisites

Apple Pay

For app integrations you provide your own Apple Pay certificates, which requires Apple Developer Program membership. Peach Payments provides the certificate signing requests (CSRs) — contact support to request them.

  1. Register a merchant ID in the Apple Developer portal under Certificates, Identifiers & Profiles > Identifiers > Merchant IDs, using the format merchant.com.yourcompany. Go to Merchant IDs.
  2. Create a payment processing certificate against that merchant ID.
  3. In Xcode, go to Signing & Capabilities > + Capability > Apple Pay and tick your registered merchant IDs.
  4. Send Peach Payments your Apple Pay merchant ID and certificates so they can configure your account.

Apple's own references: Setting up your server and the Apple Pay implementation guide.