沃梦达 / 编程问答 / php问题 / 正文

告诉 PayPal 自动处理每月付款

Tell PayPal to automatically process the monthly payment(告诉 PayPal 自动处理每月付款)

本文介绍了告诉 PayPal 自动处理每月付款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考:https://stackoverflow.com/a/25730860/2735734

如何告诉 PayPal 自动处理每月付款?

How to Tell PayPal to automatically process the monthly payment?

这是 PayPal 的回复:

here is the PayPal Reponses:

创建协议结果:

array (
      'name' => 'my name',
      'description' => 'my description',
      'plan' => 
      array (
        'id' => 'P-95307423V8719480UI4T4SGG',
        'state' => 'ACTIVE',
        'name' => 'title here',
        'description' => 'description here',
        'type' => 'INFINITE',
        'payment_definitions' => 
        array (
          0 => 
          array (
            'id' => 'PD-140035022V340531AI4T4SGG',
            'name' => 'Regular Payments',
            'type' => 'REGULAR',
            'frequency' => 'Month',
            'amount' => 
            array (
              'currency' => 'USD',
              'value' => '15.5',
            ),
            'cycles' => '0',
            'charge_models' => 
            array (
              0 => 
              array (
                'id' => 'CHM-9G272533RU378412KI4T4SGG',
                'type' => 'TAX',
                'amount' => 
                array (
                  'currency' => 'USD',
                  'value' => '1',
                ),
              ),
            ),
            'frequency_interval' => '1',
          ),
        ),
        'merchant_preferences' => 
        array (
          'setup_fee' => 
          array (
            'currency' => 'USD',
            'value' => '0',
          ),
          'max_fail_attempts' => '0',
          'return_url' => 'http://example.com/ok',
          'cancel_url' => 'http://example.com/cancel',
          'auto_bill_amount' => 'YES',
          'initial_fail_amount_action' => 'CONTINUE',
        ),
      ),
      'links' => 
      array (
        0 => 
        array (
          'href' => 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-4N736816FP8632455',
          'rel' => 'approval_url',
          'method' => 'REDIRECT',
        ),
        1 => 
        array (
          'href' => 'https://api.sandbox.paypal.com/v1/payments/billing-agreements/EC-4N736816FP8632455/agreement-execute',
          'rel' => 'execute',
          'method' => 'POST',
        ),
      ),
      'start_date' => '2014-10-25T11:54:20-00:00',
    )

并且在客户批准之后.

执行协议结果:

array (
      'id' => 'I-CD3VD66KJKXX',
      'state' => 'Active',
      'description' => 'my description',
      'plan' => 
      array (
        'payment_definitions' => 
        array (
          0 => 
          array (
            'type' => 'REGULAR',
            'frequency' => 'Month',
            'amount' => 
            array (
              'currency' => 'USD',
              'value' => '15.50',
            ),
            'cycles' => '0',
            'charge_models' => 
            array (
              0 => 
              array (
                'type' => 'TAX',
                'amount' => 
                array (
                  'currency' => 'USD',
                  'value' => '1.00',
                ),
              ),
              1 => 
              array (
                'type' => 'SHIPPING',
                'amount' => 
                array (
                  'currency' => 'USD',
                  'value' => '0.00',
                ),
              ),
            ),
            'frequency_interval' => '1',
          ),
        ),
        'merchant_preferences' => 
        array (
          'setup_fee' => 
          array (
            'currency' => 'USD',
            'value' => '0.00',
          ),
          'max_fail_attempts' => '0',
          'auto_bill_amount' => 'YES',
        ),
      ),
      'links' => 
      array (
        0 => 
        array (
          'href' => 'https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-CD3VD66KJKXX/suspend',
          'rel' => 'suspend',
          'method' => 'POST',
        ),
        1 => 
        array (
          'href' => 'https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-CD3VD66KJKXX/re-activate',
          'rel' => 're_activate',
          'method' => 'POST',
        ),
        2 => 
        array (
          'href' => 'https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-CD3VD66KJKXX/cancel',
          'rel' => 'cancel',
          'method' => 'POST',
        ),
        3 => 
        array (
          'href' => 'https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-CD3VD66KJKXX/bill-balance',
          'rel' => 'self',
          'method' => 'POST',
        ),
        4 => 
        array (
          'href' => 'https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-CD3VD66KJKXX/set-balance',
          'rel' => 'self',
          'method' => 'POST',
        ),
      ),
      'start_date' => '2014-10-25T07:00:00Z',
      'agreement_details' => 
      array (
        'outstanding_balance' => 
        array (
          'currency' => 'USD',
          'value' => '0.00',
        ),
        'cycles_remaining' => '0',
        'cycles_completed' => '0',
        'next_billing_date' => '2014-10-25T10:00:00Z',
        'final_payment_date' => '1970-01-01T00:00:00Z',
        'failed_payment_count' => '0',
      ),
    )

注意第一个响应的 start_date 到第二个...

note the start_date for the first reponse to the second...

第一笔付款没有完成......(我不知道另一笔,我今天尝试每天付款......我现在必须等待......)

The first payement isn't made... (And I don't know for the other, I've try today with a daily payement... I have to wait now...)

在沙盒帐户的预先批准区域中,处于活动状态并正确通知下次计费.

In the Pre-Approved area on the Sandbox Account, is in Active and inform about next billing correctly.

推荐答案

一旦用户完成并提交您创建的订阅购买页面,订阅就会开始,并会在您选择的任何时间间隔自动重新向客户的帐户收费.您无需执行任何操作.

Once the user completes and submits subscription purchase page you have created, the subscription will begin and will automatically rebill the customer's account on whatever interval you have selected. You do not have to do anything.

更新:REST API 还会自动处理订阅.您不必每月重新提交.PayPal 沙箱已于今年 7 月更新,使您能够测试和处理订阅.开发社区中没有报告任何有关此无法正常工作的问题,因此我怀疑这是您这边的事情.

Updated: The REST API also automatically processes subscriptions. You do not have to resubmit monthly. The PayPal sandbox was updated in July of this year to enable you to test and process subscriptions. There are no issues being reported in the dev community about this not working, so I suspect it is something on your side.

如果你还没有.请查看此内容:

If you haven't already. please review this:

https://developer.paypal.com/docs/integration/direct/test-the-api/

有计费计划和计费订阅部分.如果您仍有问题,请发布您的结算计划代码和您收到的回复.

There are billing plan and billing subscription sections. If you still have a problem, post your billing plan code and the response you are receiving.

这篇关于告诉 PayPal 自动处理每月付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:告诉 PayPal 自动处理每月付款

基础教程推荐