paypal - 使用 PayPal 订阅 API 收取税款

标签 paypal subscription paypal-subscriptions tax

作为欧盟卖家,我需要根据客户所在国家/地区的税率和规则征税。这意味着当我创建订阅时,我需要指定税率(百分比或金额)或能够覆盖订阅价格。使用 Stripe 时,只需在创建订阅时在 plan_id 旁边指定 tax_percent

到目前为止,我无法使用 PayPal Subscriptions API 做同样的事情和他们的 smart buttons .可以在创建计划时设置税率,但我需要能够设置每个订阅的税率。

示例智能按钮 JS 代码:

paypal.Buttons({
  createSubscription: function(data, actions) {
    return actions.subscription.create({
      'plan_id': 'P-2UF78835G6983425GLSM44MA',
      // I'd like to be able to set tax rate here somehow
    });
  }
}).render('#paypal-button-container');

直接使用 Subscriptions API 设置税金也不走运:

curl -v -k -X POST https://api.sandbox.paypal.com/v1/billing/subscriptions \
   -H "Accept: application/json" \
   -H "Authorization: Bearer Access-Token" \
   -H "Content-Type: application/json" \
   -d '{
      "plan_id": "P-2UF78835G6983425GLSM44MA",
      "application_context": {
        "brand_name": "example",
        "user_action": "SUBSCRIBE_NOW",
        "payment_method": {
          "payer_selected": "PAYPAL",
          "payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
        },
        "return_url": "https://example.com/returnUrl",
        "cancel_url": "https://example.com/cancelUrl"
      }
    }'

我是不是遗漏了什么,没有正确地考虑这个问题,或者 PayPal 是否“忘记”实现基本的东西,如税率,因此使他们的新订阅 API 无法用于 VAT MOSS 场景?

最佳答案

您可以将税收优惠添加到计划节点,如下所示

    <script>

      paypal.Buttons({
        createSubscription: function(data, actions) {
          return actions.subscription.create({
            'plan_id': 'YOUR_PLAN_ID_HERE', // Creates the subscription
            
            'plan': {
               'taxes': {
                   'percentage': '2.9',
                   'inclusive': false
               }}


          });
        },
        onApprove: function(data, actions) {
          alert('You have successfully created subscription ' + data.subscriptionID); // Optional message given to subscriber
        }
      }).render('#paypal-button-container'); // Renders the PayPal button
    </script>

关于paypal - 使用 PayPal 订阅 API 收取税款,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58888882/

相关文章:

javascript - paypal dg flow 灯箱不再有效

Grails Paypal SDK 集成

php - PayPal-PHP-SDK 中不支持的 SSL 协议(protocol)版本

android - 订阅升级到inapp产品

Paypal 定期付款未检索交易 ID

Paypal 对订阅付款失败/丢失的行为

paypal - 如何设置使用 PayPal 登录的重定向 URI

iOS 应用和订阅?

subscription - 使用 Stripe 订阅跳过付款的最佳方式(提供免费一个月)?

zend-framework - 网站上的付费成员(member)资格的计划工作流程是什么?