-
Notifications
You must be signed in to change notification settings - Fork 27
/
model_payout_response.go
503 lines (428 loc) · 17.5 KB
/
model_payout_response.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
/*
Adyen Payout API
API version: 68
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package payout
import (
"encoding/json"
"github.com/adyen/adyen-go-api-library/v8/src/common"
)
// checks if the PayoutResponse type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &PayoutResponse{}
// PayoutResponse struct for PayoutResponse
type PayoutResponse struct {
// Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.
AdditionalData *map[string]string `json:"additionalData,omitempty"`
// Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty.
AuthCode *string `json:"authCode,omitempty"`
DccAmount *Amount `json:"dccAmount,omitempty"`
// Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://www.adyen.help/hc/en-us/requests/new).
DccSignature *string `json:"dccSignature,omitempty"`
FraudResult *FraudResult `json:"fraudResult,omitempty"`
// The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL.
IssuerUrl *string `json:"issuerUrl,omitempty"`
// The payment session.
Md *string `json:"md,omitempty"`
// The 3D request data for the issuer. If the value is **CUPSecurePlus-CollectSMSVerificationCode**, collect an SMS code from the shopper and pass it in the `/authorise3D` request. For more information, see [3D Secure](https://docs.adyen.com/classic-integration/3d-secure).
PaRequest *string `json:"paRequest,omitempty"`
// Adyen's 16-character reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.
PspReference *string `json:"pspReference,omitempty"`
// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
RefusalReason *string `json:"refusalReason,omitempty"`
// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.
ResultCode *string `json:"resultCode,omitempty"`
}
// NewPayoutResponse instantiates a new PayoutResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPayoutResponse() *PayoutResponse {
this := PayoutResponse{}
return &this
}
// NewPayoutResponseWithDefaults instantiates a new PayoutResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPayoutResponseWithDefaults() *PayoutResponse {
this := PayoutResponse{}
return &this
}
// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise.
func (o *PayoutResponse) GetAdditionalData() map[string]string {
if o == nil || common.IsNil(o.AdditionalData) {
var ret map[string]string
return ret
}
return *o.AdditionalData
}
// GetAdditionalDataOk returns a tuple with the AdditionalData field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetAdditionalDataOk() (*map[string]string, bool) {
if o == nil || common.IsNil(o.AdditionalData) {
return nil, false
}
return o.AdditionalData, true
}
// HasAdditionalData returns a boolean if a field has been set.
func (o *PayoutResponse) HasAdditionalData() bool {
if o != nil && !common.IsNil(o.AdditionalData) {
return true
}
return false
}
// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field.
func (o *PayoutResponse) SetAdditionalData(v map[string]string) {
o.AdditionalData = &v
}
// GetAuthCode returns the AuthCode field value if set, zero value otherwise.
func (o *PayoutResponse) GetAuthCode() string {
if o == nil || common.IsNil(o.AuthCode) {
var ret string
return ret
}
return *o.AuthCode
}
// GetAuthCodeOk returns a tuple with the AuthCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetAuthCodeOk() (*string, bool) {
if o == nil || common.IsNil(o.AuthCode) {
return nil, false
}
return o.AuthCode, true
}
// HasAuthCode returns a boolean if a field has been set.
func (o *PayoutResponse) HasAuthCode() bool {
if o != nil && !common.IsNil(o.AuthCode) {
return true
}
return false
}
// SetAuthCode gets a reference to the given string and assigns it to the AuthCode field.
func (o *PayoutResponse) SetAuthCode(v string) {
o.AuthCode = &v
}
// GetDccAmount returns the DccAmount field value if set, zero value otherwise.
func (o *PayoutResponse) GetDccAmount() Amount {
if o == nil || common.IsNil(o.DccAmount) {
var ret Amount
return ret
}
return *o.DccAmount
}
// GetDccAmountOk returns a tuple with the DccAmount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetDccAmountOk() (*Amount, bool) {
if o == nil || common.IsNil(o.DccAmount) {
return nil, false
}
return o.DccAmount, true
}
// HasDccAmount returns a boolean if a field has been set.
func (o *PayoutResponse) HasDccAmount() bool {
if o != nil && !common.IsNil(o.DccAmount) {
return true
}
return false
}
// SetDccAmount gets a reference to the given Amount and assigns it to the DccAmount field.
func (o *PayoutResponse) SetDccAmount(v Amount) {
o.DccAmount = &v
}
// GetDccSignature returns the DccSignature field value if set, zero value otherwise.
func (o *PayoutResponse) GetDccSignature() string {
if o == nil || common.IsNil(o.DccSignature) {
var ret string
return ret
}
return *o.DccSignature
}
// GetDccSignatureOk returns a tuple with the DccSignature field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetDccSignatureOk() (*string, bool) {
if o == nil || common.IsNil(o.DccSignature) {
return nil, false
}
return o.DccSignature, true
}
// HasDccSignature returns a boolean if a field has been set.
func (o *PayoutResponse) HasDccSignature() bool {
if o != nil && !common.IsNil(o.DccSignature) {
return true
}
return false
}
// SetDccSignature gets a reference to the given string and assigns it to the DccSignature field.
func (o *PayoutResponse) SetDccSignature(v string) {
o.DccSignature = &v
}
// GetFraudResult returns the FraudResult field value if set, zero value otherwise.
func (o *PayoutResponse) GetFraudResult() FraudResult {
if o == nil || common.IsNil(o.FraudResult) {
var ret FraudResult
return ret
}
return *o.FraudResult
}
// GetFraudResultOk returns a tuple with the FraudResult field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetFraudResultOk() (*FraudResult, bool) {
if o == nil || common.IsNil(o.FraudResult) {
return nil, false
}
return o.FraudResult, true
}
// HasFraudResult returns a boolean if a field has been set.
func (o *PayoutResponse) HasFraudResult() bool {
if o != nil && !common.IsNil(o.FraudResult) {
return true
}
return false
}
// SetFraudResult gets a reference to the given FraudResult and assigns it to the FraudResult field.
func (o *PayoutResponse) SetFraudResult(v FraudResult) {
o.FraudResult = &v
}
// GetIssuerUrl returns the IssuerUrl field value if set, zero value otherwise.
func (o *PayoutResponse) GetIssuerUrl() string {
if o == nil || common.IsNil(o.IssuerUrl) {
var ret string
return ret
}
return *o.IssuerUrl
}
// GetIssuerUrlOk returns a tuple with the IssuerUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetIssuerUrlOk() (*string, bool) {
if o == nil || common.IsNil(o.IssuerUrl) {
return nil, false
}
return o.IssuerUrl, true
}
// HasIssuerUrl returns a boolean if a field has been set.
func (o *PayoutResponse) HasIssuerUrl() bool {
if o != nil && !common.IsNil(o.IssuerUrl) {
return true
}
return false
}
// SetIssuerUrl gets a reference to the given string and assigns it to the IssuerUrl field.
func (o *PayoutResponse) SetIssuerUrl(v string) {
o.IssuerUrl = &v
}
// GetMd returns the Md field value if set, zero value otherwise.
func (o *PayoutResponse) GetMd() string {
if o == nil || common.IsNil(o.Md) {
var ret string
return ret
}
return *o.Md
}
// GetMdOk returns a tuple with the Md field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetMdOk() (*string, bool) {
if o == nil || common.IsNil(o.Md) {
return nil, false
}
return o.Md, true
}
// HasMd returns a boolean if a field has been set.
func (o *PayoutResponse) HasMd() bool {
if o != nil && !common.IsNil(o.Md) {
return true
}
return false
}
// SetMd gets a reference to the given string and assigns it to the Md field.
func (o *PayoutResponse) SetMd(v string) {
o.Md = &v
}
// GetPaRequest returns the PaRequest field value if set, zero value otherwise.
func (o *PayoutResponse) GetPaRequest() string {
if o == nil || common.IsNil(o.PaRequest) {
var ret string
return ret
}
return *o.PaRequest
}
// GetPaRequestOk returns a tuple with the PaRequest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetPaRequestOk() (*string, bool) {
if o == nil || common.IsNil(o.PaRequest) {
return nil, false
}
return o.PaRequest, true
}
// HasPaRequest returns a boolean if a field has been set.
func (o *PayoutResponse) HasPaRequest() bool {
if o != nil && !common.IsNil(o.PaRequest) {
return true
}
return false
}
// SetPaRequest gets a reference to the given string and assigns it to the PaRequest field.
func (o *PayoutResponse) SetPaRequest(v string) {
o.PaRequest = &v
}
// GetPspReference returns the PspReference field value if set, zero value otherwise.
func (o *PayoutResponse) GetPspReference() string {
if o == nil || common.IsNil(o.PspReference) {
var ret string
return ret
}
return *o.PspReference
}
// GetPspReferenceOk returns a tuple with the PspReference field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetPspReferenceOk() (*string, bool) {
if o == nil || common.IsNil(o.PspReference) {
return nil, false
}
return o.PspReference, true
}
// HasPspReference returns a boolean if a field has been set.
func (o *PayoutResponse) HasPspReference() bool {
if o != nil && !common.IsNil(o.PspReference) {
return true
}
return false
}
// SetPspReference gets a reference to the given string and assigns it to the PspReference field.
func (o *PayoutResponse) SetPspReference(v string) {
o.PspReference = &v
}
// GetRefusalReason returns the RefusalReason field value if set, zero value otherwise.
func (o *PayoutResponse) GetRefusalReason() string {
if o == nil || common.IsNil(o.RefusalReason) {
var ret string
return ret
}
return *o.RefusalReason
}
// GetRefusalReasonOk returns a tuple with the RefusalReason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetRefusalReasonOk() (*string, bool) {
if o == nil || common.IsNil(o.RefusalReason) {
return nil, false
}
return o.RefusalReason, true
}
// HasRefusalReason returns a boolean if a field has been set.
func (o *PayoutResponse) HasRefusalReason() bool {
if o != nil && !common.IsNil(o.RefusalReason) {
return true
}
return false
}
// SetRefusalReason gets a reference to the given string and assigns it to the RefusalReason field.
func (o *PayoutResponse) SetRefusalReason(v string) {
o.RefusalReason = &v
}
// GetResultCode returns the ResultCode field value if set, zero value otherwise.
func (o *PayoutResponse) GetResultCode() string {
if o == nil || common.IsNil(o.ResultCode) {
var ret string
return ret
}
return *o.ResultCode
}
// GetResultCodeOk returns a tuple with the ResultCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PayoutResponse) GetResultCodeOk() (*string, bool) {
if o == nil || common.IsNil(o.ResultCode) {
return nil, false
}
return o.ResultCode, true
}
// HasResultCode returns a boolean if a field has been set.
func (o *PayoutResponse) HasResultCode() bool {
if o != nil && !common.IsNil(o.ResultCode) {
return true
}
return false
}
// SetResultCode gets a reference to the given string and assigns it to the ResultCode field.
func (o *PayoutResponse) SetResultCode(v string) {
o.ResultCode = &v
}
func (o PayoutResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PayoutResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !common.IsNil(o.AdditionalData) {
toSerialize["additionalData"] = o.AdditionalData
}
if !common.IsNil(o.AuthCode) {
toSerialize["authCode"] = o.AuthCode
}
if !common.IsNil(o.DccAmount) {
toSerialize["dccAmount"] = o.DccAmount
}
if !common.IsNil(o.DccSignature) {
toSerialize["dccSignature"] = o.DccSignature
}
if !common.IsNil(o.FraudResult) {
toSerialize["fraudResult"] = o.FraudResult
}
if !common.IsNil(o.IssuerUrl) {
toSerialize["issuerUrl"] = o.IssuerUrl
}
if !common.IsNil(o.Md) {
toSerialize["md"] = o.Md
}
if !common.IsNil(o.PaRequest) {
toSerialize["paRequest"] = o.PaRequest
}
if !common.IsNil(o.PspReference) {
toSerialize["pspReference"] = o.PspReference
}
if !common.IsNil(o.RefusalReason) {
toSerialize["refusalReason"] = o.RefusalReason
}
if !common.IsNil(o.ResultCode) {
toSerialize["resultCode"] = o.ResultCode
}
return toSerialize, nil
}
type NullablePayoutResponse struct {
value *PayoutResponse
isSet bool
}
func (v NullablePayoutResponse) Get() *PayoutResponse {
return v.value
}
func (v *NullablePayoutResponse) Set(val *PayoutResponse) {
v.value = val
v.isSet = true
}
func (v NullablePayoutResponse) IsSet() bool {
return v.isSet
}
func (v *NullablePayoutResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePayoutResponse(val *PayoutResponse) *NullablePayoutResponse {
return &NullablePayoutResponse{value: val, isSet: true}
}
func (v NullablePayoutResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePayoutResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
func (o *PayoutResponse) isValidResultCode() bool {
var allowedEnumValues = []string{"AuthenticationFinished", "AuthenticationNotRequired", "Authorised", "Cancelled", "ChallengeShopper", "Error", "IdentifyShopper", "PartiallyAuthorised", "Pending", "PresentToShopper", "Received", "RedirectShopper", "Refused", "Success"}
for _, allowed := range allowedEnumValues {
if o.GetResultCode() == allowed {
return true
}
}
return false
}