ActiveMerchant PayPal Express 可能存在错误?
我有点困惑,不知怎的,我能够更改购买的金额:
首先我设置我的购买,
@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 -> 更改为 10。安装程序/用户在购买时同意 1000,并且它在 Paypal 沙箱中确实有效。
我觉得这真的很奇怪。有人能证实这一点吗?这不应该发生吗? 这也许只能在沙盒中实现?
I am a little bit confused, somehow I am able to change the amount of the purchase:
First I setup my purchase,
@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
)
Later I do the purchase:
purchase = gateway.purchase(
500*100,
:ip => request.remote_ip,
:payer_id => params[:payer_id],
:token => params[:token],
:currency => 'EUR'
)
As you can see I have changed the amount from 10 -> setup/user agreed to 1000 when purchasing and it did work in the Paypal Sandbox.
I think this is really strange. Can anybody confirm this? This should not happen?
Is this perhaps only possible in the Sandbox?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可以肯定的是,Paypal Express Checkout 并不要求
DoExpressCheckoutPayment
中的金额(这是setup_purchase
映射到的)与SetExpressCheckout
中的金额相同。引用 Paypal 文档:Pretty sure Paypal Express Checkout does not require the amount at
DoExpressCheckoutPayment
(which is whatsetup_purchase
maps to) to be the same as that atSetExpressCheckout
. To quote Paypal's documentation:您在设置和购买之间有一些回旋余地 - 这是为了允许人们更改订单、折扣等。
不要冒险向人们收取的费用超出您明确规定的金额 - Paypal 很快就会给人们退款所以从长远来看你最终会失败。
You are allowed some leeway between the set-up and the purchase - this is to allow people changing their order, discounts, etc.
Don't take the risk of billing people more than you clearly state - Paypal are very quick to give people refunds so you'll end up losing out in the long run.