-
Notifications
You must be signed in to change notification settings - Fork 44
/
charge.go
69 lines (55 loc) · 2.11 KB
/
charge.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package omise
import "time"
// Charge represents Omise's charge object.
// See https://www.omise.co/charges-api for more information.
type Charge struct {
Base
Status ChargeStatus `json:"status"`
Amount int64 `json:"amount"`
AuthorizationType AuthorizationType `json:"authorization_type"`
AuthorizedAmount int64 `json:"authorized_amount"`
CapturedAmount int64 `json:"captured_amount"`
Currency string `json:"currency"`
Description *string `json:"description"`
Capture bool `json:"capture"`
Authorized bool `json:"authorized"`
Reversed bool `json:"reversed"`
Paid bool `json:"paid"`
Transaction string `json:"transaction"`
Card *Card `json:"card"`
RefundedAmount int64 `json:"refunded_amount"`
Refunds *RefundList `json:"refunds"`
FailureCode *string `json:"failure_code"`
FailureMessage *string `json:"failure_message"`
CustomerID string `json:"customer"`
IP *string `json:"ip"`
Dispute *Dispute `json:"dispute"`
ReturnURI string `json:"return_uri"`
AuthorizeURI string `json:"authorize_uri"`
SourceOfFund SourceOfFunds `json:"source_of_fund"`
Source *Source `json:"source"`
Metadata map[string]interface{} `json:"metadata"`
ExpiresAt time.Time `json:"expires_at"`
}
type TransactionIndicator string
const (
MIT TransactionIndicator = "MIT"
CIT TransactionIndicator = "CIT"
)
type RecurringReason string
const (
Blank RecurringReason = ""
Unscheduled RecurringReason = "unscheduled"
StandingOrder RecurringReason = "standing_order"
Subscription RecurringReason = "subscription"
Installment RecurringReason = "installment"
PartialShipment RecurringReason = "partial_shipment"
DelayedCharge RecurringReason = "delayed_charge"
NoShow RecurringReason = "no_show"
Resubmission RecurringReason = "resubmission"
)
type PlatformFee struct {
Fixed int32 `json:"fixed,omitempty"`
Percentage float32 `json:"percentage,omitempty"`
Amount int64 `json:"Amount,omitempty"`
}