Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for external refunds

See original GitHub issue

Scenario: the original credit card has been deleted and the merchant wants to issue a refund by check.

Today, this can be supported by:

  • Adding an external payment method to the account and issuing a payment credit (to record the payment, i.e. the check)
  • Adjusting the balance of the invoice by issuing an invoice credit (i.e. CBA)

The main drawback of this approach is that the payment credit won’t be linked to the invoice, so the invoice credit won’t be marked as a recognizable credit in the financial reports (i.e. real money associated to the credit vs non-recognizable credit, which is credit given to nice customers for example).

One fix would be to change PaymentAutomatonRunner: when retrieving the effectivePaymentMethodId, verify if the payment method was deleted. If it has been deleted, fail the refund. The exception can be caught at the JAX-RS level, and if the right query parameter is passed, add the external payment method if needed, and trigger the payment credit against that payment method. We still need to link the payment to that invoice somehow.

For testing, we need to write an integration test for the scenario above using the test payment plugin.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

matias-aguero-hscommented, Aug 24, 2016

@pierre Thank you for your explanations.

I just pushed the refund implementation and tests for scenario 1 and 2a (with and without adjustments). I also created two PRs for you, so you can start reviewing the code.

Scenario 2b (refund on a different payment method) is still pending. It’s my next task.

pierrecommented, Aug 18, 2016

Yes, it does. It will involve more work that I’d estimated 😅

It’s a large task indeed (although I expect the bulk of the work is more in the testing than in the core, but we’ll see…), but it’s quite a useful feature (it has been requested a few times in the past already).

Should I keep this validation?

I believe that’s already taken care of: when Kill Bill will try to retrieve the payment method, it won’t find it and fail the payment. To be checked! 😼

Read more comments on GitHub >

github_iconTop Results From Across the Web

Record an External Payment Refund - Salesforce Help
Go to your payment record and click Refund. Click External. Enter the amount you want to refund. The refund must be less than...
Read more >
Solving Customer Problems: Returns, Refunds, and Other ...
These strategies and this sample complaint letter can help you get your money back or reach another resolution. Return to the Store or...
Read more >
Refund a customer : Stripe: Help & Support
From the Dashboard · Find the charge to be refunded in the Payments overview page. · Click the ••• icon to the right...
Read more >
21.4.1 Refund Research | Internal Revenue Service
Purpose: This IRM provides instructions to all Customer Service Representatives and Taxpayer Assistance Center functions who address various Refund ...
Read more >
Direct Deposit (Electronic Funds Transfer) - Tax Refund
E-file and sign up for Direct Deposit to receive your refund faster, safer, ... Will calling the IRS help me get my refund...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found