forked from checkout/checkout-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reconciliation.go
95 lines (84 loc) · 3.94 KB
/
reconciliation.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package reconciliation
import (
"time"
"github.com/PaddleHQ/checkout-sdk-go/common"
)
const (
reporting = "reporting"
payments = "payments"
statements = "statements"
download = "download"
)
type (
PaymentReportsQuery struct {
From *time.Time `url:"from,omitempty" layout:"2006-01-02T15:04:05Z"`
To *time.Time `url:"to,omitempty" layout:"2006-01-02T15:04:05Z"`
Reference string `url:"reference,omitempty"`
Limit int `url:"limit,omitempty"`
}
PaymentReportsResponse struct {
HttpMetadata common.HttpMetadata
Count int `json:"count,omitempty"`
Data []PaymentReportData `json:"data,omitempty"`
Links map[string]common.Link `json:"_links"`
}
PaymentReportData struct {
Id string `json:"id,omitempty"`
ProcessingCurrency common.Currency `json:"processing_currency,omitempty"`
PayoutCurrency common.Currency `json:"payout_currency,omitempty"`
RequestedOn string `json:"requested_on,omitempty"`
ChannelName string `json:"channel_name,omitempty"`
Reference string `json:"reference,omitempty"`
PaymentMethod string `json:"payment_method,omitempty"`
CardType string `json:"card_type,omitempty"`
CardCategory string `json:"card_category,omitempty"`
IssuerCountry common.Country `json:"issuer_country,omitempty"`
MerchantCountry common.Country `json:"merchant_country,omitempty"`
Mid string `json:"mid,omitempty"`
Actions []Action `json:"actions,omitempty"`
Links map[string]common.Link `json:"_links"`
}
)
type Breakdown struct {
Type string `json:"type,omitempty"`
Date string `json:"date,omitempty"`
ProcessingCurrencyAmount float64 `json:"processing_currency_amount,omitempty"`
PayoutCurrencyAmount float64 `json:"payout_currency_amount,omitempty"`
}
type Action struct {
Type string `json:"type,omitempty"`
Id string `json:"id,omitempty"`
ProcessedOn string `json:"processed_on,omitempty"`
ResponseCode string `json:"response_code,omitempty"`
ResponseDescription string `json:"response_description,omitempty"`
Breakdown []Breakdown `json:"breakdown,omitempty"`
}
type (
StatementReportsResponse struct {
HttpMetadata common.HttpMetadata
Count int `json:"count,omitempty"`
Data []StatementReportsData `json:"data,omitempty"`
Links map[string]common.Link `json:"_links"`
}
StatementReportsData struct {
Id string `json:"id,omitempty"`
PeriodStart string `json:"period_start,omitempty"`
PeriodEnd string `json:"period_end,omitempty"`
Date string `json:"date,omitempty"`
Payouts []PayoutStatement `json:"payouts,omitempty"`
Links map[string]common.Link `json:"_links"`
}
)
type PayoutStatement struct {
Id string `json:"id,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
CarriedForwardAmount float64 `json:"carried_forward_amount,omitempty"`
CurrentPeriodAmount float64 `json:"current_period_amount,omitempty"`
NetAmount float64 `json:"net_amount,omitempty"`
Date string `json:"date,omitempty"`
PeriodStart string `json:"period_start,omitempty"`
PeriodEnd string `json:"period_end,omitempty"`
Status string `json:"status,omitempty"`
PayoutFee float64 `json:"payout_fee,omitempty"`
Links map[string]common.Link `json:"_links"`
}