我有点困惑,不知何故我可以改变购买的金额:
首先,我设置我的购买,
@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,它在贝宝沙盒中工作。
我觉得这真的很奇怪。有人能证实这一点吗?这不应该发生吗?这可能只在沙盒中才有可能吗?
发布于 2012-02-23 23:50:32
相当肯定的是,Paypal Express Checkout不要求DoExpressCheckoutPayment (这是setup_purchase映射到的)的金额与SetExpressCheckout相同。引用Paypal's documentation
在最简单的情况下,您可以在调用SetExpressCheckout接口时设置订单的总金额。但是,如果您在调用DoExpressCheckoutPayment接口时不知道总金额,则可以在调用SetExpressCheckout接口之前更改金额。
发布于 2012-02-29 04:09:01
你被允许在设置和购买之间有一些回旋余地-这是为了允许人们改变他们的订单,折扣等。
不要冒险向人们收取比你明确声明的更多的账单- Paypal非常迅速地给人们退款,所以从长远来看,你最终会输掉的。
https://stackoverflow.com/questions/9415699
复制相似问题