Shanghai AllPay Technology Co., Ltd.
AllPay provides access plug-ins (hereinafter referred to as "SDK") for customers based on mobile APP payments to help customers achieve fast, secure and centralized access to payment channels.
The merchant gateway sends the order information to the AllPay gateway, and the AllPay gateway processes the transaction serial number, ie tn, back to the merchant gateway, and tn is used as a parameter to adjust the mobile app payment control. Please refer to the specificAllPay Gateway Docking Document
Start the interface of the payment control, the interface is defined as follows:
[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
//Processing synchronous payment results here
}];
Parameter Description
tn: Transaction serial number. Required parameter for app payment. Merchants get from the AllPay backend.
mode: AllPay background environment ID. NO stands for test environment and YES stands for formal environment.
Scheme: Can be any value, recommended to fill in the form "com.xxx.xxx", channels with special configuration will be explained in the channel exclusive configuration.
ViewController: The ViewController when the SDK is called.
onResult: Receive sync result notifications.
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{
[AllPaySDK openURL:url]; return YES;
}
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
[AllPaySDK openURL:url]; return YES;
}
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{
[AllPaySDK openURL:url]; return YES;
}
[AllPaySDK pay:[diction objectForKey:@"tn"] mode:NO scheme:@"com.xxx.xxx" ViewController:self onResult: ^(NSDictionary *resultDic) {
//Processing synchronous payment results here
}];
resultDic, converted to json string, the format is as follows:
{ "state": "cancel", "paymentSchema": "YL", "orderNum": "604337497032", "errorDetail": "user cancel operation" }
Message description
Parameter | Description |
---|---|
state | "success" stands for success, "cancel" means the user cancels the operation, and "fail" stands for the failure. |
paymentSchema | Payment channel, see [Channel List]() |
orderNum | Order number |
errorDetail | Error details |
Security.framework
CoreTelephony.framework
SystemConfiguration.framework
libc++.tbd
libz.tbd
libsqlite3.tbd
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Add the file under the allpaysdk/AliModule folder to the project.
In the Link Binary With Libraries of the Build Phases tab, add the following dependencies:
libc++.tbd
libz.tbd
SystemConfiguration.framework
CoreTelephony.framework
QuartzCore.framework
CoreText.framework
CoreGraphics.framework
CFNetwork.framework
CoreMotion. .framework
Add the file under the allpaysdk/UPModule folder to the project.
Import the following framework and link library
CFNetwork.framework
SystemConfiguration.framework
libz.tbd
Add a URL Types callback protocol to the project info.plist settings to return to the merchant client after the payment is complete. Please note that URL Schemes need to be unique. The value of Scheme is set to be the same as the value of the parameter scheme in the payment interface.
You need to add LSApplicationQueriesSchemes to the plist file corresponding to the project. Array and add uppaysdk, uppaywallet, uppayx1, uppayx2, uppayx3 five items.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>uppaysdk</string>
<string>uppaywallet</string>
<string>uppayx1</string>
<string>uppayx2</string>
<string>uppayx3</string>
</array>
In the environment test, you need to add NSAppTransportSecurity Dictionary to the project's corresponding plist file and set the NSAllowsArbitraryLoads property to YES. Please remove this setting when releasing the official version to Apple.
//The method of interpretation is:
if([PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:@[PKPaymentNetworkChinaUnionPay]] )
{
// app show Apple Pay payment icon
}
If you have problems debugging, please contact us: support@allpayx.com