Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add online payment refund #109

Open
jcgdjob opened this issue Jan 29, 2019 · 2 comments
Open

Add online payment refund #109

jcgdjob opened this issue Jan 29, 2019 · 2 comments
Labels
Help Wanted Issues needing help and clarification. RFC Discussions about potential changes or new features.
Milestone

Comments

@jcgdjob
Copy link

jcgdjob commented Jan 29, 2019

If I want to add Paypal refund, which file should I override?
Thanks!

@Zales0123 Zales0123 added Help Wanted Issues needing help and clarification. RFC Discussions about potential changes or new features. labels Jan 29, 2019
@Zales0123 Zales0123 changed the title [help wanted] Add online payment refund Add online payment refund Feb 16, 2019
@Zales0123
Copy link
Member

Hello @jcgdjob and sorry for the long response time. The limitation of possible refund payment methods is done in OfflineRefundPaymentMethodsProvider which is an implementation of RefundPaymentMethodsProviderInterface. You should implement your own service with this interface and inject it to RefundUnitsAction.

But it is the easy part, as it's only a select options display :) To handle the refund process from the Paypal perspective, you would also have to listen on some event (probably UnitsRefunded, but it all depends on your approach) and hook into the Paypal refund process. Probably some customization of event class would also be necessary to include some more detail required by payment gateway... It's quite a complicated case, as there are lot's of things that can go wrong, that's also one of the reasons we decided to support only offline refunds (at least for now, but for sure it won't change before a 1.0 release).

Nevertheless, good luck, if you find some elegant solution for this case it would be great if you want to share it :) 🖖

@Zales0123 Zales0123 added this to the v1.1.0 milestone Jun 26, 2019
@tuala
Copy link

tuala commented Feb 17, 2020

I went with a console command that will be triggered by cron job, get refunds payments according to state, calls its linked gateway's Refund Action (which you may have to implement yourself) and transitions the refund payment to completed if it succeeded. It is a little too specific to the single customized gateway the project is using to be of much help but I think that's the easiest to implement right now, at least for my use case (Stripe v3 w/ recurring payments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Issues needing help and clarification. RFC Discussions about potential changes or new features.
Projects
None yet
Development

No branches or pull requests

3 participants