gpt4 book ai didi

ruby-on-rails - ActiveMerchant PayPal Express 可能的错误?

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

我有点困惑,不知何故我可以更改购买金额:

首先我设置我的购买,

@setup_response = gateway.setup_purchase(
10*100,
:ip => request.remote_ip,
:return_url => url_for(:controller => "payments", :action => 'confirm', :only_path => false),
:cancel_return_url => url_for(:controller => "payments", :action => 'error', :only_path => false),
:currency => 'EUR',
:email => current_user.email,
:no_shipping => true,
:items => items
)

稍后我进行购买:

  purchase = gateway.purchase(
500*100,
:ip => request.remote_ip,
:payer_id => params[:payer_id],
:token => params[:token],
:currency => 'EUR'
)

如您所见,我已将金额从 10 -> 设置/用户在购买时同意更改为 1000,它在 Paypal 沙盒中确实有效。

我觉得这真的很奇怪。有人可以证实这一点吗?这不应该发生吗?这也许只有在沙盒中才有可能吗?

最佳答案

很确定 Paypal Express Checkout 不需要 DoExpressCheckoutPayment 处的金额(这是 setup_purchase 映射到的)与 SetExpressCheckout 处的相同.引用Paypal's documentation :

In the simplest case, you set the total amount of the order when you call the SetExpressCheckout API. However, you can change the amount before calling the DoExpressCheckoutPayment API if you did not know the total amount when you called the SetExpressCheckout API.

关于ruby-on-rails - ActiveMerchant PayPal Express 可能的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9415699/

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