我如何设置税金并将其包含在订阅价格中 paypal sdk

How can I setup taxes and make them included in the subscription price paypal sdk

所以我住在欧洲,我们有义务将税费包含在显示给用户的价格中,我想知道如何使用 Paypal sdk 做到这一点。

我的billing_plan_attributes:

billing_plan_attributes = {
            "name": request.args['name'],
            "description": request.args['description'],
            "merchant_preferences": {
                "auto_bill_amount": "yes",
                "cancel_url": "https://ruby-eu.com/profile/settings/paypal/cancel/token",
                "initial_fail_amount_action": "continue",
                "max_fail_attempts": "1",
                "return_url": 'https://ruby-eu.com/profile/settings/paypal/subscribe/execute',
                "setup_fee": {
                    "currency": request.args['currency'],
                    "value": request.args['setup_fee']
                }
            },
            "payment_definitions": [
                {
                    "amount": {
                        "currency": request.args['currency'],
                        "value": request.args['amount']
                    },
                    "cycles": request.args['cycles'],
                    "frequency": request.args['frequency'],
                    "frequency_interval": request.args['frequency_interval'],
                    "name": request.args['payment_name'],
                    "type": request.args['payment_type'],
                }
            ],
            "type": request.args['type']
        }

我试过添加

"taxes": {
                    "percentage": "23",
                    "inclusive": True
                }

merchant_preferencespayment_defenitionstype 之下,但是当我 运行 他们 return

Problem while creating a new plan: Incoming JSON request does not map to API request

而且我不知道如何解决这个问题。 如果您想知道问题是否出在其他地方,我从 JSON 和 运行 中删除了税款并且它起作用了。

首先要知道 depcrecated billing plan object in the Python SDK does NOT correspond to the new plans object in the new Subscriptions API. If you want to use the Subscriptions API (and you probably should), you need to integrate with direct HTTPS API calls, NOT any of the old SDKs. Basically, look at the CURL calls you see here: https://developer.paypal.com/docs/subscriptions/integrate/ ... 并从 Python.

实现它们的等价物

订阅的计费计划对象 API do 支持您尝试添加的语法,所以我猜这就是您从哪里得到的:https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create