Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify payment.trade.page.pay default method to support GET method to… #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions php/src/Payment/Page/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ public function __construct($kernel){
* @param string $outTradeNo
* @param string $totalAmount
* @param string $returnUrl
* @param string $method
* @return AlipayTradePagePayResponse
*/
public function pay($subject, $outTradeNo, $totalAmount, $returnUrl){
public function pay($subject, $outTradeNo, $totalAmount, $returnUrl, $method = 'POST'){
$systemParams = [
"method" => "alipay.trade.page.pay",
"app_id" => $this->_kernel->getConfig("appId"),
Expand All @@ -45,7 +46,7 @@ public function pay($subject, $outTradeNo, $totalAmount, $returnUrl){
];
$sign = $this->_kernel->sign($systemParams, $bizParams, $textParams, $this->_kernel->getConfig("merchantPrivateKey"));
$response = [
"body" => $this->_kernel->generatePage("POST", $systemParams, $bizParams, $textParams, $sign)
"body" => $this->_kernel->generatePage($method, $systemParams, $bizParams, $textParams, $sign)
];
return AlipayTradePagePayResponse::fromMap($response);
}
Expand Down