• 支付宝回调


    支付宝回调监控,支付宝客户端和网页支付宝回调方式不一样

     

    支付宝客户端回调会在AppDelegate里面:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{
        //支付宝支付
        if ([url.host isEqualToString:@"safepay"]) {
            [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {
                //利用代理监听支付宝回调,
                if (_alipayDelegate && [_alipayDelegate respondsToSelector:@selector(getAlipayPayResult:)]) {
                    [_alipayDelegate getAlipayPayResult:resultDic];
                }
                //充值回调
                if (_alipayRechargeDelegate && [_alipayRechargeDelegate respondsToSelector:@selector(getAlipayRechargeResult:)]){
                    [_alipayRechargeDelegate getAlipayRechargeResult:resultDic];
                }
            }];
            return YES;
        }

     网页支付宝回调在调起支付宝支付时:

    1
    2
    3
    4
    [[AlipaySDK defaultService] payOrder:orderString fromScheme:@"应用程序shemes" callback:^(NSDictionary *resultDic) {
                   //没有安装支付宝,网页支付宝回调
                   [self handleAlipayWith:resultDic];
               }];
  • 相关阅读:
    【SQL】语句综合练习
    【Java基础】static关键字
    【SQL】定义约束
    【SQL】数据定义语言(DDL)
    【SQL】事务处理语言(TCL)
    Stream流
    线程池(重点)
    CountDownLatch CyclicBarrier Semaphore
    集合线程安全
    20210128 寻找数组的中心索引
  • 原文地址:https://www.cnblogs.com/LynnAIQ/p/6377303.html
Copyright © 2020-2023  润新知