简体   繁体   中英

how paypal's Subscription button for recurring payment works

I have create a Subscription Button from my business sandbox account and trying to set recurring payment $1/week.

when i click the button on website every thing is working fine. But i don't know what should i save in DB after i return to success link.

i got the response from paypal is

Array
(
    [txn_type] => subscr_signup
    [subscr_id] => I-6ALNCWHKXXXX
    [last_name] => sharma
    [residence_country] => US
    [mc_currency] => USD
    [item_name] => Registration Weekly Button
    [business] => test.business.kaching@gmail.com
    [amount3] => 1.00
    [recurring] => 1
    [address_street] => 1 Main St
    [payer_status] => verified
    [payer_email] => test123@starwebindia.com
    [address_status] => confirmed
    [first_name] => harsh
    [receiver_email] => test.business.kaching@gmail.com
    [address_country_code] => US
    [payer_id] => XXXXJ2XM396NW
    [address_city] => San Jose
    [reattempt] => 1
    [payer_business_name] => harsh sharma's Test Store
    [address_state] => CA
    [subscr_date] => 05:36:38 Oct 01, 2018 PDT
    [btn_id] => 390XXXX
    [address_zip] => 95131
    [charset] => windows-1252
    [period3] => 1 W
    [address_country] => United States
    [mc_amount3] => 1.00
    [address_name] => harsh sharma's Test Store
    [auth] => AQUy6SmVq3w80zTvAfKwk62IyEsqNgyEWO6KVB8GfUMyytd2UXdckg.UiyDu4NVdi72buUymVDeXtO0XXXXXXXX
    [form_charset] => UTF-8
)

I have some issue's regarding this

  1. What attributes of response should i save in DB?
  2. If i successfully done the payment i get a new row in my recurring payment dashboard. what will happen on the next recurring date? how can i handle that recurring process?
  3. not related to recurring but i want to skip the page of "Return to saller's site".

Answers of your questions:

1) What attributes of response should i save in DB?

Answer: subscr_id,amount3, payer_email, payer_id, period3, auth These fields are stored into your DB

2) If i successfully done the payment i get a new row in my recurring payment dashboard. what will happen on the next recurring date? how can i handle that recurring process?

Answer: For this you have to create webhook, which automatically create request on the next recurring date ? Which acknowledge to you that you have to pay for next subscription.

3) not related to recurring but i want to skip the page of "Return to saller's site".

Answer: Not sure you have to use the account details when payment process occurred.

I hope answers are help you. Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM