Home >Backend Development >PHP Tutorial >Regarding the Alipay payment interface, what should my PHP provide to iOS? How to write it?

Regarding the Alipay payment interface, what should my PHP provide to iOS? How to write it?

PHP中文网
PHP中文网Original
2017-03-27 15:24:111305browse

What php does is it needs to return a signature to ios or android and they pay by verifying the signature. //Alipay signature

 $list = array(
            'partner'                 =>$alipay_config['partner'],
            '_input_charset'          =>$alipay_config['input_charset'],
            'notify_url'              =>'http://notify.msp.hk/notify.htm',
            "return_url"              => $alipay_config['return_url'],
            "it_b_pay"                => "30m",
            'service'                 =>$alipay_config['service'],
            'seller_id'               =>$alipay_config['partner'],
            "anti_phishing_key"       =>$alipay_config['anti_phishing_key'],
            "exter_invoke_ip"         =>$alipay_config['exter_invoke_ip'],
        //订单号
            'out_trade_no'            =>$order_id,
        //商品名称
            'subject'                 =>$skills,
        //支付类型
            'payment_type'            =>'1',
        //金额
            'total_fee'               =>$recharge_moeny,
        //描述
            'body'                    =>$order_id,
    );
    //建立请求
    $alipaySubmit = new \AlipaySubmit($alipay_config);
    $html_text = $alipaySubmit->buildRequestParaToString($list);
    // 返回签名的数据
    return $html_text;
}

}

alipay/alipay.config.php The configuration file in the Alipay core file needs to configure your own Alipay secret key, etc.

Related articles:

Alipay payment interface single transaction query interface

Regarding the Alipay payment interface, what should my PHP provide to iOS? How to write it?

Regarding the Alipay payment interface, how to design automatic query of order status.

E-commerce websites use Alipay transfer payment function instead of Alipay payment interface

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn