-
Notifications
You must be signed in to change notification settings - Fork 12
/
modification.go
108 lines (91 loc) · 3.12 KB
/
modification.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
96
97
98
99
100
101
102
103
104
105
106
107
108
package adyen
/*********
* Cancel *
*********/
// Adjust authorisation reasons
//
// Link https://docs.adyen.com/developers/api-reference/payments-api/modificationrequest/adjustauthorisationmodificationrequest
const (
DelayedCharge = "DelayedCharge"
NoShow = "NoShow"
)
// Cancel structure for Cancel request
type Cancel struct {
Reference string `json:"reference"`
MerchantAccount string `json:"merchantAccount"`
OriginalReference string `json:"originalReference"`
}
// CancelResponse is a response structure for Adyen cancellation
type CancelResponse struct {
PspReference string `json:"pspReference"`
Response string `json:"response"`
}
// CancelOrRefundResponse is a response structure for Adyen cancelOrRefund
type CancelOrRefundResponse struct {
PspReference string `json:"pspReference"`
Response string `json:"response"`
}
/**********
* Capture *
**********/
// Capture structure for Capture request
type Capture struct {
ModificationAmount *Amount `json:"modificationAmount"`
Reference string `json:"reference"`
MerchantAccount string `json:"merchantAccount"`
OriginalReference string `json:"originalReference"`
}
// CaptureResponse is a response structure for Adyen capture
type CaptureResponse struct {
PspReference string `json:"pspReference"`
Response string `json:"response"`
}
/*********
* Refund *
*********/
// Refund structure for refund request
type Refund struct {
ModificationAmount *Amount `json:"modificationAmount"`
Reference string `json:"reference"`
MerchantAccount string `json:"merchantAccount"`
OriginalReference string `json:"originalReference"`
}
// RefundResponse is a response structure for Adyen refund request
type RefundResponse struct {
PspReference string `json:"pspReference"`
Response string `json:"response"`
}
/***********************
* Adjust Authorisation *
***********************/
// AdjustAuthorisation structure for adjusting previously authorised amount
type AdjustAuthorisation struct {
ModificationAmount *Amount `json:"modificationAmount"`
Reference string `json:"reference"`
MerchantAccount string `json:"merchantAccount"`
OriginalReference string `json:"originalReference"`
AdditionalData struct {
IndustryUsage string `json:"industryUsage"`
} `json:"additionalData,omitempty"`
}
// AdjustAuthorisationResponse is a response for AdjustAuthorisation request
type AdjustAuthorisationResponse struct {
PspReference string `json:"pspReference"`
Response string `json:"response"`
}
/******************
* Techical Cancel *
******************/
// TechnicalCancel structure for performing technical cancellation
//
// Link - https://docs.adyen.com/developers/payment-modifications#technicalcancel
type TechnicalCancel struct {
MerchantAccount string `json:"merchantAccount"`
OriginalMerchantReference string `json:"originalMerchantReference"`
Reference string `json:"reference,omitempty"`
}
// TechnicalCancelResponse is a response for TechnicalCancel request
type TechnicalCancelResponse struct {
PspReference string `json:"pspReference"`
Response string `json:"response"`
}