|
1
|
|
|
package neero |
|
2
|
|
|
|
|
3
|
|
|
// PaymentMethodType represents the type of payment method. |
|
4
|
|
|
type PaymentMethodType string |
|
5
|
|
|
|
|
6
|
|
|
const ( |
|
7
|
|
|
// PaymentMethodTypeMobileMoney represents the mobile money payment method type. |
|
8
|
|
|
PaymentMethodTypeMobileMoney = PaymentMethodType("MOBILE_MONEY") |
|
9
|
|
|
|
|
10
|
|
|
// PaymentMethodTypeNeroMerchant represents the neero merchant payment method type. |
|
11
|
|
|
PaymentMethodTypeNeroMerchant = PaymentMethodType("NEERO_MERCHANT") |
|
12
|
|
|
) |
|
13
|
|
|
|
|
14
|
|
|
// MobileMoneyProvider represents the mobile money provider. |
|
15
|
|
|
type MobileMoneyProvider string |
|
16
|
|
|
|
|
17
|
|
|
const ( |
|
18
|
|
|
// MobileMoneyProviderMTNMoney represents the MTN mobile money provider. |
|
19
|
|
|
MobileMoneyProviderMTNMoney = MobileMoneyProvider("MTN_MONEY") |
|
20
|
|
|
|
|
21
|
|
|
// MobileMoneyProviderOrangeMoney represents the orange money provider. |
|
22
|
|
|
MobileMoneyProviderOrangeMoney = MobileMoneyProvider("ORANGE_MONEY") |
|
23
|
|
|
) |
|
24
|
|
|
|
|
25
|
|
|
// PaymentMethodAttribute represents the attribute of the payment method. |
|
26
|
|
|
type PaymentMethodAttribute string |
|
27
|
|
|
|
|
28
|
|
|
const ( |
|
29
|
|
|
// paymentMethodAttributeMobileMoney represents the mobile money payment method attribute. |
|
30
|
|
|
paymentMethodAttributeMobileMoney = PaymentMethodAttribute("mobileMoneyDetails") |
|
31
|
|
|
) |
|
32
|
|
|
|
|
33
|
|
|
// CreatePaymentMethodRequest represents a request to create a payment method. |
|
34
|
|
|
type CreatePaymentMethodRequest interface { |
|
35
|
|
|
// Type returns the payment method type. |
|
36
|
|
|
Type() PaymentMethodType |
|
37
|
|
|
|
|
38
|
|
|
// Attribute returns the payment method attribute. |
|
39
|
|
|
Attribute() PaymentMethodAttribute |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
// CreatePaymentMethodResponse represents the response from creating a payment method. |
|
43
|
|
|
type CreatePaymentMethodResponse struct { |
|
44
|
|
|
CreatedAt string `json:"createdAt"` |
|
45
|
|
|
UpdatedAt string `json:"updatedAt"` |
|
46
|
|
|
ID string `json:"id"` |
|
47
|
|
|
Metadata any `json:"metadata"` |
|
48
|
|
|
OperatorDetails *CreatePaymentMethodResponseOperatorDetails `json:"operatorDetails"` |
|
49
|
|
|
Active bool `json:"active"` |
|
50
|
|
|
Type string `json:"type"` |
|
51
|
|
|
WalletTypeProductName string `json:"walletTypeProductName"` |
|
52
|
|
|
MobileMoneyDetails *CreatePaymentMethodResponseMobileMoneyDetails `json:"mobileMoneyDetails"` |
|
53
|
|
|
NeeroPersonDetails *CreatePaymentMethodResponseNeeroPersonDetails `json:"neeroPersonDetails"` |
|
54
|
|
|
NeeroMerchantDetails *CreatePaymentMethodResponseNeeroMerchantDetails `json:"neeroMerchantDetails"` |
|
55
|
|
|
PaypalDetails *CreatePaymentMethodResponsePaypalDetails `json:"paypalDetails"` |
|
56
|
|
|
ShortInfo string `json:"shortInfo"` |
|
57
|
|
|
WalletID any `json:"walletId"` |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
// ResolvePaymentMethodDetailsResponse represents the response from resolving payment method details. |
|
61
|
|
|
type ResolvePaymentMethodDetailsResponse struct { |
|
62
|
|
|
Name string `json:"name"` |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
// CreatePaymentMethodResponseOperatorDetails represents the operator details in the payment method response. |
|
66
|
|
|
type CreatePaymentMethodResponseOperatorDetails struct { |
|
67
|
|
|
OperatorID any `json:"operatorId"` |
|
68
|
|
|
MerchantKey string `json:"merchantKey"` |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
// CreatePaymentMethodResponseMobileMoneyDetails represents the mobile money details in the payment method response. |
|
72
|
|
|
type CreatePaymentMethodResponseMobileMoneyDetails struct { |
|
73
|
|
|
CountryCode string `json:"countryCode"` |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
// CreatePaymentMethodResponseNeeroPersonDetails represents the neero person details in the payment method response. |
|
77
|
|
|
type CreatePaymentMethodResponseNeeroPersonDetails struct { |
|
78
|
|
|
PersonID any `json:"personId"` |
|
79
|
|
|
AccountID string `json:"accountId"` |
|
80
|
|
|
Country string `json:"country"` |
|
81
|
|
|
PaymentRequestID any `json:"paymentRequestId"` |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
// CreatePaymentMethodResponseNeeroMerchantDetails represents the neero merchant details in the payment method response. |
|
85
|
|
|
type CreatePaymentMethodResponseNeeroMerchantDetails struct { |
|
86
|
|
|
MerchantKey string `json:"merchantKey"` |
|
87
|
|
|
StoreID string `json:"storeId"` |
|
88
|
|
|
BalanceID string `json:"balanceId"` |
|
89
|
|
|
OperatorID any `json:"operatorId"` |
|
90
|
|
|
Country string `json:"country"` |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
// CreatePaymentMethodResponsePaypalDetails represents the PayPal details in the payment method response. |
|
94
|
|
|
type CreatePaymentMethodResponsePaypalDetails struct { |
|
95
|
|
|
Email string `json:"email"` |
|
96
|
|
|
CountryCode string `json:"countryCode"` |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
// CreatePaymentMethodRequestMobileMoneyDetails represents the details for creating a mobile money payment method. |
|
100
|
|
|
type CreatePaymentMethodRequestMobileMoneyDetails struct { |
|
101
|
|
|
PhoneNumber string `json:"phoneNumber"` |
|
102
|
|
|
CountryIso string `json:"countryIso"` |
|
103
|
|
|
MobileMoneyProvider MobileMoneyProvider `json:"mobileMoneyProvider"` |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
// Type returns the payment method type. |
|
107
|
|
|
func (c *CreatePaymentMethodRequestMobileMoneyDetails) Type() PaymentMethodType { |
|
108
|
|
|
return PaymentMethodTypeMobileMoney |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
// Attribute returns the payment method attribute. |
|
112
|
|
|
func (c *CreatePaymentMethodRequestMobileMoneyDetails) Attribute() PaymentMethodAttribute { |
|
113
|
|
|
return paymentMethodAttributeMobileMoney |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
// CreatePaymentMethodRequestNeroMerchantDetails represents the details for creating a neero merchant payment method. |
|
117
|
|
|
type CreatePaymentMethodRequestNeroMerchantDetails struct { |
|
118
|
|
|
MerchantKey string `json:"merchantKey"` |
|
119
|
|
|
StoreID string `json:"storeId"` |
|
120
|
|
|
BalanceID string `json:"balanceId"` |
|
121
|
|
|
OperatorID string `json:"operatorId"` |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
// Type returns the payment method type. |
|
125
|
|
|
func (c *CreatePaymentMethodRequestNeroMerchantDetails) Type() PaymentMethodType { |
|
126
|
|
|
return PaymentMethodTypeNeroMerchant |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
// Attribute returns the payment method attribute. |
|
130
|
|
|
func (c *CreatePaymentMethodRequestNeroMerchantDetails) Attribute() PaymentMethodAttribute { |
|
131
|
|
|
return "neeroMerchantDetails" |
|
132
|
|
|
} |
|
133
|
|
|
|