Alipay+ DocsAlipay+ Docs

Quickstart

This topic introduces how to quickly set up Alipay+ MPP iOS SDK.

Before you begin

Before you get started, ensure that the following requirements are met:

  • Install the following tools:
    • Xcode 12.* or later
  • Ensure that the minimum deployment target is set to iOS 9 or later.

Get started

Step 1. Add SDK to your project

  1. Contact your Alipay+ Solution Architect (SA) to obtain the Alipay+ SDK binaries as a package. You can also obtain the source code if you need to review or customize the SDK source code.

The following table lists the SDK packages that are required for different Alipay+ payment products:

Product

Merchant-presented Mode Payment

Auto Debit

framework

foundational

  • MPPAlipayPlusClient.framework
  • IAPTinyLogger.framework

product-specific

  • MPPAlipayPlusClientMPM.framework
  • IAPMinContainer.framework
  • MPPAlipayPlusClientAutoDebit.framework

product-specific bundle

  • IAPMinContainer.framework/IAPMinContainer.bundle
  1. Ensure that the SDK is linked to your project.
  • If you use CocoaPods to publish your SDK, add the following lines to your podspec file:
copy
s.subspec 'Foundation' do |ss|
    ss.vendored_frameworks=  ["YOUR_PATH/MPPAlipayPlusClient.framework", "YOUR_PATH/IAPTinyLogger"]
end

s.subspec 'MPM' do |ss|
    ss.vendored_frameworks=  ["YOUR_PATH/MPPAlipayPlusClientMPM.framework", "YOUR_PATH/IAPMinContainer.framework"]
    ss.resources = ["YOUR_PATH/IAPMinContainer.framework/IAPMinContainer.bundle"]
    ss.dependency "YOUR_POD/Foundation"
end

s.subspec 'AutoDebit' do |ss|
    ss.vendored_frameworks=  ["YOUR_PATH/MPPAlipayPlusClientAutoDebit.framework"]
    ss.dependency "YOUR_POD/Foundation"
end
  • If you do not use CocoaPods, you can manually add the SDK as follows:
    1. Add the required framework and bundle files to your project based on the product you use. Make sure to select Copy items if needed.

(1) Merchant-presented Mode Payment

截屏2022-08-19 11.27.07.png

截屏2022-08-19 11.48.15.png

(2) Auto Debit

截屏2022-08-19 11.27.59.png

    1. Make sure to add -ObjC to Build Settings > Linking > Other Linker Flags to use class category.image

Note: If your project is created using swift and the "Undefined symbol: ___llvm_profile_runtime" error is triggered during build, try add -fprofile-instr-generate to Build Settings > Linking > Other Linker Flags to resolve the error.

Step 2. Set up the SDK before using other APIs

  1. Import the SDK header file to your project.
copy
import <MPPAlipayPlusClient/MPPAlipayPlusClientAPI.h>

2. Set up the SDK with required configurations.

copy
MPPConfiguration *configuration = IAPConfiguration.new;
configuration.clientId = @"XXX";
configuration.envType = @"PROD";
configuration.siteName = @"YYY";
[[MPPAlipayPlusClient shared] setConfiguration:configuration];

Next steps

After you have integrated the SDK, you can move on to use the SDK in different payment scenarios.

For more information about how to use the SDK in Merchant-presented Mode Payment, see Merchant-presented Mode Payment integration.

For more information about how to use the SDK in Auto Debit, see Auto Debit integration.