Paypal showing error page while passing variables to sandbox environment

April 13, 2018, at 7:40 PM

I am trying to integrate paypal for one time donation save data to database and then mark paid/unpaid using Paypal IPN, I was working with below code yesterday, it was working fine and was redirecting me to sandbox page to pay and then come back.

below is my php form

<form method="post" action="<?php echo base_url(); ?>controller/function" name="DonationForm" id="DonationForm" class="mt-20">
 <input type="number" min="1" placeholder="Amount" id="amount" name="amount" class="form-control">
---- here i have some more variables to insert in database--

and below is my codeigniter function

$UniqueIdGenrated=md5(uniqid(mt_rand(), FALSE));
$paypal_email = '';
$return_url = '';
$cancel_url = '';
$notify_url = '';
$item_name='Donation for a cause';
$querystring = '';
$querystring .= "?business=".urlencode($paypal_email)."&";
$querystring .= "item_name=".urlencode($item_name)."&";
$querystring .= "amount=".urlencode($amount)."&";
$querystring .= "item_number=".urlencode($item_number)."&";
$querystring .= "currency_code=".urlencode($currency_code)."&";
$querystring .= "cmd=".urlencode($cmd)."&";
// Append paypal return addresses
$querystring .= "return=".urlencode(stripslashes($return_url))."&";
$querystring .= "cancel_return=".urlencode(stripslashes($cancel_url))."&";
$querystring .= "notify_url=".urlencode($notify_url);

However today when I started testing again, paypal says "Things don't appear to be working at the moment. Please try again later."

I tried keeping below as header, live paypal


then it has taken me properly on paypal payment page below is the screen shot

Can anyone please help me, am i missing something :(

Answer 1

Weird, now it's working fine with the same code and redirecting me to paypal sandbox as intended. below is the screen shot. I guess paypal sandbox server was down or something, or might be there was some temporary glitch... don't know. Thanks!!

Screen shot

How to create REST api for php program [on hold]

How to create REST api for php program [on hold]

i'm creating the program for PHP validation i want to know that how to get JSON data using PHP script i'm working on PHP validation program and i want to make a REST API for this PHP code

Apache configuration limits for PHP FTP

Apache configuration limits for PHP FTP

I've got a PHP script, launched via an AJAX POST request, which does the following actions :

Combine two php scripts/functions

Combine two php scripts/functions

Good morning, everyone