PHP code example of yanlongli / papayment
1. Go to this page and download the library: Download yanlongli/papayment library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yanlongli / papayment example snippets
include_once __DIR__ . '/vendor/autoload.php';
$tradeNo = '20220224164301'; // 订单号
$fee = 0.01; // 订单额 元
$title = '我是订单标题';
$detail = '我是订单详情';
$payChannel = \papayment\PAPayment::CHANNEL_WXPAY;
$method = \papayment\Method::MINIAPP;
// 微信、支付宝、快手必传 code
$attach = [
'code' => '',
];
/**
* @var $channel \papayment\contract\Channel
*/
$channel = \papayment\PAPayment::init($channel,