gpt4 book ai didi

php - paypal 无法处理此交易。要收取的金额为零

转载 作者:太空宇宙 更新时间:2023-11-03 16:09:24 25 4
gpt4 key购买 nike

这是我使用的代码

 $max_amount = 20;
//$max_amount = $this->currency->convert($order_info['total'], $this->config->get('config_currency'), 'USD');

$max_amount = min($max_amount * 1.25, 10000);
$max_amount = $this->currency->format($max_amount, $this->currency->getCode(), '', false);
$max_amount = $max_amount*100;
$data = array(
'METHOD' => 'SetExpressCheckout',
'MAXAMT' => $max_amount,
'AMT' => 1000,
'RETURNURL' => $this->url->link('payment/pp_express/checkoutReturn', '', 'SSL'),
'CANCELURL' => $this->url->link('checkout/checkout', '', 'SSL'),
'REQCONFIRMSHIPPING' => 0,
'NOSHIPPING' => 1,
'LOCALECODE' => 'EN',
'LANDINGPAGE' => 'Login',
'HDRIMG' => $this->model_tool_image->resize($this->config->get('pp_express_logo'), 790, 90),
'HDRBORDERCOLOR' => $this->config->get('pp_express_border_colour'),
'HDRBACKCOLOR' => $this->config->get('pp_express_header_colour'),
'PAYFLOWCOLOR' => $this->config->get('pp_express_page_colour'),
'CHANNELTYPE' => 'Merchant',
'ALLOWNOTE' => $this->config->get('pp_express_allow_note'),
);

$data = array_merge($data, $this->model_payment_pp_express->paymentRequestInfo());
echo '<pre>';
$result = $this->model_payment_pp_express->call($data);

print_r($result);

print_r($result) 的结果是

Array
(
[TIMESTAMP] => 2014-05-26T13:48:19Z
[CORRELATIONID] => d5ff8073cbde
[ACK] => Failure
[VERSION] => 65.2
[BUILD] => 11110362
[L_ERRORCODE0] => 10525
[L_SHORTMESSAGE0] => Invalid Data
[L_LONGMESSAGE0] => This transaction cannot be processed. The amount to be charged is zero.
[L_SEVERITYCODE0] => Error
)

我是否必须对值进行四舍五入?

最佳答案

您的请求中没有包含 AMT 参数。因此,它被视为 PayPal 不接受的零值。

需要添加AMT参数,传递SEC请求时订单的当前金额。当然,此金额可能会在该时间和最终 DoExpressCheckoutPayment 请求之间发生变化,但您只需要确保最终金额不大于您在此处传递的 MAXAMT。

关于php - paypal 无法处理此交易。要收取的金额为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23871720/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com