-
Notifications
You must be signed in to change notification settings - Fork 1
/
threedsauthentication.go
864 lines (765 loc) · 46.7 KB
/
threedsauthentication.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
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package lithic
import (
"context"
"fmt"
"net/http"
"time"
"github.com/lithic-com/lithic-go/internal/apijson"
"github.com/lithic-com/lithic-go/internal/param"
"github.com/lithic-com/lithic-go/internal/requestconfig"
"github.com/lithic-com/lithic-go/option"
)
// ThreeDSAuthenticationService contains methods and other services that help with
// interacting with the lithic API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewThreeDSAuthenticationService] method instead.
type ThreeDSAuthenticationService struct {
Options []option.RequestOption
}
// NewThreeDSAuthenticationService generates a new service that applies the given
// options to each request. These options are applied after the parent client's
// options (if there is one), and before any request-specific options.
func NewThreeDSAuthenticationService(opts ...option.RequestOption) (r *ThreeDSAuthenticationService) {
r = &ThreeDSAuthenticationService{}
r.Options = opts
return
}
// Get 3DS Authentication by token
func (r *ThreeDSAuthenticationService) Get(ctx context.Context, threeDSAuthenticationToken string, opts ...option.RequestOption) (res *ThreeDSAuthenticationGetResponse, err error) {
opts = append(r.Options[:], opts...)
path := fmt.Sprintf("three_ds_authentication/%s", threeDSAuthenticationToken)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}
// Simulates a 3DS authentication request from the payment network as if it came
// from an ACS. If you're configured for 3DS Customer Decisioning, simulating
// authentications requires your customer decisioning endpoint to be set up
// properly (respond with a valid JSON).
func (r *ThreeDSAuthenticationService) Simulate(ctx context.Context, body ThreeDSAuthenticationSimulateParams, opts ...option.RequestOption) (res *ThreeDSAuthenticationSimulateResponse, err error) {
opts = append(r.Options[:], opts...)
path := "three_ds_authentication/simulate"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
type ThreeDSAuthenticationGetResponse struct {
// Globally unique identifier for the 3DS authentication.
Token string `json:"token,required" format:"uuid"`
// Type of account/card that is being used for the transaction. Maps to EMV 3DS
// field acctType.
AccountType ThreeDSAuthenticationGetResponseAccountType `json:"account_type,required,nullable"`
// Indicates the outcome of the 3DS authentication process.
AuthenticationResult ThreeDSAuthenticationGetResponseAuthenticationResult `json:"authentication_result,required,nullable"`
// Indicates whether the expiration date provided by the cardholder during checkout
// matches Lithic's record of the card's expiration date.
CardExpiryCheck ThreeDSAuthenticationGetResponseCardExpiryCheck `json:"card_expiry_check,required"`
// Globally unique identifier for the card on which the 3DS authentication has
// occurred.
CardToken string `json:"card_token,required" format:"uuid"`
// Object containing data about the cardholder provided during the transaction.
Cardholder ThreeDSAuthenticationGetResponseCardholder `json:"cardholder,required"`
// Channel in which the authentication occurs. Maps to EMV 3DS field deviceChannel.
Channel ThreeDSAuthenticationGetResponseChannel `json:"channel,required"`
// Date and time when the authentication was created in Lithic's system.
Created time.Time `json:"created,required" format:"date-time"`
// Entity that made the authentication decision.
DecisionMadeBy ThreeDSAuthenticationGetResponseDecisionMadeBy `json:"decision_made_by,required,nullable"`
// Object containing data about the merchant involved in the e-commerce
// transaction.
Merchant ThreeDSAuthenticationGetResponseMerchant `json:"merchant,required"`
// Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For
// NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not
// populated.
MessageCategory ThreeDSAuthenticationGetResponseMessageCategory `json:"message_category,required"`
// Object containing additional data about the 3DS request that is beyond the EMV
// 3DS standard spec (e.g., specific fields that only certain card networks send
// but are not required across all 3DS requests).
AdditionalData ThreeDSAuthenticationGetResponseAdditionalData `json:"additional_data,nullable"`
// Object containing data about the app used in the e-commerce transaction. Present
// if the channel is 'APP_BASED'.
App ThreeDSAuthenticationGetResponseApp `json:"app"`
// Type of authentication request - i.e., the type of transaction or interaction is
// causing the merchant to request an authentication. Maps to EMV 3DS field
// threeDSRequestorAuthenticationInd.
AuthenticationRequestType ThreeDSAuthenticationGetResponseAuthenticationRequestType `json:"authentication_request_type,nullable"`
// Object containing data about the browser used in the e-commerce transaction.
// Present if the channel is 'BROWSER'.
Browser ThreeDSAuthenticationGetResponseBrowser `json:"browser"`
// Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that
// takes place at the initiation of the merchant rather than the cardholder. The
// most common example of this is where a merchant is authenticating before billing
// for a recurring transaction such as a pay TV subscription or a utility bill.
// Maps to EMV 3DS field threeRIInd.
ThreeRiRequestType ThreeDSAuthenticationGetResponseThreeRiRequestType `json:"three_ri_request_type,nullable"`
// Object containing data about the e-commerce transaction for which the merchant
// is requesting authentication.
Transaction ThreeDSAuthenticationGetResponseTransaction `json:"transaction,nullable"`
JSON threeDSAuthenticationGetResponseJSON `json:"-"`
}
// threeDSAuthenticationGetResponseJSON contains the JSON metadata for the struct
// [ThreeDSAuthenticationGetResponse]
type threeDSAuthenticationGetResponseJSON struct {
Token apijson.Field
AccountType apijson.Field
AuthenticationResult apijson.Field
CardExpiryCheck apijson.Field
CardToken apijson.Field
Cardholder apijson.Field
Channel apijson.Field
Created apijson.Field
DecisionMadeBy apijson.Field
Merchant apijson.Field
MessageCategory apijson.Field
AdditionalData apijson.Field
App apijson.Field
AuthenticationRequestType apijson.Field
Browser apijson.Field
ThreeRiRequestType apijson.Field
Transaction apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseJSON) RawJSON() string {
return r.raw
}
// Type of account/card that is being used for the transaction. Maps to EMV 3DS
// field acctType.
type ThreeDSAuthenticationGetResponseAccountType string
const (
ThreeDSAuthenticationGetResponseAccountTypeCredit ThreeDSAuthenticationGetResponseAccountType = "CREDIT"
ThreeDSAuthenticationGetResponseAccountTypeDebit ThreeDSAuthenticationGetResponseAccountType = "DEBIT"
ThreeDSAuthenticationGetResponseAccountTypeNotApplicable ThreeDSAuthenticationGetResponseAccountType = "NOT_APPLICABLE"
)
func (r ThreeDSAuthenticationGetResponseAccountType) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseAccountTypeCredit, ThreeDSAuthenticationGetResponseAccountTypeDebit, ThreeDSAuthenticationGetResponseAccountTypeNotApplicable:
return true
}
return false
}
// Indicates the outcome of the 3DS authentication process.
type ThreeDSAuthenticationGetResponseAuthenticationResult string
const (
ThreeDSAuthenticationGetResponseAuthenticationResultDecline ThreeDSAuthenticationGetResponseAuthenticationResult = "DECLINE"
ThreeDSAuthenticationGetResponseAuthenticationResultSuccess ThreeDSAuthenticationGetResponseAuthenticationResult = "SUCCESS"
)
func (r ThreeDSAuthenticationGetResponseAuthenticationResult) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseAuthenticationResultDecline, ThreeDSAuthenticationGetResponseAuthenticationResultSuccess:
return true
}
return false
}
// Indicates whether the expiration date provided by the cardholder during checkout
// matches Lithic's record of the card's expiration date.
type ThreeDSAuthenticationGetResponseCardExpiryCheck string
const (
ThreeDSAuthenticationGetResponseCardExpiryCheckMatch ThreeDSAuthenticationGetResponseCardExpiryCheck = "MATCH"
ThreeDSAuthenticationGetResponseCardExpiryCheckMismatch ThreeDSAuthenticationGetResponseCardExpiryCheck = "MISMATCH"
ThreeDSAuthenticationGetResponseCardExpiryCheckNotPresent ThreeDSAuthenticationGetResponseCardExpiryCheck = "NOT_PRESENT"
)
func (r ThreeDSAuthenticationGetResponseCardExpiryCheck) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseCardExpiryCheckMatch, ThreeDSAuthenticationGetResponseCardExpiryCheckMismatch, ThreeDSAuthenticationGetResponseCardExpiryCheckNotPresent:
return true
}
return false
}
// Object containing data about the cardholder provided during the transaction.
type ThreeDSAuthenticationGetResponseCardholder struct {
// Indicates whether the shipping address and billing address provided by the
// cardholder are the same. This value - and assessment of whether the addresses
// match - is provided directly in the 3DS request and is not determined by Lithic.
// Maps to EMV 3DS field addrMatch.
AddressMatch bool `json:"address_match,nullable"`
// Object containing data on the billing address provided during the transaction.
BillingAddress ThreeDSAuthenticationGetResponseCardholderBillingAddress `json:"billing_address"`
// Email address that is either provided by the cardholder or is on file with the
// merchant in a 3RI request. Maps to EMV 3DS field email.
Email string `json:"email,nullable"`
// Name of the cardholder. Maps to EMV 3DS field cardholderName.
Name string `json:"name,nullable"`
// Home phone number provided by the cardholder. Maps to EMV 3DS fields
// homePhone.cc and homePhone.subscriber.
PhoneNumberHome string `json:"phone_number_home,nullable"`
// Mobile/cell phone number provided by the cardholder. Maps to EMV 3DS fields
// mobilePhone.cc and mobilePhone.subscriber.
PhoneNumberMobile string `json:"phone_number_mobile,nullable"`
// Work phone number provided by the cardholder. Maps to EMV 3DS fields
// workPhone.cc and workPhone.subscriber.
PhoneNumberWork string `json:"phone_number_work,nullable"`
// Object containing data on the shipping address provided during the transaction.
ShippingAddress ThreeDSAuthenticationGetResponseCardholderShippingAddress `json:"shipping_address"`
JSON threeDSAuthenticationGetResponseCardholderJSON `json:"-"`
}
// threeDSAuthenticationGetResponseCardholderJSON contains the JSON metadata for
// the struct [ThreeDSAuthenticationGetResponseCardholder]
type threeDSAuthenticationGetResponseCardholderJSON struct {
AddressMatch apijson.Field
BillingAddress apijson.Field
Email apijson.Field
Name apijson.Field
PhoneNumberHome apijson.Field
PhoneNumberMobile apijson.Field
PhoneNumberWork apijson.Field
ShippingAddress apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseCardholder) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseCardholderJSON) RawJSON() string {
return r.raw
}
// Object containing data on the billing address provided during the transaction.
type ThreeDSAuthenticationGetResponseCardholderBillingAddress struct {
// First line of the street address provided by the cardholder.
Address1 string `json:"address1,nullable"`
// Second line of the street address provided by the cardholder.
Address2 string `json:"address2,nullable"`
// Third line of the street address provided by the cardholder.
Address3 string `json:"address3,nullable"`
// City of the address provided by the cardholder.
City string `json:"city,nullable"`
// Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format
// (e.g. USA)
Country string `json:"country,nullable"`
// Postal code (e.g., ZIP code) of the address provided by the cardholder
PostalCode string `json:"postal_code,nullable"`
JSON threeDSAuthenticationGetResponseCardholderBillingAddressJSON `json:"-"`
}
// threeDSAuthenticationGetResponseCardholderBillingAddressJSON contains the JSON
// metadata for the struct
// [ThreeDSAuthenticationGetResponseCardholderBillingAddress]
type threeDSAuthenticationGetResponseCardholderBillingAddressJSON struct {
Address1 apijson.Field
Address2 apijson.Field
Address3 apijson.Field
City apijson.Field
Country apijson.Field
PostalCode apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseCardholderBillingAddress) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseCardholderBillingAddressJSON) RawJSON() string {
return r.raw
}
// Object containing data on the shipping address provided during the transaction.
type ThreeDSAuthenticationGetResponseCardholderShippingAddress struct {
// First line of the street address provided by the cardholder.
Address1 string `json:"address1,nullable"`
// Second line of the street address provided by the cardholder.
Address2 string `json:"address2,nullable"`
// Third line of the street address provided by the cardholder.
Address3 string `json:"address3,nullable"`
// City of the address provided by the cardholder.
City string `json:"city,nullable"`
// Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format
// (e.g. USA)
Country string `json:"country,nullable"`
// Postal code (e.g., ZIP code) of the address provided by the cardholder
PostalCode string `json:"postal_code,nullable"`
JSON threeDSAuthenticationGetResponseCardholderShippingAddressJSON `json:"-"`
}
// threeDSAuthenticationGetResponseCardholderShippingAddressJSON contains the JSON
// metadata for the struct
// [ThreeDSAuthenticationGetResponseCardholderShippingAddress]
type threeDSAuthenticationGetResponseCardholderShippingAddressJSON struct {
Address1 apijson.Field
Address2 apijson.Field
Address3 apijson.Field
City apijson.Field
Country apijson.Field
PostalCode apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseCardholderShippingAddress) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseCardholderShippingAddressJSON) RawJSON() string {
return r.raw
}
// Channel in which the authentication occurs. Maps to EMV 3DS field deviceChannel.
type ThreeDSAuthenticationGetResponseChannel string
const (
ThreeDSAuthenticationGetResponseChannelAppBased ThreeDSAuthenticationGetResponseChannel = "APP_BASED"
ThreeDSAuthenticationGetResponseChannelBrowser ThreeDSAuthenticationGetResponseChannel = "BROWSER"
ThreeDSAuthenticationGetResponseChannelThreeDSRequestorInitiated ThreeDSAuthenticationGetResponseChannel = "THREE_DS_REQUESTOR_INITIATED"
)
func (r ThreeDSAuthenticationGetResponseChannel) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseChannelAppBased, ThreeDSAuthenticationGetResponseChannelBrowser, ThreeDSAuthenticationGetResponseChannelThreeDSRequestorInitiated:
return true
}
return false
}
// Entity that made the authentication decision.
type ThreeDSAuthenticationGetResponseDecisionMadeBy string
const (
ThreeDSAuthenticationGetResponseDecisionMadeByCustomerEndpoint ThreeDSAuthenticationGetResponseDecisionMadeBy = "CUSTOMER_ENDPOINT"
ThreeDSAuthenticationGetResponseDecisionMadeByLithicDefault ThreeDSAuthenticationGetResponseDecisionMadeBy = "LITHIC_DEFAULT"
ThreeDSAuthenticationGetResponseDecisionMadeByLithicRules ThreeDSAuthenticationGetResponseDecisionMadeBy = "LITHIC_RULES"
ThreeDSAuthenticationGetResponseDecisionMadeByNetwork ThreeDSAuthenticationGetResponseDecisionMadeBy = "NETWORK"
ThreeDSAuthenticationGetResponseDecisionMadeByUnknown ThreeDSAuthenticationGetResponseDecisionMadeBy = "UNKNOWN"
)
func (r ThreeDSAuthenticationGetResponseDecisionMadeBy) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseDecisionMadeByCustomerEndpoint, ThreeDSAuthenticationGetResponseDecisionMadeByLithicDefault, ThreeDSAuthenticationGetResponseDecisionMadeByLithicRules, ThreeDSAuthenticationGetResponseDecisionMadeByNetwork, ThreeDSAuthenticationGetResponseDecisionMadeByUnknown:
return true
}
return false
}
// Object containing data about the merchant involved in the e-commerce
// transaction.
type ThreeDSAuthenticationGetResponseMerchant struct {
// Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field
// acquirerMerchantId.
ID string `json:"id,required"`
// Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS
// field merchantCountryCode.
Country string `json:"country,required"`
// Merchant category code assigned to the merchant that describes its business
// activity type. Maps to EMV 3DS field mcc.
Mcc string `json:"mcc,required"`
// Name of the merchant. Maps to EMV 3DS field merchantName.
Name string `json:"name,required"`
// Object containing additional data indicating additional risk factors related to
// the e-commerce transaction.
RiskIndicator ThreeDSAuthenticationGetResponseMerchantRiskIndicator `json:"risk_indicator,required"`
JSON threeDSAuthenticationGetResponseMerchantJSON `json:"-"`
}
// threeDSAuthenticationGetResponseMerchantJSON contains the JSON metadata for the
// struct [ThreeDSAuthenticationGetResponseMerchant]
type threeDSAuthenticationGetResponseMerchantJSON struct {
ID apijson.Field
Country apijson.Field
Mcc apijson.Field
Name apijson.Field
RiskIndicator apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseMerchant) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseMerchantJSON) RawJSON() string {
return r.raw
}
// Object containing additional data indicating additional risk factors related to
// the e-commerce transaction.
type ThreeDSAuthenticationGetResponseMerchantRiskIndicator struct {
// In transactions with electronic delivery, email address to which merchandise is
// delivered. Maps to EMV 3DS field deliveryEmailAddress.
DeliveryEmailAddress string `json:"delivery_email_address,nullable"`
// The delivery time frame for the merchandise. Maps to EMV 3DS field
// deliveryTimeframe.
DeliveryTimeFrame ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrame `json:"delivery_time_frame,nullable"`
// In prepaid or gift card purchase transactions, purchase amount total in major
// units (e.g., a purchase of USD $205.10 would be 205). Maps to EMV 3DS field
// giftCardAmount.
GiftCardAmount float64 `json:"gift_card_amount,nullable"`
// In prepaid or gift card purchase transactions, count of individual prepaid or
// gift cards/codes purchased. Maps to EMV 3DS field giftCardCount.
GiftCardCount float64 `json:"gift_card_count,nullable"`
// In prepaid or gift card purchase transactions, currency code of the gift card.
// Maps to EMV 3DS field giftCardCurr.
GiftCardCurrency string `json:"gift_card_currency,nullable"`
// Indicates whether the purchase is for merchandise that is available now or at a
// future date. Maps to EMV 3DS field preOrderPurchaseInd.
OrderAvailability ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailability `json:"order_availability,nullable"`
// In pre-order purchase transactions, the expected date that the merchandise will
// be available. Maps to EMV 3DS field preOrderDate.
PreOrderAvailableDate time.Time `json:"pre_order_available_date,nullable" format:"date-time"`
// Indicates whether the cardholder is reordering previously purchased merchandise.
// Maps to EMV 3DS field reorderItemsInd.
ReorderItems ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItems `json:"reorder_items,nullable"`
// Shipping method that the cardholder chose for the transaction. If purchase
// includes one or more item, this indicator is used for the physical goods; if the
// purchase only includes digital goods, this indicator is used to describe the
// most expensive item purchased. Maps to EMV 3DS field shipIndicator.
ShippingMethod ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod `json:"shipping_method,nullable"`
JSON threeDSAuthenticationGetResponseMerchantRiskIndicatorJSON `json:"-"`
}
// threeDSAuthenticationGetResponseMerchantRiskIndicatorJSON contains the JSON
// metadata for the struct [ThreeDSAuthenticationGetResponseMerchantRiskIndicator]
type threeDSAuthenticationGetResponseMerchantRiskIndicatorJSON struct {
DeliveryEmailAddress apijson.Field
DeliveryTimeFrame apijson.Field
GiftCardAmount apijson.Field
GiftCardCount apijson.Field
GiftCardCurrency apijson.Field
OrderAvailability apijson.Field
PreOrderAvailableDate apijson.Field
ReorderItems apijson.Field
ShippingMethod apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseMerchantRiskIndicator) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseMerchantRiskIndicatorJSON) RawJSON() string {
return r.raw
}
// The delivery time frame for the merchandise. Maps to EMV 3DS field
// deliveryTimeframe.
type ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrame string
const (
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameElectronicDelivery ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrame = "ELECTRONIC_DELIVERY"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameOvernightShipping ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrame = "OVERNIGHT_SHIPPING"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameSameDayShipping ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrame = "SAME_DAY_SHIPPING"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameTwoDayOrMoreShipping ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrame = "TWO_DAY_OR_MORE_SHIPPING"
)
func (r ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrame) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameElectronicDelivery, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameOvernightShipping, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameSameDayShipping, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorDeliveryTimeFrameTwoDayOrMoreShipping:
return true
}
return false
}
// Indicates whether the purchase is for merchandise that is available now or at a
// future date. Maps to EMV 3DS field preOrderPurchaseInd.
type ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailability string
const (
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailabilityFutureAvailability ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailability = "FUTURE_AVAILABILITY"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailabilityMerchandiseAvailable ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailability = "MERCHANDISE_AVAILABLE"
)
func (r ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailability) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailabilityFutureAvailability, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorOrderAvailabilityMerchandiseAvailable:
return true
}
return false
}
// Indicates whether the cardholder is reordering previously purchased merchandise.
// Maps to EMV 3DS field reorderItemsInd.
type ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItems string
const (
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItemsFirstTimeOrdered ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItems = "FIRST_TIME_ORDERED"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItemsReordered ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItems = "REORDERED"
)
func (r ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItems) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItemsFirstTimeOrdered, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorReorderItemsReordered:
return true
}
return false
}
// Shipping method that the cardholder chose for the transaction. If purchase
// includes one or more item, this indicator is used for the physical goods; if the
// purchase only includes digital goods, this indicator is used to describe the
// most expensive item purchased. Maps to EMV 3DS field shipIndicator.
type ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod string
const (
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodDigitalGoods ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "DIGITAL_GOODS"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodLockerDelivery ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "LOCKER_DELIVERY"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodOther ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "OTHER"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodPickUpAndGoDelivery ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "PICK_UP_AND_GO_DELIVERY"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToBillingAddress ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "SHIP_TO_BILLING_ADDRESS"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToNonBillingAddress ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "SHIP_TO_NON_BILLING_ADDRESS"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToOtherVerifiedAddress ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "SHIP_TO_OTHER_VERIFIED_ADDRESS"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToStore ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "SHIP_TO_STORE"
ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodTravelAndEventTickets ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod = "TRAVEL_AND_EVENT_TICKETS"
)
func (r ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethod) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodDigitalGoods, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodLockerDelivery, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodOther, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodPickUpAndGoDelivery, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToBillingAddress, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToNonBillingAddress, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToOtherVerifiedAddress, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodShipToStore, ThreeDSAuthenticationGetResponseMerchantRiskIndicatorShippingMethodTravelAndEventTickets:
return true
}
return false
}
// Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For
// NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not
// populated.
type ThreeDSAuthenticationGetResponseMessageCategory string
const (
ThreeDSAuthenticationGetResponseMessageCategoryNonPaymentAuthentication ThreeDSAuthenticationGetResponseMessageCategory = "NON_PAYMENT_AUTHENTICATION"
ThreeDSAuthenticationGetResponseMessageCategoryPaymentAuthentication ThreeDSAuthenticationGetResponseMessageCategory = "PAYMENT_AUTHENTICATION"
)
func (r ThreeDSAuthenticationGetResponseMessageCategory) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseMessageCategoryNonPaymentAuthentication, ThreeDSAuthenticationGetResponseMessageCategoryPaymentAuthentication:
return true
}
return false
}
// Object containing additional data about the 3DS request that is beyond the EMV
// 3DS standard spec (e.g., specific fields that only certain card networks send
// but are not required across all 3DS requests).
type ThreeDSAuthenticationGetResponseAdditionalData struct {
// Mastercard only: Indicates whether the network would have considered the
// authentication request to be low risk or not.
NetworkDecision ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecision `json:"network_decision,nullable"`
// Mastercard only: Assessment by the network of the authentication risk level,
// with a higher value indicating a higher amount of risk.
NetworkRiskScore float64 `json:"network_risk_score,nullable"`
JSON threeDSAuthenticationGetResponseAdditionalDataJSON `json:"-"`
}
// threeDSAuthenticationGetResponseAdditionalDataJSON contains the JSON metadata
// for the struct [ThreeDSAuthenticationGetResponseAdditionalData]
type threeDSAuthenticationGetResponseAdditionalDataJSON struct {
NetworkDecision apijson.Field
NetworkRiskScore apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseAdditionalData) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseAdditionalDataJSON) RawJSON() string {
return r.raw
}
// Mastercard only: Indicates whether the network would have considered the
// authentication request to be low risk or not.
type ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecision string
const (
ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecisionLowRisk ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecision = "LOW_RISK"
ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecisionNotLowRisk ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecision = "NOT_LOW_RISK"
)
func (r ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecision) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecisionLowRisk, ThreeDSAuthenticationGetResponseAdditionalDataNetworkDecisionNotLowRisk:
return true
}
return false
}
// Object containing data about the app used in the e-commerce transaction. Present
// if the channel is 'APP_BASED'.
type ThreeDSAuthenticationGetResponseApp struct {
// Device information gathered from the cardholder's device - JSON name/value pairs
// that is Base64url encoded. Maps to EMV 3DS field deviceInfo.
DeviceInfo string `json:"device_info,nullable"`
// External IP address used by the app generating the 3DS authentication request.
// Maps to EMV 3DS field appIp.
Ip string `json:"ip"`
JSON threeDSAuthenticationGetResponseAppJSON `json:"-"`
}
// threeDSAuthenticationGetResponseAppJSON contains the JSON metadata for the
// struct [ThreeDSAuthenticationGetResponseApp]
type threeDSAuthenticationGetResponseAppJSON struct {
DeviceInfo apijson.Field
Ip apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseApp) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseAppJSON) RawJSON() string {
return r.raw
}
// Type of authentication request - i.e., the type of transaction or interaction is
// causing the merchant to request an authentication. Maps to EMV 3DS field
// threeDSRequestorAuthenticationInd.
type ThreeDSAuthenticationGetResponseAuthenticationRequestType string
const (
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeAddCard ThreeDSAuthenticationGetResponseAuthenticationRequestType = "ADD_CARD"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeBillingAgreement ThreeDSAuthenticationGetResponseAuthenticationRequestType = "BILLING_AGREEMENT"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeDelayedShipment ThreeDSAuthenticationGetResponseAuthenticationRequestType = "DELAYED_SHIPMENT"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeEmvTokenCardholderVerification ThreeDSAuthenticationGetResponseAuthenticationRequestType = "EMV_TOKEN_CARDHOLDER_VERIFICATION"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeInstallmentTransaction ThreeDSAuthenticationGetResponseAuthenticationRequestType = "INSTALLMENT_TRANSACTION"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeMaintainCard ThreeDSAuthenticationGetResponseAuthenticationRequestType = "MAINTAIN_CARD"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypePaymentTransaction ThreeDSAuthenticationGetResponseAuthenticationRequestType = "PAYMENT_TRANSACTION"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeRecurringTransaction ThreeDSAuthenticationGetResponseAuthenticationRequestType = "RECURRING_TRANSACTION"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeSplitPayment ThreeDSAuthenticationGetResponseAuthenticationRequestType = "SPLIT_PAYMENT"
ThreeDSAuthenticationGetResponseAuthenticationRequestTypeSplitShipment ThreeDSAuthenticationGetResponseAuthenticationRequestType = "SPLIT_SHIPMENT"
)
func (r ThreeDSAuthenticationGetResponseAuthenticationRequestType) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseAuthenticationRequestTypeAddCard, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeBillingAgreement, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeDelayedShipment, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeEmvTokenCardholderVerification, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeInstallmentTransaction, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeMaintainCard, ThreeDSAuthenticationGetResponseAuthenticationRequestTypePaymentTransaction, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeRecurringTransaction, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeSplitPayment, ThreeDSAuthenticationGetResponseAuthenticationRequestTypeSplitShipment:
return true
}
return false
}
// Object containing data about the browser used in the e-commerce transaction.
// Present if the channel is 'BROWSER'.
type ThreeDSAuthenticationGetResponseBrowser struct {
// IP address of the browser as returned by the HTTP headers to the 3DS requestor
// (e.g., merchant or digital wallet). Maps to EMV 3DS field browserIP.
Ip string `json:"ip,nullable"`
// Indicates whether the cardholder's browser has the ability to execute Java. Maps
// to EMV 3DS field browserJavaEnabled.
JavaEnabled bool `json:"java_enabled,nullable"`
// Indicates whether the cardholder's browser has the ability to execute
// JavaScript. Maps to EMV 3DS field browserJavascriptEnabled.
JavascriptEnabled bool `json:"javascript_enabled,nullable"`
// Language of the cardholder's browser as defined in IETF BCP47. Maps to EMV 3DS
// field browserLanguage.
Language string `json:"language,nullable"`
// Time zone of the cardholder's browser offset in minutes between UTC and the
// cardholder browser's local time. The offset is positive if the local time is
// behind UTC and negative if it is ahead. Maps to EMV 3DS field browserTz.
TimeZone string `json:"time_zone,nullable"`
// Content of the HTTP user-agent header. Maps to EMV 3DS field browserUserAgent.
UserAgent string `json:"user_agent,nullable"`
JSON threeDSAuthenticationGetResponseBrowserJSON `json:"-"`
}
// threeDSAuthenticationGetResponseBrowserJSON contains the JSON metadata for the
// struct [ThreeDSAuthenticationGetResponseBrowser]
type threeDSAuthenticationGetResponseBrowserJSON struct {
Ip apijson.Field
JavaEnabled apijson.Field
JavascriptEnabled apijson.Field
Language apijson.Field
TimeZone apijson.Field
UserAgent apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseBrowser) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseBrowserJSON) RawJSON() string {
return r.raw
}
// Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that
// takes place at the initiation of the merchant rather than the cardholder. The
// most common example of this is where a merchant is authenticating before billing
// for a recurring transaction such as a pay TV subscription or a utility bill.
// Maps to EMV 3DS field threeRIInd.
type ThreeDSAuthenticationGetResponseThreeRiRequestType string
const (
ThreeDSAuthenticationGetResponseThreeRiRequestTypeAccountVerification ThreeDSAuthenticationGetResponseThreeRiRequestType = "ACCOUNT_VERIFICATION"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeAddCard ThreeDSAuthenticationGetResponseThreeRiRequestType = "ADD_CARD"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeBillingAgreement ThreeDSAuthenticationGetResponseThreeRiRequestType = "BILLING_AGREEMENT"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeCardSecurityCodeStatusCheck ThreeDSAuthenticationGetResponseThreeRiRequestType = "CARD_SECURITY_CODE_STATUS_CHECK"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeDelayedShipment ThreeDSAuthenticationGetResponseThreeRiRequestType = "DELAYED_SHIPMENT"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeDeviceBindingStatusCheck ThreeDSAuthenticationGetResponseThreeRiRequestType = "DEVICE_BINDING_STATUS_CHECK"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeInstallmentTransaction ThreeDSAuthenticationGetResponseThreeRiRequestType = "INSTALLMENT_TRANSACTION"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeMailOrder ThreeDSAuthenticationGetResponseThreeRiRequestType = "MAIL_ORDER"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeMaintainCardInfo ThreeDSAuthenticationGetResponseThreeRiRequestType = "MAINTAIN_CARD_INFO"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeOtherPayment ThreeDSAuthenticationGetResponseThreeRiRequestType = "OTHER_PAYMENT"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeRecurringTransaction ThreeDSAuthenticationGetResponseThreeRiRequestType = "RECURRING_TRANSACTION"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeSplitPayment ThreeDSAuthenticationGetResponseThreeRiRequestType = "SPLIT_PAYMENT"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeSplitShipment ThreeDSAuthenticationGetResponseThreeRiRequestType = "SPLIT_SHIPMENT"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeTelephoneOrder ThreeDSAuthenticationGetResponseThreeRiRequestType = "TELEPHONE_ORDER"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeTopUp ThreeDSAuthenticationGetResponseThreeRiRequestType = "TOP_UP"
ThreeDSAuthenticationGetResponseThreeRiRequestTypeTrustListStatusCheck ThreeDSAuthenticationGetResponseThreeRiRequestType = "TRUST_LIST_STATUS_CHECK"
)
func (r ThreeDSAuthenticationGetResponseThreeRiRequestType) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseThreeRiRequestTypeAccountVerification, ThreeDSAuthenticationGetResponseThreeRiRequestTypeAddCard, ThreeDSAuthenticationGetResponseThreeRiRequestTypeBillingAgreement, ThreeDSAuthenticationGetResponseThreeRiRequestTypeCardSecurityCodeStatusCheck, ThreeDSAuthenticationGetResponseThreeRiRequestTypeDelayedShipment, ThreeDSAuthenticationGetResponseThreeRiRequestTypeDeviceBindingStatusCheck, ThreeDSAuthenticationGetResponseThreeRiRequestTypeInstallmentTransaction, ThreeDSAuthenticationGetResponseThreeRiRequestTypeMailOrder, ThreeDSAuthenticationGetResponseThreeRiRequestTypeMaintainCardInfo, ThreeDSAuthenticationGetResponseThreeRiRequestTypeOtherPayment, ThreeDSAuthenticationGetResponseThreeRiRequestTypeRecurringTransaction, ThreeDSAuthenticationGetResponseThreeRiRequestTypeSplitPayment, ThreeDSAuthenticationGetResponseThreeRiRequestTypeSplitShipment, ThreeDSAuthenticationGetResponseThreeRiRequestTypeTelephoneOrder, ThreeDSAuthenticationGetResponseThreeRiRequestTypeTopUp, ThreeDSAuthenticationGetResponseThreeRiRequestTypeTrustListStatusCheck:
return true
}
return false
}
// Object containing data about the e-commerce transaction for which the merchant
// is requesting authentication.
type ThreeDSAuthenticationGetResponseTransaction struct {
// Amount of the purchase in minor units of currency with all punctuation removed.
// Maps to EMV 3DS field purchaseAmount.
Amount float64 `json:"amount,required"`
// Currency of the purchase. Maps to EMV 3DS field purchaseCurrency.
Currency string `json:"currency,required"`
// Minor units of currency, as specified in ISO 4217 currency exponent. Maps to EMV
// 3DS field purchaseExponent.
CurrencyExponent float64 `json:"currency_exponent,required"`
// Date and time when the authentication was generated by the merchant/acquirer's
// 3DS server. Maps to EMV 3DS field purchaseDate.
DateTime time.Time `json:"date_time,required" format:"date-time"`
// Type of the transaction for which a 3DS authentication request is occurring.
// Maps to EMV 3DS field transType.
Type ThreeDSAuthenticationGetResponseTransactionType `json:"type,required,nullable"`
JSON threeDSAuthenticationGetResponseTransactionJSON `json:"-"`
}
// threeDSAuthenticationGetResponseTransactionJSON contains the JSON metadata for
// the struct [ThreeDSAuthenticationGetResponseTransaction]
type threeDSAuthenticationGetResponseTransactionJSON struct {
Amount apijson.Field
Currency apijson.Field
CurrencyExponent apijson.Field
DateTime apijson.Field
Type apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationGetResponseTransaction) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationGetResponseTransactionJSON) RawJSON() string {
return r.raw
}
// Type of the transaction for which a 3DS authentication request is occurring.
// Maps to EMV 3DS field transType.
type ThreeDSAuthenticationGetResponseTransactionType string
const (
ThreeDSAuthenticationGetResponseTransactionTypeAccountFunding ThreeDSAuthenticationGetResponseTransactionType = "ACCOUNT_FUNDING"
ThreeDSAuthenticationGetResponseTransactionTypeCheckAcceptance ThreeDSAuthenticationGetResponseTransactionType = "CHECK_ACCEPTANCE"
ThreeDSAuthenticationGetResponseTransactionTypeGoodsServicePurchase ThreeDSAuthenticationGetResponseTransactionType = "GOODS_SERVICE_PURCHASE"
ThreeDSAuthenticationGetResponseTransactionTypePrepaidActivationAndLoad ThreeDSAuthenticationGetResponseTransactionType = "PREPAID_ACTIVATION_AND_LOAD"
ThreeDSAuthenticationGetResponseTransactionTypeQuasiCashTransaction ThreeDSAuthenticationGetResponseTransactionType = "QUASI_CASH_TRANSACTION"
)
func (r ThreeDSAuthenticationGetResponseTransactionType) IsKnown() bool {
switch r {
case ThreeDSAuthenticationGetResponseTransactionTypeAccountFunding, ThreeDSAuthenticationGetResponseTransactionTypeCheckAcceptance, ThreeDSAuthenticationGetResponseTransactionTypeGoodsServicePurchase, ThreeDSAuthenticationGetResponseTransactionTypePrepaidActivationAndLoad, ThreeDSAuthenticationGetResponseTransactionTypeQuasiCashTransaction:
return true
}
return false
}
type ThreeDSAuthenticationSimulateResponse struct {
// A unique token to reference this transaction with later calls to void or clear
// the authorization.
Token string `json:"token" format:"uuid"`
// Debugging request ID to share with Lithic Support team.
DebuggingRequestID string `json:"debugging_request_id" format:"uuid"`
JSON threeDSAuthenticationSimulateResponseJSON `json:"-"`
}
// threeDSAuthenticationSimulateResponseJSON contains the JSON metadata for the
// struct [ThreeDSAuthenticationSimulateResponse]
type threeDSAuthenticationSimulateResponseJSON struct {
Token apijson.Field
DebuggingRequestID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ThreeDSAuthenticationSimulateResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r threeDSAuthenticationSimulateResponseJSON) RawJSON() string {
return r.raw
}
type ThreeDSAuthenticationSimulateParams struct {
Merchant param.Field[ThreeDSAuthenticationSimulateParamsMerchant] `json:"merchant,required"`
// Sixteen digit card number.
Pan param.Field[string] `json:"pan,required"`
Transaction param.Field[ThreeDSAuthenticationSimulateParamsTransaction] `json:"transaction,required"`
}
func (r ThreeDSAuthenticationSimulateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type ThreeDSAuthenticationSimulateParamsMerchant struct {
// Unique identifier to identify the payment card acceptor. Corresponds to
// `merchant_acceptor_id` in authorization.
ID param.Field[string] `json:"id,required"`
// Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format
// (e.g. USA)
Country param.Field[string] `json:"country,required"`
// Merchant category code for the transaction to be simulated. A four-digit number
// listed in ISO 18245. Supported merchant category codes can be found
// [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
Mcc param.Field[string] `json:"mcc,required"`
// Merchant descriptor, corresponds to `descriptor` in authorization.
Name param.Field[string] `json:"name,required"`
}
func (r ThreeDSAuthenticationSimulateParamsMerchant) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type ThreeDSAuthenticationSimulateParamsTransaction struct {
// Amount (in cents) to authenticate.
Amount param.Field[int64] `json:"amount,required"`
// 3-digit alphabetic ISO 4217 currency code.
Currency param.Field[string] `json:"currency,required"`
}
func (r ThreeDSAuthenticationSimulateParamsTransaction) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}