简体   繁体   中英

How to grab PayPal recurring payment data after subscription in php?

My PayPal subscription form is working fine. But, I am not getting payment details in success page.

index.php file:

<form name="myform" action="<?php echo $paypal_url;?>" method="post">
<input type="hidden" name="business" value="<?php echo $merchant_email;?>" />
<input type="hidden" name="notify_url" value="<?php echo $notify_url;?>" />
<input type="hidden" name="cancel_return" value="<?php echo $cancel_return;?>" />
<input type="hidden" name="return" value="<?php echo $success_return;?>" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="lc" value="" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="CAD" />
<input type="hidden" name="page_style" value="paypal" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="item_name" value="Test Item" />
<input type="hidden" value="_xclick-subscriptions" name="cmd"/>
<input type="hidden" name="amount" value="20" />

Success.php file:

print_r($_REQUEST);

I am not getting data in success page.

What you are showing here is a PayPal Standard subscription button. To process payments related to these, you should use IPN .

Once you get your IPN listener configured in general, you can build triggers specific to subscription actions using the following IPN transaction types :

  • subscr_cancel
  • subscr_eot
  • subscr_failed
  • subscr_modify
  • subscr_payment
  • subscr_signup

When those things occur on your PayPal account it will trigger the related IPN accordingly, and your listener can receive the data associated with that transaction and process it however you need.

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