PHP code example of putyy / yun-pay
1. Go to this page and download the library: Download putyy/yun-pay 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/ */
putyy / yun-pay example snippets
/**
* 下单
* 不同平台不同 data
* 自行查阅 WGCYunPay\Data\Pay 相关data类
*/
$AliPayData = new \WGCYunPay\Data\Pay\AliPayData();
$AliPayData->order_id = '2019002156137016397187466';
$AliPayData->real_name = 'LW放下';
$AliPayData->id_card = '500781598308210373';
$AliPayData->pay = '1.00';
$AliPayData->notes = '这只是一个测试';
$AliPayData->pay_remark = '这只是一个打款备注';
$AliPayData->card_no = '18225298987';
$GoPay = new \WGCYunPay\Service\PayService($config, $AliPayData);
$res = $GoPay->query();
var_dump($res);
//var_dump($config);
// 查询订单
$order = new \WGCYunPay\Service\OrderService($config);
$res = $order
->setOrderId('2019002156137016ss3971231341211')
->setChannel('支付宝')
->query();
var_dump($res);