Hi am trying to create a refunding function for the paypal payflow.
This is code what exactly am created.
public function refund()
{
$this->load->helper('paypal_helper');
$request = array(
"PARTNER" => PARTNER,
"VENDOR" => VENDOR,
"USER" => USER,
"PWD" => PWD,
"TRXTYPE" => 'C',
"AMT" => '11',
"CURRENCY" => CURRENCY,
"CREATESECURETOKEN" => "N",
"SECURETOKENID" => uniqid('213'.time()),
"RETURNURL" => site_url().'test/refund',
"CANCELURL" => site_url().'test/refund',
"ERRORURL" => site_url().'test/refund',
"ORIGID" => 'A70A6DBF0A8C'
);
$response = run_payflow_call($request);
printr($response);
return $response;
}
Here ORGID is set as the PNREF what i got after the success payment.
$response = run_payflow_call($request);
is defined in the helper and it just post the details in to the https://pilot-payflowpro.paypal.com/ (sandbox). But after the action i got the result like this
[RESULT] => 23
[PNREF] => A1X06F928D52
[RESPMSG] => Invalid account number
Any one can tell me why this happen ??
am using the same "PARTNER" "VENDOR" "USER" for the purchase section also. But in the purchase everything going fine. I get the success report and the amount properly credited.
To refund a transaction using the Payflow you just need to pass the below parameters :
TRXTYPE =C (value is "C" for credit )
TENDER =C ( Value can be "C" if the payment was done using the credit card or "P" if its a PayPal payment)
ORIGID = A70A6DBF0A8C( Id to refund)
AMT = Optional parameter ( If not provided whole amount will be refunded)
Secure token is not required while doing the refund .