Add partial refunds endpoint for captured payments #3001

Opennkamau wants to merge 2 commits into main from feature/partial-refunds· opened 2 days ago
+62−0
nkamau commented 2 days agoAuthor

Why

Support is issuing refunds by hand in the processor dashboard. Merchants want to do it from their own integration, including partial refunds.

What

  • POST /api/payments/{id}/refunds creates a refund and bumps refunded_total on the payment
  • GET /api/payments/{id}/refunds lists refunds for a payment

The payments router is mounted with ApiKeyAuth, so request.auth is the calling merchant.

Testing

Added a test for the happy path. Tried a 10.00 refund on a sandbox payment.

nkamau added 2 commits 2 days ago
Add refund schemas and endpoints9f5f110
Add refund happy path test9e5f0f7

Review required

Review the changes, then submit to get graded.

Some checks haven’t completed yet

1 check: dojo / review-grader

Keyboard shortcuts

Site-wide

Focus the search bar
/
Show this dialog
?

Pull request

Move to the next file
j
Move to the previous file
k
Filter changed files
t
Comment on the selected lines
c
Select a range of lines
Shiftclick