Ping++,它集成所有支付功能于一身:
支付流程:
ping++,支持支付宝支付,微信支付,银联支付,百度钱包支付,applepay
(1)根据呢需要介入的支付方式去对应的支付平台申请账号和参数
(2)(恨不得直接上代码了),传说中的7行代码搞定支付
Ping++有着前所未有的简单,号称7行代码搞定支付
NSDictionary* dict = @{
@"amount"
NSData* data = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrint
NSString *bodyData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
[postRequest setHTTPBody:[NSData dataWithBytes:[bodyData UTF8String] length:strlen([bodyData UTF8String])]];
[postRequest setHTTPMethod:@"POST"];
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[NSURLConnection sendAsynchronousRequest:postRequest queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response;
NSString* charge = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
[Pingpp createPayment:charge viewController:viewController appURLScheme:kUrlScheme withCompletion:^(NSString *result, PingppError *error) {
} else {
}
}];
}];
//AppDelegate添加这行代码适用于监听支付结果的
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
[Pingpp handleOpenURL:url withCompletion:^(NSString *result, PingppError *error) {
} else {
}
}];
}
综上所述,你可以跟你的个人需求来选择接入支付方式