Objective-C 集成农行支付接口

时间:2021-06-03 04:54:57

Objective-C 集成农行支付接口

 

Objective-C 集成农行支付接口 

Objective-C 集成农行支付接口

Objective-C 集成农行支付接口

Objective-C 集成农行支付接口

Objective-C 集成农行支付接口

  部分参考代码:

[NANetworkHandler POSTWithURL:APP_ABCPay par:dict isStored:NO success:^(id responseObject, BOOL getUrl) {
            if(responseObject)
            {
                NSDictionary *resultJson = [responseObject yy_modelToJSONObject];
                NSString *status = [[NSString alloc]initWithFormat:@"%@",resultJson[@"status"]];
                
                if ([status isEqualToString:@"1"])
                {
                    [[NSUserDefaults standardUserDefaults]setObject:resultJson[@"TOKEN"] forKey:@"ABC_PAY_TOKEN"];
                    NSString *requestUrl = [NSString stringWithFormat:@"CallbackID=APP标识&TokenID=%@&Method=pay",resultJson[@"TOKEN"]];
                    if ([[ABCAppCaller sharedAppCaller]isABCePayAvailable:@"bankabc://"]) {
                        [[ABCAppCaller sharedAppCaller]callBankABC:@"bankabc" param:requestUrl];
                    } else
                    {
                        [NATools showRequestAlertWithTitle:@"" message:@"尚未安装农行掌银,或已安装农行掌银版本不支持" timeInterval:1.0];
                    }
                }else if ([status isEqualToString:@"0"]){
                    NSString *msg = [[NSString alloc]initWithFormat:@"%@",resultJson[@"msg"]];
                    [NATools showRequestAlertWithTitle:@"" message:msg timeInterval:1.0];
                }
            }