PayPalのAPIを使用して定期支払いを設定しています。まず、次のパラメータをに送信しますSetExpressCheckout
。
Array
(
[METHOD] => SetExpressCheckout
[USER] => XXX
[PWD] => XXX
[SIGNATURE] => XXX
[VERSION] => 98.0
[AMT] => 0
[MAXAMT] => 99.00
[RETURNURL] => http://google.com
[CANCELURL] => http://google.com
[L_BILLINGTYPE0] => RecurringPayments
[L_BILLINGAGREEMENTDESCRIPTION0] => 99.00 per month till stopped
)
これにより、次のような応答が生成されます。
Array
(
[TOKEN] => EC-90P39652RF345525U
[TIMESTAMP] => 2013-02-08T17:09:24Z
[ACK] => Success
[VERSION] => 98.0
)
作成された請求契約の説明とトークンを使用して、次のパラメーターをCreateRecurringPaymentsProfileに送信します。
Array
(
[METHOD] => CreateRecurringPaymentsProfile
[USER] => XXX
[PWD] => XXX
[SIGNATURE] => XXX
[TOKEN] => EC-90P39652RF345525U
[PROFILESTARTDATE] => Feb 22 2013 17:09:24
[DESC] => 99.00 per month till stopped
[BILLINGPERIOD] => Month
[BILLINGFREQUENCY] => 12
[AMT] => 99.00
[CURRENTCYCODE] => USD
[CREDITCARDTYPE] => VISA
[ACCT] => 1234123412341234
[EXPDATE] => 012014
[CVV2] => 123
[EMAIL] => fake@example.com
[STREET] => 123 Main St
[CITY] => New York City
[STATE] => NY
[COUNTRYCODE] => US
[ZIP] => 12345
)
すべてが私にはよく見えますが、失敗します:
Array
(
[TIMESTAMP] => 2013-02-08T17:09:24Z
[ACK] => Failure
[VERSION] => 98.0
[L_ERRORCODE0] => 11502
[L_SHORTMESSAGE0] => Invalid Token
[L_LONGMESSAGE0] => The token is invalid
[L_SEVERITYCODE0] => Error
)
どんな助けでも大歓迎です!