mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
95 lines
2.9 KiB
Go
95 lines
2.9 KiB
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
package components
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
type LegacyPaymentStatus string
|
|
|
|
const (
|
|
LegacyPaymentStatusPending LegacyPaymentStatus = "PENDING"
|
|
LegacyPaymentStatusSucceeded LegacyPaymentStatus = "SUCCEEDED"
|
|
LegacyPaymentStatusCancelled LegacyPaymentStatus = "CANCELLED"
|
|
LegacyPaymentStatusFailed LegacyPaymentStatus = "FAILED"
|
|
LegacyPaymentStatusExpired LegacyPaymentStatus = "EXPIRED"
|
|
LegacyPaymentStatusRefunded LegacyPaymentStatus = "REFUNDED"
|
|
LegacyPaymentStatusRefundedFailure LegacyPaymentStatus = "REFUNDED_FAILURE"
|
|
LegacyPaymentStatusDispute LegacyPaymentStatus = "DISPUTE"
|
|
LegacyPaymentStatusDisputeWon LegacyPaymentStatus = "DISPUTE_WON"
|
|
LegacyPaymentStatusDisputeLost LegacyPaymentStatus = "DISPUTE_LOST"
|
|
LegacyPaymentStatusOther LegacyPaymentStatus = "OTHER"
|
|
LegacyPaymentStatusWaitingForValidation LegacyPaymentStatus = "WAITING_FOR_VALIDATION"
|
|
LegacyPaymentStatusProcessing LegacyPaymentStatus = "PROCESSING"
|
|
LegacyPaymentStatusProcessed LegacyPaymentStatus = "PROCESSED"
|
|
LegacyPaymentStatusRejected LegacyPaymentStatus = "REJECTED"
|
|
LegacyPaymentStatusValidated LegacyPaymentStatus = "VALIDATED"
|
|
LegacyPaymentStatusAskRetried LegacyPaymentStatus = "ASK_RETRIED"
|
|
LegacyPaymentStatusAskReversed LegacyPaymentStatus = "ASK_REVERSED"
|
|
LegacyPaymentStatusReverseProcessing LegacyPaymentStatus = "REVERSE_PROCESSING"
|
|
LegacyPaymentStatusReverseFailed LegacyPaymentStatus = "REVERSE_FAILED"
|
|
LegacyPaymentStatusPartiallyReversed LegacyPaymentStatus = "PARTIALLY_REVERSED"
|
|
LegacyPaymentStatusReversed LegacyPaymentStatus = "REVERSED"
|
|
)
|
|
|
|
func (e LegacyPaymentStatus) ToPointer() *LegacyPaymentStatus {
|
|
return &e
|
|
}
|
|
func (e *LegacyPaymentStatus) UnmarshalJSON(data []byte) error {
|
|
var v string
|
|
if err := json.Unmarshal(data, &v); err != nil {
|
|
return err
|
|
}
|
|
switch v {
|
|
case "PENDING":
|
|
fallthrough
|
|
case "SUCCEEDED":
|
|
fallthrough
|
|
case "CANCELLED":
|
|
fallthrough
|
|
case "FAILED":
|
|
fallthrough
|
|
case "EXPIRED":
|
|
fallthrough
|
|
case "REFUNDED":
|
|
fallthrough
|
|
case "REFUNDED_FAILURE":
|
|
fallthrough
|
|
case "DISPUTE":
|
|
fallthrough
|
|
case "DISPUTE_WON":
|
|
fallthrough
|
|
case "DISPUTE_LOST":
|
|
fallthrough
|
|
case "OTHER":
|
|
fallthrough
|
|
case "WAITING_FOR_VALIDATION":
|
|
fallthrough
|
|
case "PROCESSING":
|
|
fallthrough
|
|
case "PROCESSED":
|
|
fallthrough
|
|
case "REJECTED":
|
|
fallthrough
|
|
case "VALIDATED":
|
|
fallthrough
|
|
case "ASK_RETRIED":
|
|
fallthrough
|
|
case "ASK_REVERSED":
|
|
fallthrough
|
|
case "REVERSE_PROCESSING":
|
|
fallthrough
|
|
case "REVERSE_FAILED":
|
|
fallthrough
|
|
case "PARTIALLY_REVERSED":
|
|
fallthrough
|
|
case "REVERSED":
|
|
*e = LegacyPaymentStatus(v)
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("invalid value for LegacyPaymentStatus: %v", v)
|
|
}
|
|
}
|