dtyrxmoj20617 2015-02-24 17:44
浏览 66
已采纳

PayPal PHP SDK - 在发票中设置税金

I'm trying to insert a tax in this example https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/invoice/CreateInvoice.php using the setTax function and I always get an error. Could you help me? Thank you in advance.

  • 写回答

1条回答 默认 最新

  • doujiaoang69440 2015-02-24 18:24
    关注

    I have updated the sample code for create invoice to include tax into each item. You can read more about the specifics on tax in developer docs. As you can see, the tax field is present inside invoice_item. You can follow the sample code as shown below. To checkout the complete sample, visit here.

    // #### Tax Item
    // You could provide Tax information to each item.
    $tax = new \PayPal\Api\Tax();
    $tax->setPercent(1)->setName("Local Tax on Sutures");
    $items[0]->setTax($tax);
    

    Now, if you run the samples in your local machine, and run SendInvoice, you would see the tax included in the response.

    enter image description here

    The invoice would look something like this:

    enter image description here

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

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题