refund front 1
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user