Skip to main content

Objective-C

Fiuu iOS payment module for Xcode projects using Objective-C.

Repository: Mobile-XDK-Fiuu_Objective-C

Wiki: CocoaPods Installation Guide

Requirements

RequirementVersion
Xcode13+
Minimum iOS11+

Installation

Follow the CocoaPods Installation Guide or see the CocoaPods Framework guide in this documentation.

Key steps:

  1. Add the CocoaPods dependency to your Podfile.
  2. Run pod install.
  3. Create a bridging header if mixing with Swift.
  4. Import <MOLPayXDK/MOLPayLib.h>.

Info.plist Requirements

Add to your Info.plist:

  • App Transport Security Settings → Allow Arbitrary Loads → YES
  • NSPhotoLibraryUsageDescriptionPayment images
  • NSPhotoLibraryAddUsageDescriptionPayment images

Basic Integration

NSDictionary *paymentDetails = @{
@"mp_username": @"username",
@"mp_password": @"password",
@"mp_merchant_ID": @"merchantid",
@"mp_app_name": @"appname",
@"mp_verification_key": @"vkey123",
@"mp_amount": @"1.10",
@"mp_order_ID": @"orderid123",
@"mp_currency": @"MYR",
@"mp_country": @"MY",
@"mp_channel": @"multi",
@"mp_bill_description": @"billdesc",
@"mp_bill_name": @"billname",
@"mp_bill_email": @"email@domain.com",
@"mp_bill_mobile": @"+1234567",
};

MOLPayLib *mp = [[MOLPayLib alloc] initWithDelegate:self andPaymentDetails:paymentDetails];

Delegate Callback

- (void)transactionResult:(NSDictionary *)result {
NSLog(@"Payment result: %@", result);
[mp closemolpay];
}

Apple Pay

NSDictionary *paymentDetails = @{
// ... mandatory parameters ...
@"mp_express_mode": @YES,
@"mp_ap_merchant_ID": @"merchant.com.rms.mobile.applepay",
@"mp_allowed_channels": @[@"credit", @"ApplePay"],
};

See Apple Pay Configuration for certificate setup.

Payment Parameters

See Payment Parameters for the full list of mp_* parameters.