Skip to content

Commit

Permalink
payment: introduce constant for duplicate idempotency key error (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
zohmi committed Apr 7, 2020
1 parent 2a1e7d8 commit 2fc8b89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
* product attributes:
* Added `AttributesByKey` domain method to filter attributes by key and exposed this method as `getAttributesByKey` in GraphQL
* GraphQL: Exposing `codeLabel` property in the `Commerce_ProductAttribute` type

**payment**
* Introduced error message for already used idempotency key

## v3.1.0
**tests**
Expand Down
12 changes: 7 additions & 5 deletions payment/domain/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@ type (
)

const (
// PaymentErrorCodeFailed error
// PaymentErrorCodeFailed error will be returned when a general error occurred
PaymentErrorCodeFailed = "failed"
// PaymentErrorCodeAuthorizeFailed error
// PaymentErrorCodeAuthorizeFailed error will be returned when the authorization failed
PaymentErrorCodeAuthorizeFailed = "authorization_failed"
// PaymentErrorCodeCaptureFailed error
// PaymentErrorCodeCaptureFailed error will be returned when capturing failed
PaymentErrorCodeCaptureFailed = "capture_failed"
// PaymentErrorAbortedByCustomer error
// PaymentErrorAbortedByCustomer error will be returned when the payment will be aborted by the customer
PaymentErrorAbortedByCustomer = "aborted_by_customer"
// PaymentErrorCodeCancelled error
// PaymentErrorCodeCancelled error will be returned when the payment will be canceled
PaymentErrorCodeCancelled = "cancelled"
// PaymentErrorDuplicateIdempotencyKey error will be returned when idempotency key already in use
PaymentErrorDuplicateIdempotencyKey = "duplicate_idempotency_key"

// PaymentFlowStatusUnapproved payment started
PaymentFlowStatusUnapproved = "payment_unapproved"
Expand Down

0 comments on commit 2fc8b89

Please sign in to comment.