refund front 1

This commit is contained in:
2024-08-22 14:05:46 +02:00
parent d271e23861
commit 7635a9826f
3 changed files with 55 additions and 6 deletions

View File

@ -550,6 +550,7 @@ func (app *application) RefundCharge(w http.ResponseWriter, r *http.Request) {
err := app.readJSON(w, r, &chargeToRefund)
if err != nil {
app.errorLog.Println(err)
app.badRequest(w, r, err)
return
}
@ -564,6 +565,7 @@ func (app *application) RefundCharge(w http.ResponseWriter, r *http.Request) {
err = card.Refund(chargeToRefund.PaymentIntent, chargeToRefund.Amount)
if err != nil {
app.errorLog.Println(err)
app.badRequest(w, r, err)
return
}