Gift withdrawal: admin refund (Stripe) and invoice storno (Billingo)
CI / test (push) Successful in 3m25s
CI / build (push) Skipped
CI / deploy (push) Skipped

- The buyer may withdraw from a gift purchase within 14 days while the
  code is not redeemed (ÁSZF 3., 5., 6.; terms version 2026-11-23); the
  consent on Stripe's page and the confirmation e-mail say so
- Admin → Ajándékok: the gifts with payment, invoice and storno; the
  refund button locks the gift and refuses a redeemed one, withdraws the
  code, refunds the PaymentIntent on Stripe (one refund per gift via the
  Idempotency-Key, retry when Stripe refuses) and queues the storno
- Worker: cancels the issued invoice in Billingo (POST /documents/{id}/
  cancel, e-mailed to the buyer), keeps the storno invoice's id and
  number; a lost answer is not asked again but left for an admin
- A withdrawn code cannot be redeemed, sent or downloaded; "My gifts"
  shows it as refunded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-23 21:22:46 +00:00
co-authored by Claude Opus 5.5
parent c90232f40c
commit 0d62888831
18 changed files with 1014 additions and 46 deletions
+4 -3
View File
@@ -375,7 +375,7 @@ fn purchase_confirmation(lang: Lang, payload: &Value, url: String) -> Result<Con
}
),
quote: Some(
"A fizetés előtt kérted a szolgáltatás azonnali megkezdését, és tudomásul vetted, hogy ezzel elveszíted a 14 napos elállási jogodat. Az ajándékkódot ennek megfelelően azonnal kiállítottuk."
"A vásárlástól számított 14 napon belül, amíg az ajándékkódot nem váltották be, elállhatsz a vásárlástól: írj az info@sorsfonalak.hu címre, és visszatérítjük az árát. A fizetés előtt kérted, hogy a kód beváltásakor a szolgáltatás azonnal megkezdődjön: a beváltással az elállási jog megszűnik."
.into(),
),
points: None,
@@ -425,7 +425,7 @@ fn purchase_confirmation(lang: Lang, payload: &Value, url: String) -> Result<Con
}
),
quote: Some(
"Before paying you asked us to start the service at once and acknowledged that you thereby lose your 14-day right of withdrawal. The gift code was issued at once accordingly."
"Within 14 days of the purchase, while the gift code is not redeemed, you may withdraw from the purchase: write to info@sorsfonalak.hu and we refund it. Before paying you asked for the service to start as soon as the code is redeemed: redeeming it ends the right of withdrawal."
.into(),
),
points: None,
@@ -1043,7 +1043,8 @@ mod tests {
assert!(
hu.text.contains("ajándékba vetted Bea részére.") && hu.text.contains("elküldtük ide: bea@example.com")
);
assert!(hu.text.contains("AJÁNDÉKKÓD: ABCD-EFGH-JKMN") && hu.text.contains("14 napos elállási jogodat"));
assert!(hu.text.contains("AJÁNDÉKKÓD: ABCD-EFGH-JKMN") && hu.text.contains("14 napon belül"));
assert!(hu.text.contains("a beváltással az elállási jog megszűnik"));
assert!(!hu.text.contains("jóváírtuk"));
payload["gift"]["recipient_email"] = Value::Null;
let hu = render("purchase_confirmation", "hu", &payload).unwrap();