如何从托管的BuyNow按钮将高级变量传递给Paypal PDT和IPN

Pau*_*lor 6 java payment tomcat paypal paypal-ipn

我的Paypal Hosted BuyButton应用折扣,通过将其添加到高级变量来完成.

discount_rate=40
Run Code Online (Sandbox Code Playgroud)

一切正常.

问题是,在我的IPN处理中,我通过调用检查用户是否支付了正确的金额request.getParameter(mc_gross),然后我检查mc_gross数字与预期数字,但mc_gross不包括折扣,因此折扣购买失败.

我以为我能做到

request.getParameter(discount_rate) 
Run Code Online (Sandbox Code Playgroud)

然后算出净费率,但它没有返回值.

所以我的问题是如何从IPN(和PDT)访问advanced_variable,补充问题是是否有一个标准变量显示用户实际支付的金额(即折扣后)

Bri*_*izo 0

根据他们的文档,https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/#id091EB04C0HS

似乎可以使用 request.getParameter(discount) 检索折扣金额,这将是应用于 mc_gross_x 的总额。

您可以通过将折扣除以 mc_gross_x 来获得费率。