refund/void/credit (and auth/capture) are unimplemented stubs that silently return CANCELED

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
33/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
java
Domain
payments

Research direction

Stubs live in src/main/java/org/killbill/billing/plugin/gocardless/GoCardlessPaymentPluginApi.java (authorize L72, capture L82, void L219, credit L230, refund L241). Read purchasePayment first to see how the GoCardless payment id is stored (first payment reference plus paymentId plugin property); refund and credit then use the pinned SDK's RefundService, void the pending_submission cancel action. authorize/capture should raise PaymentPluginApiException rather than return CANCELED. See #43 for asynchronous refund state and the existing tests for expectations.

Written by the indexing model from the issue text.

Description

Problem

Five of the seven PaymentPluginApi transaction methods are stubs. They ignore their arguments, never call GoCardless, and unconditionally return PaymentPluginStatus.CANCELED:

Method Line
authorizePayment L72
capturePayment L82
voidPayment L219
creditPayment L230
refundPayment L241

Only purchasePayment talks to the gateway.

Why this matters

Refunds are the significant gap. GoCardless supports refunds against a collected payment (POST /refunds), and the pinned SDK already exposes RefundService. Today a refund issued in Kill Bill silently reports CANCELED while no money moves — the operator gets no error telling them the operation was not performed, and Kill Bill and GoCardless diverge. Any real deployment needs refunds.

Credit maps naturally onto the same RefundService, or onto a payout depending on the semantics wanted.

Void has no meaningful equivalent once a collection is submitted, but a GoCardless payment in pending_submission can be cancelled (POST /payments/:id/actions/cancel), which is the closest analogue and is worth wiring up.

Auth/capture genuinely does not exist in bank debit schemes — there is no authorization hold. These two should stay unimplemented, but should say so explicitly.

Proposed work

  1. Implement refundPayment against RefundService, resolving the GoCardless payment id from the transaction (it is already stored — purchasePayment writes it as the first payment reference and as a paymentId plugin property).
  2. Implement creditPayment, deciding explicitly whether it maps to a refund or a payout.
  3. Implement voidPayment as a payment cancellation, valid only while the payment has not yet been submitted; return a clean error otherwise.
  4. For authorizePayment / capturePayment, throw PaymentPluginApiException stating the operation is not supported by bank debit schemes, rather than silently returning CANCELED.

Point 4 applies to all of them: a stub that reports CANCELED is indistinguishable from a genuine gateway-side cancellation. Unsupported operations should be loud.

Note that refund state is asynchronous too, so this overlaps with #43 — a refund is not final when the API call returns.

Dominant language
Java
Stars
4
Forks
7
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from killbill/killbill-gocardless-plugin

All issues in killbill/killbill-gocardless-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.