2

i Am using Paypal NVP Refund Api For Refund Paypal Transaction. All Things are ok but when i try to rung api, it gives me below Response.

Array
(
    [TIMESTAMP] => 2017-07-17T13:58:24Z
    [CORRELATIONID] => xxxxxxxxxx
    [ACK] => Failure
    [VERSION] => 51.0
    [BUILD] => 36458220
    [L_ERRORCODE0] => 10007
    [L_SHORTMESSAGE0] => Permission denied
    [L_LONGMESSAGE0] => You do not have permission to refund this transaction
    [L_SEVERITYCODE0] => Error
)

is that some process i miss to call.?

Rizwan Khan
  • 211
  • 3
  • 19

2 Answers2

1

After giving permission same issue exists. Then I found I missed an argument..

I'm sending this request.

$nvpreq = array(
    'USER' => '',
    'PWD' => '',
    'SIGNATURE' => '',
    'METHOD'=> 'RefundTransaction',
    'VERSION' => urlencode('94'),
    'TRANSACTIONID' => 'xxxxxxxx',
    'REFUNDTYPE' => 'Partial',
    'AMT' => '0.01',
    'CURRENCYCODE' => 'USD');

I forgot to add 'SUBJECT' => 'reiceversemail@gmail.com',. Now it is working.

pmaruszczyk
  • 2,157
  • 2
  • 24
  • 49
Rizwan Khan
  • 211
  • 3
  • 19
0

Here is the some causes of this error.

  1. You used the wrong transaction ID.

  2. You're trying to make the call for a third party and have the wrong email address in the subject.

  3. The subject account hasn't given you permission to make the third-party call.

Here is link you can check this. Why did I get API error code 10007?

Hamza Zafeer
  • 2,360
  • 13
  • 30
  • 42
  • Transaction id is right. if i use wrong transaction id . is gives response that `invalid transaction id`.@hamza zafeer – Rizwan Khan Jul 17 '17 at 14:08
  • You are using your own Paypal account? – Hamza Zafeer Jul 17 '17 at 14:15
  • @Rizwan Have permission to make a refund on behalf of the receiver, unless you are also the receiver; in other words, each receiver whose account is the source of the refund must have granted you third-party access permission to call the Refund API operation...Checkout this. https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/ – Hamza Zafeer Jul 17 '17 at 14:18
  • Yes I m using my own PayPal account.@Hamza zafeer – Rizwan Khan Jul 17 '17 at 15:59
  • Thankx @hamza zafeer . – Rizwan Khan Jul 17 '17 at 16:02
  • This is happening to me because by mistake I accepted payment with my personal Paypal account and not the Business one. Unfortunately not sure how to deal with this in term of old payments. – Carmine Tambascia Jun 21 '20 at 15:30