Introduction 🌟
Prerequisites 🎯
Step 1: Register Merchant ID with Apple 🍏
Step 2: Create Apple Pay Certificate 🔑
Step 3: Configure Xcode Project 🚀
Step 4: Implement Front-End Code 🖥️
4.1 Create a Payment Request
request.merchantIdentifier = @’merchant.com.yourcompany’
request.supportedNetworks = @[PKPaymentNetworkVisa, PKPaymentNetworkMasterCard]
request.merchantCapabilities = PKMerchantCapability3DS
request.countryCode = @’US’
request.currencyCode = @’USD’
request.paymentSummaryItems = @[
[PKPaymentSummaryItem summaryItemWithLabel:@’Item Name’ amount:[NSDecimalNumber decimalNumberWithString:@’9.99’]],
[PKPaymentSummaryItem summaryItemWithLabel:@’Total’ amount:[NSDecimalNumber decimalNumberWithString:@’9.99’]]
]
4.2 Present the Apple Pay Sheet
applePayVC.delegate = self
[self presentViewController:applePayVC animated:YES completion:nil]
4.3 Handle Authorization Delegate
Step 5: Integrate with ZEN API 🔄
Headers: Authorization: Bearer Your Zen API Key
Body: {
nbspnbspamount: 999,
nbspnbspcurrency: USD,
nbspnbspsource: {
nbspnbspnbspnbsptype: apple_pay,
nbspnbspnbspnbsptoken: ltYour Apple Pay token datagt
nbspnbsp}
}
Step 6: Test Your Integration đź§Ş
Configuration at a Glance 📊
| Environment | Apple Pay | ZEN Mode |
|---|---|---|
| Sandbox | ✔️ Test Cards | Test (API Key starts with tz_…) |
| Production | ✔️ Live Cards | Live (API Key starts with z_…) |
Helpful Resources 📚
https://developer.apple.com/apple-pay/
https://docs.zen.com/reference
https://developer.apple.com/forums/tags/apple-pay