PHP code example of pkzhilong / laravel-alipay
1. Go to this page and download the library: Download pkzhilong/laravel-alipay 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/ */
pkzhilong / laravel-alipay example snippets
composer
\Laravel\AliPay\AliPayServeProvider::class,
1. 设置对应参数
$return_url = isset($this->ownType) ? 'team_alipay_success_redirect' : 'alipay_success_redirect'; //回调地址
$notify_url = isset($this->ownType) ? 'team_alipay_notify' : 'alipay_notify'; //异步通知地址
$this->aliPay->bootstrapAliPay()->buildOrder([
'total_amount' => $taskStage->cost, //交易额
'subject' => '大宅世家资金托管', //交易描述
'body' => '大宅世家资金托管-1', //交易标题
])->pagePay($reutrn_url, $notify_url);