CocoaPods trunk is moving to be read-only. Read more on the blog, there are 7 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Aug 2017 |
Maintained by huangrui, ‘mobilegroup’.
iOS SDK要求iOS6.0及以上
podfile文件pod 'ipaynowOneClickPay','~> 1.0.9'
pod install
.xcodespace打开工程一键支付页面需要隐藏status bar,需要在工程info.plist中设置View Controller-based status bar apperance为No
IPNOneClickPreSignMessageUtil生成待签名订单NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyMMddHHmmss"];
IPNPreSignMessageUtil *preSign=[[IPNPreSignMessageUtil alloc]init];
preSign.appId=kAppId;
preSign.mhtOrderNo=[dateFormatter stringFromDate:[NSDate date]]; preSign.mhtName=@"我是商户";
preSign.mhtOrderName=_txtOrderName.text;
preSign.mhtOrderType=@"01";
preSign.mhtCurrencyType=@"156";
preSign.mhtOrderAmt=_txtOrdrAmt.text;
preSign.mhtOrderDetail=_txtOrderDetail.text; preSign.mhtOrderStartTime=[dateFormatter stringFromDate:[NSDate
date]];
preSign.notifyUrl=@"http://192.168.1.154:8080/api/mchnotify";
preSign.mhtReserved=_txtMhtReserved.text;
preSign.userId=_txtUserId.text;
NSString *originStr=[preSign generatePresignMessage];此处需要在服务端对originStr进行签名。
[IPNOneClickPayPlugin payByData:payData viewController:self delegate:self];通知协议为IPNOneClickPayDelegate商户需要在调起支付的ViewController中遵守协议
- (void)oneClickPayPluginResult:(IPNOneClickPayResult)result errorInfo:(NSString *)errorInfo;result支付结果枚举值为:
typedef NS_ENUM(NSInteger, IPNOneClickPayResult) {
IPNOneClickPayResultSuccess , //成功
IPNOneClickPayResultFail , //失败
IPNOneClickPayResultCancel , //取消
IPNOneClickPayResultUnknown //未知
};+ (void)setIPNStemeColor:(UIColor *)color;默认为红色
+ (void)setIsShowIPNPayResultPage:(Bool)beShowIPNPayResultPage; 详见Demo及文档