zoukankan      html  css  js  c++  java
  • PHP——2019 支付宝App支付

    SDK下载:https://docs.open.alipay.com/54/106370/;
    联系客服:https://cschannel.alipay.com/newPortal.htm?scene=mysjbzzx  (发送转技术客服 在线客服 应该可以找到技术支持);
    参考地址:https://www.cnblogs.com/rohanCh/p/8286822.html;
    
    1:官方配置
    2:代码注意: json格式 千万不要有空格,换行;除了数字以外 其他都要加引号  !!!!!! 其他都很Easy了 不多说了 
    3:回调可以取看看官网的参数 (https://docs.open.alipay.com/204/105301/)
    
           $aop = new AopClient;
                $aop->gatewayUrl = "https://openapi.alipay.com/gateway.do";
                $aop->appId = $config['partner_id'];
                $aop->rsaPrivateKey = $config['private_key'];//'请填写开发者私钥去头去尾去回车,一行字符串';
                $aop->format = "JSON";
                $aop->charset = "UTF-8";
                $aop->signType = "RSA2";
                $aop->alipayrsaPublicKey = $config['public_key'];//'请填写支付宝公钥,一行字符串';
                //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
                $request = new AlipayTradeAppPayRequest();
                //SDK已经封装掉了公共参数,这里只需要传入业务参数
                $total_price = '支付金额';
    //            注意 json格式 除了数字意外都要加引号 参数不要有空格
                $bizcontent = "{"body":"$shop_name","
                    . ""subject":"$shop_name","
                    . ""out_trade_no":$order->order_sn,"
                    . ""timeout_express":"30m","
                    . ""total_amount":$total_price,"
                    . ""product_code":"QUICK_MSECURITY_PAY""
                    . "}";
                $notify_url = '回调地址';
                $request->setNotifyUrl($notify_url);
                $request->setBizContent($bizcontent);
                //这里和普通的接口调用不同,使用的是sdkExecute
                $response = $aop->sdkExecute($request);
                return self::formatBody(['order' => $order, 'alipay' => ['order_string' => $response]]);

     

     

     

     

    注重细节——关注底层——注重细节——关注底层——注重细节——关注底层——注重细节——关注底层——注重细节——关注底层
  • 相关阅读:
    POJ3683 Priest John's Busiest Day
    POJ3678 Katu Puzzle
    洛谷4782 【模板】2-SAT 问题
    BZOJ2330或洛谷3275 [SCOI2011]糖果
    POJ1236或洛谷2746或洛谷2812 Network of Schools
    POJ2230 Watchcow
    POJ2942 Knights of the Round Table
    POJ3694 Network
    BZOJ1123或洛谷3469 [POI2008]BLO-Blockade
    animition动画的加入
  • 原文地址:https://www.cnblogs.com/PJG20/p/13197313.html
Copyright © 2011-2022 走看看