Paypal Refund NVP API : You do not have permission to refund this transaction - paypal

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.?

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.

Here is the some causes of this error.
You used the wrong transaction ID.
You're trying to make the call for a third party and have the wrong
email address in the subject.
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?

Related

PayPal DoReferenceTransaction bug when charging specific amount of 100.10

Unfortunately I can't get a response from PayPal tech support via their ticket system so maybe someone else has seen this. I'm certain it's a bug. Here are two API calls:
This one worked successfully:
[USER] => ***
[PWD] => ***
[SIGNATURE] => ***
[VERSION] => 86
[METHOD] => DoReferenceTransaction
[AMT] => 101.10
[TAXAMT] => 0.00
[ITEMAMT] => 101.10
[CURRENCYCODE] => USD
[PAYMENTACTION] => SALE
[REFERENCEID] => ***
[DESC] => ***
And this one didn't (only difference is the amount):
[USER] => ***
[PWD] => ***
[SIGNATURE] => ***
[VERSION] => 86
[METHOD] => DoReferenceTransaction
[AMT] => 100.10
[TAXAMT] => 0.00
[ITEMAMT] => 100.10
[CURRENCYCODE] => USD
[PAYMENTACTION] => SALE
[REFERENCEID] => ***
[DESC] => ***
The error returned for the second one is this:
[TIMESTAMP] => 2017-06-20T19:10:03Z
[CORRELATIONID] => ff77dc0fdff4e
[ACK] => Failure
[VERSION] => 86
[BUILD] => 29297572
[L_ERRORCODE0] => 10010
[L_SHORTMESSAGE0] => Invalid Invoice
[L_LONGMESSAGE0] => Non-ASCII invoice id is not supported
[L_SEVERITYCODE0] => Error
Clearly the error is also nothing to do with the problem as I'm even submitting an invoice id. Basically any amount other than 100.10 seems to work.
What's even more strange is that amount matches the PayPal error code that gets returned!
This is all in using the Sandbox.
Many thanks!
It sounds like you have negative testing enabled in the sandbox account, which allows you to force errors so that you test them by passing in an AMT that matches the error code you want to trigger. See the link for more details on this including how to enable/disable it.

Is it possible to change only AMT using UpdateRecurringPaymentsProfile PayPal?

This question has been posted elsewhere however I have not found a specific answer yet.
What I want to do is simply change the amount (AMT) of a PayPal recurring payments profile from say £55.00 to £60.00. The amount is all I want to change. I am using the below to do this:
$request_params = array
(
'USER' => $api_username,
'PWD' => $api_password,
'SIGNATURE' => $api_signature,
'VERSION' => $api_version,
'METHOD' => 'UpdateRecurringPaymentsProfile',
'PROFILEID' => 'I-R159ACHCUJHF',
'AMT' => '60.00',
'NOTE' => 'Re-adjust amount to £60'
);
OR
&USER=xxxxxxx&PWD=123456789&SIGNATURE=xyxyxyxyxyxyx&VERSION=85.0&METHOD=UpdateRecurringPaymentsProfile&PROFILEID=I-R159ACHCUJHF&AMT=11.00&NOTE=Re-adjust+amount+to+%C2%A360&TAXAMT=0.00
So I guess my question is can this be done using the fields above only or do you know if I am missing some other variables that are required possibly?
On another note, when I run this on the sandbox I get the following error:
Array
(
[TIMESTAMP] => 2014-11-28T10:11:36Z
[CORRELATIONID] => 9a5452736a159
[ACK] => Failure
[L_ERRORCODE0] => 10001
[L_SHORTMESSAGE0] => Internal Error
[L_LONGMESSAGE0] => Timeout processing request
)
Does anyone understand what this means and if it relates to the way I am requesting the change in amount (AMT) in the params above?
Many thanks in advance.
According to the example I'm cribbing from, you also need to pass CURRENCYCODE. The only example I could actually find was on PayPal Developer Brazil:
https://www.paypal-brasil.com.br/desenvolvedores/code-sample/recurring-payments-php/

How do you get the shipping address back from an Adaptive Payment API call?

