duankun9280 2013-08-07 17:36
浏览 64
已采纳

在Paypal上有项目描述和税收

I am currently working on a online store and I wanted to add Paypal as a checkout method. I started by using Express Checkout which worked fine until I tried to add taxes. The problem with Express Checkout is that I would need to calculate the taxes amount and send it with the rest on the information. My problem is that I need to know where the customer is from so I can adjust the tax amount. I tried to use Adaptive Payments but when it comes to the description of the order it only show the receivers (Ex: OnlineShop@something.ye) so I can not add the multiple items like I do with Express Checkout since this didn't worked out I did not try to see if the tax was working with this method.

So what I would like to know is...

  1. How can I get the address of the customer so I can show him the taxes in the order details with Express Checkout ?

  2. If this is not possible, is there a way I can change the order details of an Adaptive Payment ?

There is suppose to be a way to get the address before doing the DoExpressCheckout and change the tax amount there by using MAXAMT in SetExpressCheckout but the customer would only see the tax amount on my website and not in the Paypal page which I think is kind of odd.

Edit 1

Now that I've added a callback it's asking me for shipping flat rate.

Here is my request string...

'&METHOD=SetExpressCheckout'.
'&AMT='.$subTotal.
'&MAXAMT='.round($subTotal*1.13, 2,PHP_ROUND_HALF_EVEN).
'&RETURNURL='.$returnUrl.
'&CANCELURL='.$cancelUrl.
'&CALLBACK='.$callbackUrl.
'&CALLBACKTIMEOUT=10'.
'&L_SHIPPINGOPTIONISDEFAULT0=true'.
'&L_SHIPPINGOPTIONNAME0=FreeShipping'.
'&l_shippingOptionLabel0=FreeShipping'.
'&L_SHIPPINGOPTIONAMOUNT0=0.00'.
'&SHIPPINGAMT=0.00'.
'&CURRENCYCODE='.$currencyCode.
 $desc. //Contains every item description
'&TAXAMT=0.00'.
'&ITEMAMT='.$subTotal.
'&LOCALECODE=EN';

Edit 2

So now the SetExpressCheckout is working, but my callback request is not...

'&METHOD=Callback'.
'&L_AMT0='.
'&PAYMENT_0_REQUESTAMT='.round($subTotal*1.13, 2,PHP_ROUND_HALF_EVEN).
'&CURRENCYCODE='.$_SESSION['Currency'].
'&L_TAXAMT0='.round($subTotal*0.13, 2,PHP_ROUND_HALF_EVEN).
'&ITEMAMT='.round($subTotal*1.13, 2,PHP_ROUND_HALF_EVEN).
'&LOCALECODE=EN';

I tried Callback and CallbackRequest for the method and when I go on the page itself I always get "Method Specified is not Supported".

I don't really know what to try at this point.

  • 写回答

1条回答 默认 最新

  • duan19780629 2013-08-07 20:44
    关注

    You could use the CallBack API to update this correctly on the PayPal payment page. You would pass over an initial amount for the taxes/shipping. Then once the buyer enters in their address or signs into their account, the CallBack API would send the information to calculate the charges and display those to the buyer. You can find more on this in the developers guide starting on page 59.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 求解vmware的网络模式问题 别拿AI回答
  • ¥24 EFS加密后,在同一台电脑解密出错,证书界面找不到对应指纹的证书,未备份证书,求在原电脑解密的方法,可行即采纳
  • ¥15 springboot 3.0 实现Security 6.x版本集成
  • ¥15 PHP-8.1 镜像无法用dockerfile里的CMD命令启动 只能进入容器启动,如何解决?(操作系统-ubuntu)
  • ¥30 请帮我解决一下下面六个代码
  • ¥15 关于资源监视工具的e-care有知道的嘛
  • ¥35 MIMO天线稀疏阵列排布问题
  • ¥60 用visual studio编写程序,利用间接平差求解水准网
  • ¥15 Llama如何调用shell或者Python
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?