How to make a Paypal refund using transaction id in the REST API Call?

Amardeep2
Contributor
Contributor

Hi Guys,

 

I am using srmklive package for Paypal integration. 

 

https://srmklive.github.io/laravel-paypal/docs.html

 

I want to refund a payment using transaction id but this package or the rest API doesn't provide any such end point. 

 

Is it possible to refund a payment using transaction id? 

I have already tried the sample codes such as:

 

$transactionId = "XYZ";
$amount = 10.00; 
$provider = new PayPalClient();
$refundResponse = $provider->refund([
'transaction_id' => $transactionId,
'amount' => [
'total' => $amount,
'currency' => 'USD',
],
]);

 

Please suggest!

 

Thanks

 

Login to Me Too
1 REPLY 1

MTS_Chiranjeevi
Moderator
Moderator

Good day @Amardeep2,

 

Thank you for posting to the PayPal community.

 

For NVP/SOAP API integration :

 

https://developer.paypal.com/docs/archive/express-checkout/ht-basicRefund-curl-etc/
https://developer.paypal.com/docs/nvp-soap-api/refund-transaction-nvp/?mark=RefundTransaction%20#
                                                      
For REST API Integration, please refer the below guide links. 

 

https://developer.paypal.com/docs/integration/direct/payments/refund-payments/ 

https://developer.paypal.com/docs/api/payments/v2/#captures_refund

 

NoteMerchant can also process manual refund, by follow the steps provided in the below guide link.

https://www.paypal.com/us/smarthelp/article/how-do-i-issue-a-full-or-partial-refund-faq780

 

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.