告诉PayPal自动处理每月付款 [英] Tell PayPal to automatically process the monthly payment

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

问题描述

ref: http://stackoverflow.com/a/25730860/2735734

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

How to Tell PayPal to automatically process the monthly payment?

这里是PayPal Reponses:

here is the PayPal Reponses:

CreateAgreement结果:

CreateAgreement result:

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',
      ),
    )

注意第一个回复的开始日期...

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自动处理每月付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