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); }