支付-支付宝支付

1.支付宝支付,获取上传的参数加密参数等在后台处理,手机端拿到拼接好的sign,直接调取支付宝SDK:

JYUserInfomation *info=[JYUserInfomation allObjects].firstObject;
if (info==nil|| !info.isLoged) {
    return;
}
NSDictionary *dic=@{@"person_id":info.person_id,
                    @"orderId":self.listModel.id,
                    @"token":info.appkey,
                    @"version":AppVersion,
                    };
[LOHttpHelper lo_requestWithType:LO_HttpRequestTypeGet withPath:@"app/pay/getOrderInfo.htm?" params:dic successOrFail:^(NSDictionary *responseDic, NSError *error) {
    if (!error) {
        if ([responseDic[@"status"] integerValue]==1) {
            NSLog(@"%@",responseDic);
            NSDictionary *data=responseDic[@"data"];
            if ([data isKindOfClass:[NSNull class]]) {
                return ;
            }
            NSString *orderInfo=data[@"orderInfo"];
            // NOTE: 调用支付结果开始支付
                [[AlipaySDK defaultService] payOrder:orderInfo fromScheme:@"JYAliPaySDK" callback:^(NSDictionary *resultDic) {
                NSLog(@"%@",resultDic);
                if ([[resultDic objectForKey:@"resultStatus"]intValue] == 9000) {
                    
                }
                else if ([[resultDic objectForKey:@"resultStatus"]intValue] == 8000)
                {
                    //处理中
                    }
                else
                {
                    }
            }];
            
        }else{
            
            [KVNProgress showErrorWithStatus:responseDic[@"msg"]];
        }
        
    }else{
        [KVNProgress showErrorWithStatus:@"请重新再试!"];
    }
}];
复制代码
  • 调取后台接口,获取sign

  • 调取支付宝SDK

转载于:https://juejin.im/post/5b8f7e476fb9a05d2e1b7566

你可能感兴趣的:(支付-支付宝支付)