How to refund using transaction id?

AnuritaSaggu
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
2 REPLIES 2

MTS_Chiranjeevi
Moderator
Moderator

Good day @AnuritaSaggu,

 

Thank you for posting to the PayPal community.

 

Yes, you can refund using transaction ID.

For NVP/SOAP API integration :

 

https://developer.paypal.com/docs/archive/express-checkout/ht-basicRefund-curl-etc/ 

https://developer.paypal.com/api/nvp-soap/refund-transaction-nvp/ 
                                                      
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

https://developer.paypal.com/docs/api/payments/v1/#sale_refund

https://developer.paypal.com/docs/api/payments/v1/#capture_refund 

 

Note Merchant 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

 

If your still facing the issue, please create a MTS ticket via - https://www.paypal-support.com/s/?language=en_US with detailed error information. 

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

AnuritaSaggu
Contributor
Contributor

@MTS_Chiranjeevi, thanks for your feedback. Somewhere in papal documentation, I read that NVP/SOAP API are not being maintained and the users should move to rest apis.

 

However, to make the picture clear I am elaborating more.

 

The client can send the invoices to the end users. And then can pay by logging into their respective accounts. In this method we are not capturing the payments. In our application, we have to list all the transactions which is integrated using reporting/transactions endpoint. But with this endpoint I do not get any authorize_id or capture id. 

 Basically how I can proceed with refunds using the following endpoints?

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

https://developer.paypal.com/docs/api/payments/v1/#sale_refund

https://developer.paypal.com/docs/api/payments/v1/#capture_refund 

 

And this endpoint is not accessible https://developer.paypal.com/docs/integration/direct/payments/refund-payments/

 

I appreciate your help! 

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.