支付宝PC端支付

本文详细介绍了如何在PHP环境中实现支付宝PC端支付的流程,包括调用接口所需的参数设置和交互过程,帮助开发者集成这一支付功能。
摘要由CSDN通过智能技术生成
<?php
/**
 *
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class Pc_alipay_service
{
    protected $appId;
    protected $returnUrl;
    protected $notifyUrl;
    protected $charset;
    //私钥值
    protected $rsaPrivateKey;
    protected $totalFee;
    protected $outTradeNo;
    protected $orderName;
    protected $orderBody;
    protected $rsaPublicKey;
    protected $alipaySdkVersion = "*****";
    protected $gatewayUrl = "https://openapi.alipay.com/gateway.do";
    protected $signType = 'RSA2';
    // 表单提交字符集编码
    public $postCharset = "UTF-8";
    public function __construct()
    {
        $this->rsaPublicKey = config_item('alipay_public_key');
        $this->charset = 'UTF-8';
    }

    public function setAppid($appid)
    {
        $this->appId = $appid;
    }

    public function setReturnUrl($returnUrl)
    {
        $this->returnUrl = $returnUrl;
    }

    public function setNotifyUrl($notifyUrl)
    {
        $this->notifyUrl = $notifyUrl;
    }

    public function setGatewayUrl($gatewayUrl)
    {
        $this->gatewayUrl = $gatewayUrl;
    }

    public function setRsaPrivateKey($saPrivateKey)
    {
        $this->rsaPrivateKey = $saPrivateKey;
    }
    public function setRsaPublicKey($saPublicKey)
    {
        $this->rsaPublicKey = $saPublicKey;
    }

    public function setTotalFee($payAmount)
    {
        $this->totalFee = $payAmount;
    }

    public function setOutTradeNo($outTradeNo)
    {
        $this->outTradeNo = $outTradeNo;
    }

    public function setOrderName($orderName)
    {
        $this->orderName = $orderName;
    }
    public function setOrderBody($orderBody)
    {
        $this->
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值