How are you supposed to get the shipping info back from a Parallel Payment, using PayPal's Adaptive API system? Normally it would just get passed back as payer_country, etc - when the IPN script is requested. However, this doesn't seem to be the case.
Here are the params being passed in when the IPN script is called:
transaction[0].amount
transaction[0].id
verify_sign
transaction[1].receiver
reverse_all_parallel_payments_on_error
transaction[1].pending_reason
transaction[0].pending_reason
transaction[1].id_for_sender_txn
transaction[0].invoiceId
payment_request_date
test_ipn
cancel_url
charset
return_url
transaction[0].status_for_sender_txn
ipn_notification_url
transaction[1].is_primary_receiver
transaction[1].status
transaction_type
transaction[1].amount
transaction[0].status
log_default_shipping_address_in_transaction
transaction[0].receiver
status
transaction[0].id_for_sender_txn
action_type
fees_payer
pay_key
transaction[1].status_for_sender_txn
transaction[0].paymentType
transaction[1].invoiceId
transaction[1].id
sender_email
notify_version
transaction[1].paymentType
transaction[0].is_primary_receiver
If I then do a PaymentDetails API call, I get back stuff like:
$VAR1 = {
'currencyCode' => 'USD',
'responseEnvelope' => {
'correlationId' => '9944330ab9a8c',
'timestamp' => '2014-04-07T06:08:16.094-07:00',
'ack' => 'Success',
'build' => '10273932'
},
'status' => 'COMPLETED',
'senderEmail' => 'andy.aaaa#ultranerds.co.uk',
'cancelUrl' => 'http://somesite.net/paypal/cancel.html',
'paymentInfoList' => {
'paymentInfo' => [
{
'pendingRefund' => 'false',
'receiver' => {
'accountId' => 'NY3AD33DD739C',
'email' => 'andy-xxx#ultranerds.com',
'amount' => '65.00',
'invoiceId' => '1022',
'primary' => 'false',
'paymentType' => 'GOODS'
},
'transactionId' => '8E1114341X895213Y',
'senderTransactionStatus' => 'COMPLETED',
'senderTransactionId' => '5EV71352C33256006',
'transactionStatus' => 'COMPLETED',
'refundedAmount' => '0.00'
},
{
'pendingRefund' => 'false',
'receiver' => {
'accountId' => 'YYP5C69YWCMKE',
'email' => 'andy.yyy#gmail.com',
'amount' => '15.00',
'invoiceId' => '1023',
'primary' => 'false',
'paymentType' => 'GOODS'
},
'transactionId' => '68H86656UP574062X',
'senderTransactionStatus' => 'COMPLETED',
'senderTransactionId' => '2XW88939LK1112523',
'transactionStatus' => 'COMPLETED',
'refundedAmount' => '0.00'
}
]
},
'feesPayer' => 'EACHRECEIVER',
'actionType' => 'CREATE',
'ipnNotificationUrl' => 'http://somesite.net/paypal/test_ipn.cgi',
'sender' => {
'useCredentials' => 'false',
'accountId' => 'B74RBM5F6SLZG',
'email' => 'andy.aaa#ultranerds.co.uk'
},
'returnUrl' => 'http://somesite.net/paypal/success.html',
'payKey' => 'AP-4EK17906VB6613533',
'reverseAllParallelPaymentsOnError' => 'false'
};
As you can see, there is no reference to the delivery address at all. How are you supposed to get that info back?
UPDATE: Mmm ok, so it looks like GetShippingAddresses is what I need - but for some reason its coming back with nothing in when I call it:
{"requestEnvelope":{"errorLanguage":"en_US","detailLevel":"ReturnAll"},"key":"AP-1B1377463N9785350"} /GetShippingAddresses_API_Operation/
...simply returns:
{
'responseEnvelope' => {
'correlationId' => '3a4443aed09c9',
'timestamp' => '2014-04-07T06:40:35.460-07:00',
'ack' => 'Success',
'build' => '10273932'
}
}
I'm a bit baffled as to why its doing that. Any suggestions?
I found a quote here:
http://go.developer.ebay.com/devzone/articles/using-paypals-adaptive-payments-and-google-app-engine-build-online-market-python-part-3
Unfortunately, although this follows the process recommended by
PayPal's documentation, it doesn't work. There's currently a bug in
PayPal's Adaptive Payments implementation. For a traditional payment,
the shipping address is not collected; for embedded payments, the
GetShippingAddresses call does not return the shipping address.
PayPal has acknowledged the bug and indicated that it expects to have
this fixed in April 2011. If you need shipping addresses right now,
the recommendation is to collect them on your site rather than relying
on the PayPal API.
That was from 2011... but is this still the case??
Sorry to bump - but has anyone got any suggestions?
Ok, well I got my answer - but unfortunately its not what I was hoping for:
Yes, unfortunately this feature is only available for embedded payment
flow.
https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/
If you're using embedded payment flow, then you can retrieve the
address on their PayPal account by passing in
senderOptions.requireShippingAddressSelection = true during
SetPaymentOption API call. You can then retrieve it via
GetShippingAddresses API call.
So it looks like really what I need to do, is ask the user to provide their shipping information BEFORE sending them to paypal, then storing it. Not ideal - but I guess you just have to work with what you got!

PayPal address_override integration to PayPal Express Checkout

