Skip to content

Commit 0341b71

Browse files
committed
Make confirm call idempotent
1 parent a68901e commit 0341b71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/payments.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ func (a *API) PaymentConfirm(w http.ResponseWriter, r *http.Request) error {
253253
}
254254
}
255255

256+
if trans.Status == models.PaidState {
257+
return sendJSON(w, http.StatusOK, trans)
258+
}
259+
256260
order := &models.Order{}
257261
if rsp := a.db.Find(order, "id = ?", trans.OrderID); rsp.Error != nil {
258262
if rsp.RecordNotFound() {

0 commit comments

Comments
 (0)