Apple Pay is a secure digital wallet that tokenises card information, allowing seamless online transactions without sharing card details with merchants. It facilitates communication between the user, the issuing bank, and the payment gateway to authorise and complete transactions efficiently.
Initiate a Money-in with Card for Apple pay
Prerequisites
Before you begin, make sure that you have:
- Set up Apple Pay with your own or lemonway’s Apple Pay certificate. You can use lemonway's Apple Pay certificate if you have a web integration, which makes it quicker to set up Apple Pay. If you have a mobile integration, use your own Apple Developer account and certificate which requires extra configuration steps.
- Option 1: Use Lemonway's Apple Account
- Web only
- Quick and simplified Process
- No Apple account subscripion
- Lemonway handles registration via the Apple Pay Web Marketplace API
- Option 2: Use Your Apple Account
- Web and App support
- Full control over the Apple Develop account
- Unique Certificate management by you.
- Option 1: Use Lemonway's Apple Account
- Read the Apple Pay documentation to learn about how you can offer Apple Pay on the web, or in your mobile app.
After you have finished setting up Apple Pay, you can show Apple Pay as an available payment method in countries/regions where Apple Pay is supported. You can download logos for Apple Pay which you can use on your checkout.
When the shopper selects Apple Pay, they are presented with a prompt to verify the payment using Touch ID or Face ID. If the shopper is using a Mac without Touch ID, they will be prompted to verify the payment using an iPhone or Apple Watch registered to the same iCloud account.
Reach out to your Account Manager or contact our Support Team to get started today!
Lemonway x Apple Payment Flow
sequenceDiagram autonumber participant PartnerSite as App/Website (Front) participant Partner as Platform (Server) participant Lemonway as Lemonway API participant Apple PartnerSite-->PartnerSite: Display ApplePay button Partner->>+Lemonway: MoneyInWebInit Lemonway-->>-Partner: WebkitToken PartnerSite-->PartnerSite: Payer chooses Apple Pay alt Only if using Lemonway Apple Account (OPTION 1) Partner->>Lemonway: Session Creation with POST /xpay/apple/session Lemonway-->>Partner: ApplePaymentSessionId end PartnerSite->>Apple: Send Payment Request Apple -->>PartnerSite: Return Apple PaymentData PartnerSite -->>Partner: Send Apple PaymentData Partner->>Lemonway: Send Apple Payment Request with POST /xpay/apple Lemonway->>Partner: TransactionResult (Success or Fail) Lemonway->>PartnerSite: WebRedirection
1. Initiate Money-In with card to Lemonway - Your Platform initiates a Money-in with Card request.
You will find all the information needed to integrate the call money-in card to initiate a payment.
POST : /v2/moneyins/card/webinit
2. Token Generation from Apple Pay
Your platform must request the payment to Apple Pay. If you use the Lemonway’s Apple Account (option 1), you need to create a payment session through the Lemonway API dedicated endpoint.
POST /xpay/apple/session
{
// [WebkitToken retrieved from CardMoneyInWebInit request]
"webkitToken": "XXXXXXXXXXXXXXXXXXXXXXXX",
// [A string of 64 or fewer UTF-8 characters containing the canonical name for your store, suitable for display. A good display name remains a consistent value for the store and doesn't contain dynamic values such as incrementing order numbers. Don’t localize the name. Use only characters from the supported character sets in the fonts listed in the table below.]
"displayName": "A APP",
// [For the domainName parameter, provide your fully qualified domain name associated with your Apple Pay Merchant Identity Certificate. It should be the domain name of the checkout url where the apple pay button is displayed.]
"domainName": "[A.com](http://a.com/)"
}Response: Apple Pay returns encrypted data specific to the payment
3. Request the Apple Pay Payment to Lemonway
Your Platform sends the Apple Pay payment request through the dedicated endpoint, including the PaymentData as received from Apple Pay. The amount of your Money-In request must match your Apple Pay request. Note, it is possible to send encrypted or decrypted data.
POST /direct-payments/xpay/apple/
{
// [WebkitToken retrieved from CardMoneyInWebInit request]
"webkitToken": "string",
// Full Merchant Checkout Url page (where the Apple Pay button was displayed)
"merchantCheckoutUrl": "string",
// Holder Name
"payerName": "string",
// Raw payment response object from Apple
"rawPaymentResponse": "string",
// OPTIONAL: Decrypted Payment Data object
"partnerDecryptedPaymentData": "string"
}Response: Apple Pay returns encrypted data specific to the payment
4. Lemonway processes payment request.
5. Lemonway returns the transaction result and the Payer is redirected.
Test the integration
To test Apple Pay payments, you need:
- A device compatible with Apple Pay
- A sandbox Apple Pay wallet, which you have added a test card to – For more information, see Apple Developer – Sandbox testing.
Use test cards to simulate different payment flows and ensure your integration is set up correctly and behaving as expected.
Apple Resources
Apple Pay API Documentation: Apple Developer