I'm trying to set up PayPal address_override at my shop checkout as my customers have already filled in their delivery details.
I'm using express checkout, and following on from reading the documentation here: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/
I've got the following basic set up added into my working express checkout code (perl file):
# -- build the request for Paypal
my $response = $useragent->post($api_endpoint,
[
'METHOD' => 'SetExpressCheckout',
'VERSION' => '3.0',
'PWD' => $API_PASSWORD,
'USER' => $API_USERNAME,
'SIGNATURE' => $API_SIGNATURE,
'Amt' => $amount,
'PAYMENTACTION' => 'Sale',
'ReturnUrl' => $returnurl,
'CANCELURL' => $cancelurl,
'CURRENCYCODE' => $API_CURRENCYCODE,
'address_override' => '1',
'address1' => $d_address1,
'address2' => $d_address2,
'city' => $d_city,
'country' => $country,
'zip' => $d_post_code
]
);
However this isn't overriding the address when I get through to my PayPal account, it's still just showing my stored addresses.
I've read this post:
Paypal | Website Payment Standard | Adddress Override
And this one:
Paypal Address Override not working
Hopefully someone can show me where I'm going wrong, or if I've missed a step! Any help appreciated.
I may be wrong here but that API link you've pasted doesn't look like it's the same API that the rest of your code sample is using?
Searching for SetExpressCheckout leads to this page: https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
I think you need to use the ADDROVERRIDE parameter instead of address_override and whatever else you need from that page.

making Order in Paypal Parallel Express Checkout

I am trying to place Order with Parallel Paypal Express Checkout. Here is the API implementation.
I am using PAYMENTREQUEST_0_PAYMENTACTION => Order in SetExpressCheckout and in DoExpressChecoutPayment and it gives error (this is required).
When I use PAYMENTREQUEST_0_PAYMENTACTION => Order in SetExpressCheckout and PAYMENTREQUEST_0_PAYMENTACTION => Sale in DoExpressChecoutPayment it works.
All goes well until DoExpressChecoutPayment. Please check this
DoExpressCheckoutPayment Request
(
[TOKEN] => EC-4U931568VK402050F
[PAYERID] => BFSU67Z2LX5FJ
[VERSION] => 97.0
[METHOD] => DoExpressCheckoutPayment
[USER] => 'user'
[PWD] => 'pwd'
[SIGNATURE] => 'sig'
[PAYMENTREQUEST_0_PAYMENTACTION] => ORDER
[PAYMENTREQUEST_0_AMT] => 200.00
[PAYMENTREQUEST_0_CURRENCYCODE] => EUR
[PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID] => vendortwo2#yhaoo.com
[PAYMENTREQUEST_0_PAYMENTREQUESTID] => 25935
[PAYMENTREQUEST_1_PAYMENTACTION] => ORDER
[PAYMENTREQUEST_1_AMT] => 22.00
[PAYMENTREQUEST_1_CURRENCYCODE] => EUR
[PAYMENTREQUEST_1_SELLERPAYPALACCOUNTID] => vendorone#yahoo.com
[PAYMENTREQUEST_1_PAYMENTREQUESTID] => 25934
)
and response from this is:
(
[TOKEN] => EC-4U931568VK402050F
[SUCCESSPAGEREDIRECTREQUESTED] => false
[TIMESTAMP] => 2013-09-26T10:08:27Z
[CORRELATIONID] => 2381c85a926e3
[ACK] => Failure
[VERSION] => 97.0
[BUILD] => 7882219
[INSURANCEOPTIONSELECTED] => false
[SHIPPINGOPTIONISDEFAULT] => false
[PAYMENTINFO_0_PAYMENTSTATUS] => Failed
[PAYMENTINFO_0_SELLERPAYPALACCOUNTID] => vendortwo2#yhaoo.com
[PAYMENTINFO_0_SECUREMERCHANTACCOUNTID] => DRM9QQUAG9UNC
[PAYMENTINFO_0_PAYMENTREQUESTID] => 25935
[PAYMENTINFO_0_ERRORCODE] => 10001
[PAYMENTINFO_0_SHORTMESSAGE] => Internal Error
[PAYMENTINFO_0_LONGMESSAGE] => Internal Error
[PAYMENTINFO_0_SEVERITYCODE] => Error
[PAYMENTINFO_0_ACK] => Failure
[PAYMENTINFO_1_PAYMENTSTATUS] => Failed
[PAYMENTINFO_1_SELLERPAYPALACCOUNTID] => vendorone#yahoo.com
[PAYMENTINFO_1_SECUREMERCHANTACCOUNTID] => M7HT95CA3PUCE
[PAYMENTINFO_1_PAYMENTREQUESTID] => 25934
[PAYMENTINFO_1_ERRORCODE] => 10001
[PAYMENTINFO_1_SHORTMESSAGE] => Internal Error
[PAYMENTINFO_1_LONGMESSAGE] => Internal Error
[PAYMENTINFO_1_SEVERITYCODE] => Error
[PAYMENTINFO_1_ACK] => Failure
)
I have asked same question here.
Internal error came because wrong type of account ids are assigned to PAYMENTINFO_0_SELLERPAYPALACCOUNTID and PAYMENTINFO_1_SELLERPAYPALACCOUNTID in DoExpressCheckoutPayment request. Accounts assigned are personal, they should be paypal Business Accounts instead. that was the reason of "Internal Error". Thanks