From 69ee3697e9aaa368fc96e12dde3f8206d7ff964e Mon Sep 17 00:00:00 2001 From: GEIKIY Date: Mon, 22 Feb 2021 19:29:17 +0800 Subject: [PATCH] modify payment.trade.page.pay default method to support GET method togenerate redirect url --- php/src/Payment/Page/Client.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/php/src/Payment/Page/Client.php b/php/src/Payment/Page/Client.php index 335a781..8841ec3 100644 --- a/php/src/Payment/Page/Client.php +++ b/php/src/Payment/Page/Client.php @@ -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"), @@ -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); }