Apple Pay Configuration
To integrate Apple Pay within the Fiuu Mobile XDK (Version 1.2), you must configure your Apple Merchant ID and payment processing certificates.
This guide is based on the Fiuu Mobile XDK Swift Apple Pay setup.
Prerequisites
- Apple Developer Account
- Fiuu merchant account with Apple Pay enabled
- iOS app with Apple Pay capability
1. Register an Apple Merchant ID
- Sign in to the Apple Developer Portal.
- Navigate to Certificates, Identifiers & Profiles → Identifiers.
- Register a new Merchant ID identifier.
- Note the Merchant ID value (e.g.
merchant.com.yourcompany.applepay).
The Apple Merchant ID must be different from your app's bundle identifier.
2. Enable Apple Pay Capability in Xcode
- Open your Xcode project.
- Select your target → Signing & Capabilities.
- Click + Capability and add Apple Pay.
- Select your registered Merchant ID.
3. Create a Payment Processing Certificate
A Payment Processing certificate is a cryptographic key used to securely encrypt and send payment data to the Fiuu server.
- Select your Merchant ID on the Apple Developer portal.
- Under Apple Pay Payment Processing Certificate, click Create Certificate.
- Upload the Certificate Signing Request (CSR) provided by Fiuu/RazerMS.
- Download the resulting Payment Processing certificate.
- Provide the downloaded certificate to Fiuu/RazerMS.
Contact support@fiuu.com to obtain the CSR file.
4. Configure XDK Parameters
When initializing the XDK, pass the required Apple Pay parameters:
@"mp_ap_merchant_ID": @"merchant.com.rms.mobile.applepay",
@"mp_allowed_channels": [NSArray arrayWithObjects:@"credit", @"ApplePay", nil],
Required Parameters
| Parameter | Value | Description |
|---|---|---|
mp_ap_merchant_ID | Your Apple Merchant ID | e.g. merchant.com.rms.mobile.applepay |
mp_allowed_channels | ["credit", "ApplePay"] | Must include both values |
Optional Parameters
| Parameter | Value | Description |
|---|---|---|
mp_express_mode | true | Bypass the Fiuu XDK payment selection page |
mp_channel | "ApplePay" | Direct Apple Pay channel selection |
Full Example (Objective-C)
NSDictionary *paymentDetails = @{
@"mp_username": @"username",
@"mp_password": @"password",
@"mp_merchant_ID": @"merchantid",
@"mp_app_name": @"appname",
@"mp_verification_key": @"vkey123",
@"mp_amount": @"1.01",
@"mp_order_ID": @"orderid123",
@"mp_currency": @"MYR",
@"mp_country": @"MY",
@"mp_bill_description": @"billdesc",
@"mp_bill_name": @"billname",
@"mp_bill_email": @"email@domain.com",
@"mp_bill_mobile": @"+1234567",
@"mp_express_mode": @YES,
@"mp_ap_merchant_ID": @"merchant.com.rms.mobile.applepay",
@"mp_allowed_channels": @[@"credit", @"ApplePay"],
};
Swift Example
let paymentDetails: [String: Any] = [
"mp_channel": "ApplePay",
"mp_express_mode": true,
"mp_allowed_channels": ["ApplePay"],
"mp_ap_merchant_ID": "merchant.com.rms.mobile.applepay",
// ... other mandatory parameters
]
5. Objective-C Bridging Header
If your project uses Objective-C, create a bridging header and add:
#import <MOLPayXDK/MOLPayLib.h>
See the Objective-C integration guide or CocoaPods guide for installation steps.
6. Payment Flow
Standard Flow
- User selects Apple Pay from the XDK channel list.
- Apple Pay sheet appears for biometric authentication.
- Payment is processed and result is returned to your app.
Express Mode
With mp_express_mode: true and mp_channel: "ApplePay", the XDK skips the channel selection page and goes directly to the Apple Pay sheet.
7. Testing
Use Apple Pay Sandbox testing cards from the Apple Developer documentation.
Test scenarios:
- Success Payment — valid card, successful authorization
- Failure Payment — declined card or insufficient funds
- Express Mode — direct Apple Pay launch without channel selection
Troubleshooting
| Issue | Solution |
|---|---|
| Apple Pay option not shown | Verify mp_allowed_channels includes "ApplePay" and "credit" |
| Merchant ID error | Ensure mp_ap_merchant_ID matches your registered Apple Merchant ID |
| Certificate error | Confirm the Payment Processing certificate was uploaded to Fiuu |
| Capability missing | Add Apple Pay capability in Xcode with the correct Merchant ID |
For unresolved issues, contact support@fiuu.com.