0
votes

I have used below code sample to implement recurring payment:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="XXXXXX">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_GB/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="1.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="D">
<input type="hidden" name="srt" value="6">
<input type="hidden" name="src" value="1">
<input type="hidden" name="return" value="XXXXXX">
<input type="hidden" name="notify_url" value="XXXXXX">
<input type="hidden" name="cancel_return" value="XXXXXX">
<input type="hidden" name="sra" value="1">
</form>
</body>
</html>

When I place order and test payment on sandbox and live both my initial payment is deducted and shows the recurring payment cycle for next day was showing due. But when I checked the next day it shows the status of recurring payment suspended. I am also attaching the screenshot from my paypal account showing suspended. enter image description here

1
And what is the final goal? As I understand this works fine right?Pavel Kenarov
My goal is that the recurring payment should be charged automatically but it didn't. Only initial payment was charged but the next cycle was on next day and it is showing suspended as you can see in the screenshot i attached with issue.Afroz Alam
I think that is exactly the opposite, in your screen the initial payment is set to 0.00 but the first recurring is executedPavel Kenarov
I dont know a way to set initial amount with hidden input you must use express checkout apiPavel Kenarov
The thing is my recurring payment cycle is showing in Paypal interface also . you can see Total cycles =6 and remaining cycles = 4 but when the day comes for next cycle it doesnot charge and shows suspended.Afroz Alam

1 Answers

0
votes

You have the maximum amount of failures set to 1. That means that if the payment fails the profile will automatically suspend after one attempt. You need to increase that number to 2 or 3.

<!-- PayPal reattempts failed recurring payments. -->
<input type="hidden" name="sra" value="1">

If you don't want an initial payment, you can add a trial period of 1 day or however long you want the trial period. Trial periods can be 0.00

<!-- Set the terms of the 1st trial period. -->
<input type="hidden" name="a1" value="0.00">
<input type="hidden" name="p1" value="1">
<input type="hidden" name="t1" value="D">

For more help, here is the Recurring Payments Subscription Guide from the PayPal Developer Site.