Reputation: 306
I am working a codeigniter project on localhost and In which I am using paypal sandbox payment method for payment.
In which I am facing a problem, The return url is not redirect automatically and also when I click on return merchant button then It is not returning any parameter to my url.
I have set all setting of paypal, I have set the auto return on from paypal account and also set the return url but still i am not getting any response.I am usging this form and parameters.
$paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr';
<form action="<?php echo $paypal_url; ?>" method="post" name="frmPayPal1">
<input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="PHPGang Payment">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="userid" value="1">
<input type="hidden" name="credits" value="510">
<input type="hidden" name="amount" value="20">
<input type="hidden" name="cpp_header_image" value="http://112.196.5.114/psychics/component/images/logo.png">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="notify_url" value="http://112.196.5.114/psychics/dashboard/profile/return_url">
<input type="hidden" name="cancel_return" value="http://112.196.5.114/psychics/dashboard/profile/cancel_return">
<input type="hidden" name="return" value="http://112.196.5.114/psychics/dashboard/profile/return_url">
<button type="submit" class="btn btn-success"> Add Funds</button>
</form>
I did not get where is my fault.
Upvotes: 2
Views: 1527
Reputation: 354
Your code is fine, just add below line in your code, clear your browser's cache-cookies and try again:
< input type='hidden' name='rm' value='2'>
NOTE 1: After adding above code, PayPal will return response in POST method.
NOTE 2: Recheck and confirm that auto return must be enable from your PayPal business verified account.
You can check response by adding below line in your return page within PHP tag:
print_r($_REQUEST); OR print_r($_POST);
For more help about PayPal button parameters: check documentation
Upvotes: 2