PayPal PHP SDK - 在发票中设置税金
PayPal PHP SDK - Set a tax in an invoice
我正在尝试使用 setTax 函数在此示例中插入税 https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/invoice/CreateInvoice.php,但我总是收到错误消息。你可以帮帮我吗?提前谢谢你。
我已经更新了创建发票的示例代码,以将税费包含到每个项目中。您可以在 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);
现在,如果您 运行 samples in your local machine, and run SendInvoice,您会在响应中看到包含的税费。
发票看起来像这样:
我正在尝试使用 setTax 函数在此示例中插入税 https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/invoice/CreateInvoice.php,但我总是收到错误消息。你可以帮帮我吗?提前谢谢你。
我已经更新了创建发票的示例代码,以将税费包含到每个项目中。您可以在 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);
现在,如果您 运行 samples in your local machine, and run SendInvoice,您会在响应中看到包含的税费。
发票看起来像这样: