-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeclinedtransaction.go
More file actions
1851 lines (1640 loc) · 110 KB
/
declinedtransaction.go
File metadata and controls
1851 lines (1640 loc) · 110 KB
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
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package increase
import (
"context"
"errors"
"fmt"
"net/http"
"net/url"
"slices"
"time"
"github.com/Increase/increase-go/internal/apijson"
"github.com/Increase/increase-go/internal/apiquery"
"github.com/Increase/increase-go/internal/param"
"github.com/Increase/increase-go/internal/requestconfig"
"github.com/Increase/increase-go/option"
"github.com/Increase/increase-go/packages/pagination"
)
// DeclinedTransactionService contains methods and other services that help with
// interacting with the increase 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 [NewDeclinedTransactionService] method instead.
type DeclinedTransactionService struct {
Options []option.RequestOption
}
// NewDeclinedTransactionService 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 NewDeclinedTransactionService(opts ...option.RequestOption) (r *DeclinedTransactionService) {
r = &DeclinedTransactionService{}
r.Options = opts
return
}
// Retrieve a Declined Transaction
func (r *DeclinedTransactionService) Get(ctx context.Context, declinedTransactionID string, opts ...option.RequestOption) (res *DeclinedTransaction, err error) {
opts = slices.Concat(r.Options, opts)
if declinedTransactionID == "" {
err = errors.New("missing required declined_transaction_id parameter")
return nil, err
}
path := fmt.Sprintf("declined_transactions/%s", declinedTransactionID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return res, err
}
// List Declined Transactions
func (r *DeclinedTransactionService) List(ctx context.Context, query DeclinedTransactionListParams, opts ...option.RequestOption) (res *pagination.Page[DeclinedTransaction], err error) {
var raw *http.Response
opts = slices.Concat(r.Options, opts)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "declined_transactions"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// List Declined Transactions
func (r *DeclinedTransactionService) ListAutoPaging(ctx context.Context, query DeclinedTransactionListParams, opts ...option.RequestOption) *pagination.PageAutoPager[DeclinedTransaction] {
return pagination.NewPageAutoPager(r.List(ctx, query, opts...))
}
// Declined Transactions are refused additions and removals of money from your bank
// account. For example, Declined Transactions are caused when your Account has an
// insufficient balance or your Limits are triggered.
type DeclinedTransaction struct {
// The Declined Transaction identifier.
ID string `json:"id" api:"required"`
// The identifier for the Account the Declined Transaction belongs to.
AccountID string `json:"account_id" api:"required"`
// The Declined Transaction amount in the minor unit of its currency. For dollars,
// for example, this is cents.
Amount int64 `json:"amount" api:"required"`
// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the
// Transaction occurred.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined
// Transaction's currency. This will match the currency on the Declined
// Transaction's Account.
Currency DeclinedTransactionCurrency `json:"currency" api:"required"`
// This is the description the vendor provides.
Description string `json:"description" api:"required"`
// The identifier for the route this Declined Transaction came through. Routes are
// things like cards and ACH details.
RouteID string `json:"route_id" api:"required,nullable"`
// The type of the route this Declined Transaction came through.
RouteType DeclinedTransactionRouteType `json:"route_type" api:"required,nullable"`
// This is an object giving more details on the network-level event that caused the
// Declined Transaction. For example, for a card transaction this lists the
// merchant's industry and location. Note that for backwards compatibility reasons,
// additional undocumented keys may appear in this object. These should be treated
// as deprecated and will be removed in the future.
Source DeclinedTransactionSource `json:"source" api:"required"`
// A constant representing the object's type. For this resource it will always be
// `declined_transaction`.
Type DeclinedTransactionType `json:"type" api:"required"`
ExtraFields map[string]interface{} `json:"-" api:"extrafields"`
JSON declinedTransactionJSON `json:"-"`
}
// declinedTransactionJSON contains the JSON metadata for the struct
// [DeclinedTransaction]
type declinedTransactionJSON struct {
ID apijson.Field
AccountID apijson.Field
Amount apijson.Field
CreatedAt apijson.Field
Currency apijson.Field
Description apijson.Field
RouteID apijson.Field
RouteType apijson.Field
Source apijson.Field
Type apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransaction) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionJSON) RawJSON() string {
return r.raw
}
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined
// Transaction's currency. This will match the currency on the Declined
// Transaction's Account.
type DeclinedTransactionCurrency string
const (
DeclinedTransactionCurrencyUsd DeclinedTransactionCurrency = "USD"
)
func (r DeclinedTransactionCurrency) IsKnown() bool {
switch r {
case DeclinedTransactionCurrencyUsd:
return true
}
return false
}
// The type of the route this Declined Transaction came through.
type DeclinedTransactionRouteType string
const (
DeclinedTransactionRouteTypeAccountNumber DeclinedTransactionRouteType = "account_number"
DeclinedTransactionRouteTypeCard DeclinedTransactionRouteType = "card"
DeclinedTransactionRouteTypeLockbox DeclinedTransactionRouteType = "lockbox"
)
func (r DeclinedTransactionRouteType) IsKnown() bool {
switch r {
case DeclinedTransactionRouteTypeAccountNumber, DeclinedTransactionRouteTypeCard, DeclinedTransactionRouteTypeLockbox:
return true
}
return false
}
// This is an object giving more details on the network-level event that caused the
// Declined Transaction. For example, for a card transaction this lists the
// merchant's industry and location. Note that for backwards compatibility reasons,
// additional undocumented keys may appear in this object. These should be treated
// as deprecated and will be removed in the future.
type DeclinedTransactionSource struct {
// The type of the resource. We may add additional possible values for this enum
// over time; your application should be able to handle such additions gracefully.
Category DeclinedTransactionSourceCategory `json:"category" api:"required"`
// An ACH Decline object. This field will be present in the JSON response if and
// only if `category` is equal to `ach_decline`.
ACHDecline DeclinedTransactionSourceACHDecline `json:"ach_decline" api:"nullable"`
// A Card Decline object. This field will be present in the JSON response if and
// only if `category` is equal to `card_decline`.
CardDecline DeclinedTransactionSourceCardDecline `json:"card_decline" api:"nullable"`
// A Check Decline object. This field will be present in the JSON response if and
// only if `category` is equal to `check_decline`.
CheckDecline DeclinedTransactionSourceCheckDecline `json:"check_decline" api:"nullable"`
// A Check Deposit Rejection object. This field will be present in the JSON
// response if and only if `category` is equal to `check_deposit_rejection`.
CheckDepositRejection DeclinedTransactionSourceCheckDepositRejection `json:"check_deposit_rejection" api:"nullable"`
// An Inbound FedNow Transfer Decline object. This field will be present in the
// JSON response if and only if `category` is equal to
// `inbound_fednow_transfer_decline`.
InboundFednowTransferDecline DeclinedTransactionSourceInboundFednowTransferDecline `json:"inbound_fednow_transfer_decline" api:"nullable"`
// An Inbound Real-Time Payments Transfer Decline object. This field will be
// present in the JSON response if and only if `category` is equal to
// `inbound_real_time_payments_transfer_decline`.
InboundRealTimePaymentsTransferDecline DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline `json:"inbound_real_time_payments_transfer_decline" api:"nullable"`
// If the category of this Transaction source is equal to `other`, this field will
// contain an empty object, otherwise it will contain null.
Other DeclinedTransactionSourceOther `json:"other" api:"nullable"`
// A Wire Decline object. This field will be present in the JSON response if and
// only if `category` is equal to `wire_decline`.
WireDecline DeclinedTransactionSourceWireDecline `json:"wire_decline" api:"nullable"`
ExtraFields map[string]interface{} `json:"-" api:"extrafields"`
JSON declinedTransactionSourceJSON `json:"-"`
}
// declinedTransactionSourceJSON contains the JSON metadata for the struct
// [DeclinedTransactionSource]
type declinedTransactionSourceJSON struct {
Category apijson.Field
ACHDecline apijson.Field
CardDecline apijson.Field
CheckDecline apijson.Field
CheckDepositRejection apijson.Field
InboundFednowTransferDecline apijson.Field
InboundRealTimePaymentsTransferDecline apijson.Field
Other apijson.Field
WireDecline apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSource) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceJSON) RawJSON() string {
return r.raw
}
// The type of the resource. We may add additional possible values for this enum
// over time; your application should be able to handle such additions gracefully.
type DeclinedTransactionSourceCategory string
const (
DeclinedTransactionSourceCategoryACHDecline DeclinedTransactionSourceCategory = "ach_decline"
DeclinedTransactionSourceCategoryCardDecline DeclinedTransactionSourceCategory = "card_decline"
DeclinedTransactionSourceCategoryCheckDecline DeclinedTransactionSourceCategory = "check_decline"
DeclinedTransactionSourceCategoryInboundRealTimePaymentsTransferDecline DeclinedTransactionSourceCategory = "inbound_real_time_payments_transfer_decline"
DeclinedTransactionSourceCategoryInboundFednowTransferDecline DeclinedTransactionSourceCategory = "inbound_fednow_transfer_decline"
DeclinedTransactionSourceCategoryWireDecline DeclinedTransactionSourceCategory = "wire_decline"
DeclinedTransactionSourceCategoryCheckDepositRejection DeclinedTransactionSourceCategory = "check_deposit_rejection"
DeclinedTransactionSourceCategoryOther DeclinedTransactionSourceCategory = "other"
)
func (r DeclinedTransactionSourceCategory) IsKnown() bool {
switch r {
case DeclinedTransactionSourceCategoryACHDecline, DeclinedTransactionSourceCategoryCardDecline, DeclinedTransactionSourceCategoryCheckDecline, DeclinedTransactionSourceCategoryInboundRealTimePaymentsTransferDecline, DeclinedTransactionSourceCategoryInboundFednowTransferDecline, DeclinedTransactionSourceCategoryWireDecline, DeclinedTransactionSourceCategoryCheckDepositRejection, DeclinedTransactionSourceCategoryOther:
return true
}
return false
}
// An ACH Decline object. This field will be present in the JSON response if and
// only if `category` is equal to `ach_decline`.
type DeclinedTransactionSourceACHDecline struct {
// The ACH Decline's identifier.
ID string `json:"id" api:"required"`
// The declined amount in USD cents.
Amount int64 `json:"amount" api:"required"`
// The identifier of the Inbound ACH Transfer object associated with this decline.
InboundACHTransferID string `json:"inbound_ach_transfer_id" api:"required"`
// The descriptive date of the transfer.
OriginatorCompanyDescriptiveDate string `json:"originator_company_descriptive_date" api:"required,nullable"`
// The additional information included with the transfer.
OriginatorCompanyDiscretionaryData string `json:"originator_company_discretionary_data" api:"required,nullable"`
// The identifier of the company that initiated the transfer.
OriginatorCompanyID string `json:"originator_company_id" api:"required"`
// The name of the company that initiated the transfer.
OriginatorCompanyName string `json:"originator_company_name" api:"required"`
// Why the ACH transfer was declined.
Reason DeclinedTransactionSourceACHDeclineReason `json:"reason" api:"required"`
// The id of the receiver of the transfer.
ReceiverIDNumber string `json:"receiver_id_number" api:"required,nullable"`
// The name of the receiver of the transfer.
ReceiverName string `json:"receiver_name" api:"required,nullable"`
// The trace number of the transfer.
TraceNumber string `json:"trace_number" api:"required"`
// A constant representing the object's type. For this resource it will always be
// `ach_decline`.
Type DeclinedTransactionSourceACHDeclineType `json:"type" api:"required"`
ExtraFields map[string]interface{} `json:"-" api:"extrafields"`
JSON declinedTransactionSourceACHDeclineJSON `json:"-"`
}
// declinedTransactionSourceACHDeclineJSON contains the JSON metadata for the
// struct [DeclinedTransactionSourceACHDecline]
type declinedTransactionSourceACHDeclineJSON struct {
ID apijson.Field
Amount apijson.Field
InboundACHTransferID apijson.Field
OriginatorCompanyDescriptiveDate apijson.Field
OriginatorCompanyDiscretionaryData apijson.Field
OriginatorCompanyID apijson.Field
OriginatorCompanyName apijson.Field
Reason apijson.Field
ReceiverIDNumber apijson.Field
ReceiverName apijson.Field
TraceNumber apijson.Field
Type apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceACHDecline) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceACHDeclineJSON) RawJSON() string {
return r.raw
}
// Why the ACH transfer was declined.
type DeclinedTransactionSourceACHDeclineReason string
const (
DeclinedTransactionSourceACHDeclineReasonACHRouteCanceled DeclinedTransactionSourceACHDeclineReason = "ach_route_canceled"
DeclinedTransactionSourceACHDeclineReasonACHRouteDisabled DeclinedTransactionSourceACHDeclineReason = "ach_route_disabled"
DeclinedTransactionSourceACHDeclineReasonBreachesLimit DeclinedTransactionSourceACHDeclineReason = "breaches_limit"
DeclinedTransactionSourceACHDeclineReasonEntityNotActive DeclinedTransactionSourceACHDeclineReason = "entity_not_active"
DeclinedTransactionSourceACHDeclineReasonGroupLocked DeclinedTransactionSourceACHDeclineReason = "group_locked"
DeclinedTransactionSourceACHDeclineReasonTransactionNotAllowed DeclinedTransactionSourceACHDeclineReason = "transaction_not_allowed"
DeclinedTransactionSourceACHDeclineReasonUserInitiated DeclinedTransactionSourceACHDeclineReason = "user_initiated"
DeclinedTransactionSourceACHDeclineReasonInsufficientFunds DeclinedTransactionSourceACHDeclineReason = "insufficient_funds"
DeclinedTransactionSourceACHDeclineReasonReturnedPerOdfiRequest DeclinedTransactionSourceACHDeclineReason = "returned_per_odfi_request"
DeclinedTransactionSourceACHDeclineReasonAuthorizationRevokedByCustomer DeclinedTransactionSourceACHDeclineReason = "authorization_revoked_by_customer"
DeclinedTransactionSourceACHDeclineReasonPaymentStopped DeclinedTransactionSourceACHDeclineReason = "payment_stopped"
DeclinedTransactionSourceACHDeclineReasonCustomerAdvisedUnauthorizedImproperIneligibleOrIncomplete DeclinedTransactionSourceACHDeclineReason = "customer_advised_unauthorized_improper_ineligible_or_incomplete"
DeclinedTransactionSourceACHDeclineReasonRepresentativePayeeDeceasedOrUnableToContinueInThatCapacity DeclinedTransactionSourceACHDeclineReason = "representative_payee_deceased_or_unable_to_continue_in_that_capacity"
DeclinedTransactionSourceACHDeclineReasonBeneficiaryOrAccountHolderDeceased DeclinedTransactionSourceACHDeclineReason = "beneficiary_or_account_holder_deceased"
DeclinedTransactionSourceACHDeclineReasonCreditEntryRefusedByReceiver DeclinedTransactionSourceACHDeclineReason = "credit_entry_refused_by_receiver"
DeclinedTransactionSourceACHDeclineReasonDuplicateEntry DeclinedTransactionSourceACHDeclineReason = "duplicate_entry"
DeclinedTransactionSourceACHDeclineReasonCorporateCustomerAdvisedNotAuthorized DeclinedTransactionSourceACHDeclineReason = "corporate_customer_advised_not_authorized"
)
func (r DeclinedTransactionSourceACHDeclineReason) IsKnown() bool {
switch r {
case DeclinedTransactionSourceACHDeclineReasonACHRouteCanceled, DeclinedTransactionSourceACHDeclineReasonACHRouteDisabled, DeclinedTransactionSourceACHDeclineReasonBreachesLimit, DeclinedTransactionSourceACHDeclineReasonEntityNotActive, DeclinedTransactionSourceACHDeclineReasonGroupLocked, DeclinedTransactionSourceACHDeclineReasonTransactionNotAllowed, DeclinedTransactionSourceACHDeclineReasonUserInitiated, DeclinedTransactionSourceACHDeclineReasonInsufficientFunds, DeclinedTransactionSourceACHDeclineReasonReturnedPerOdfiRequest, DeclinedTransactionSourceACHDeclineReasonAuthorizationRevokedByCustomer, DeclinedTransactionSourceACHDeclineReasonPaymentStopped, DeclinedTransactionSourceACHDeclineReasonCustomerAdvisedUnauthorizedImproperIneligibleOrIncomplete, DeclinedTransactionSourceACHDeclineReasonRepresentativePayeeDeceasedOrUnableToContinueInThatCapacity, DeclinedTransactionSourceACHDeclineReasonBeneficiaryOrAccountHolderDeceased, DeclinedTransactionSourceACHDeclineReasonCreditEntryRefusedByReceiver, DeclinedTransactionSourceACHDeclineReasonDuplicateEntry, DeclinedTransactionSourceACHDeclineReasonCorporateCustomerAdvisedNotAuthorized:
return true
}
return false
}
// A constant representing the object's type. For this resource it will always be
// `ach_decline`.
type DeclinedTransactionSourceACHDeclineType string
const (
DeclinedTransactionSourceACHDeclineTypeACHDecline DeclinedTransactionSourceACHDeclineType = "ach_decline"
)
func (r DeclinedTransactionSourceACHDeclineType) IsKnown() bool {
switch r {
case DeclinedTransactionSourceACHDeclineTypeACHDecline:
return true
}
return false
}
// A Card Decline object. This field will be present in the JSON response if and
// only if `category` is equal to `card_decline`.
type DeclinedTransactionSourceCardDecline struct {
// The Card Decline identifier.
ID string `json:"id" api:"required"`
// Whether this authorization was approved by Increase, the card network through
// stand-in processing, or the user through a real-time decision.
Actioner DeclinedTransactionSourceCardDeclineActioner `json:"actioner" api:"required"`
// Additional amounts associated with the card authorization, such as ATM
// surcharges fees. These are usually a subset of the `amount` field and are used
// to provide more detailed information about the transaction.
AdditionalAmounts DeclinedTransactionSourceCardDeclineAdditionalAmounts `json:"additional_amounts" api:"required"`
// The declined amount in the minor unit of the destination account currency. For
// dollars, for example, this is cents.
Amount int64 `json:"amount" api:"required"`
// The ID of the Card Payment this transaction belongs to.
CardPaymentID string `json:"card_payment_id" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination
// account currency.
Currency DeclinedTransactionSourceCardDeclineCurrency `json:"currency" api:"required"`
// The identifier of the declined transaction created for this Card Decline.
DeclinedTransactionID string `json:"declined_transaction_id" api:"required"`
// If the authorization was made via a Digital Wallet Token (such as an Apple Pay
// purchase), the identifier of the token that was used.
DigitalWalletTokenID string `json:"digital_wallet_token_id" api:"required,nullable"`
// The direction describes the direction the funds will move, either from the
// cardholder to the merchant or from the merchant to the cardholder.
Direction DeclinedTransactionSourceCardDeclineDirection `json:"direction" api:"required"`
// The identifier of the card authorization this request attempted to incrementally
// authorize.
IncrementedCardAuthorizationID string `json:"incremented_card_authorization_id" api:"required,nullable"`
// The merchant identifier (commonly abbreviated as MID) of the merchant the card
// is transacting with.
MerchantAcceptorID string `json:"merchant_acceptor_id" api:"required"`
// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the
// card is transacting with.
MerchantCategoryCode string `json:"merchant_category_code" api:"required"`
// The city the merchant resides in.
MerchantCity string `json:"merchant_city" api:"required,nullable"`
// The country the merchant resides in.
MerchantCountry string `json:"merchant_country" api:"required"`
// The merchant descriptor of the merchant the card is transacting with.
MerchantDescriptor string `json:"merchant_descriptor" api:"required"`
// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit
// ZIP code, where the first 5 and last 4 are separated by a dash.
MerchantPostalCode string `json:"merchant_postal_code" api:"required,nullable"`
// The state the merchant resides in.
MerchantState string `json:"merchant_state" api:"required,nullable"`
// Fields specific to the `network`.
NetworkDetails DeclinedTransactionSourceCardDeclineNetworkDetails `json:"network_details" api:"required"`
// Network-specific identifiers for a specific request or transaction.
NetworkIdentifiers DeclinedTransactionSourceCardDeclineNetworkIdentifiers `json:"network_identifiers" api:"required"`
// The risk score generated by the card network. For Visa this is the Visa Advanced
// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the
// score is from 0 to 999, where 999 is the riskiest.
NetworkRiskScore int64 `json:"network_risk_score" api:"required,nullable"`
// If the authorization was made in-person with a physical card, the Physical Card
// that was used.
PhysicalCardID string `json:"physical_card_id" api:"required,nullable"`
// The declined amount in the minor unit of the transaction's presentment currency.
PresentmentAmount int64 `json:"presentment_amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
// transaction's presentment currency.
PresentmentCurrency string `json:"presentment_currency" api:"required"`
// The processing category describes the intent behind the authorization, such as
// whether it was used for bill payments or an automatic fuel dispenser.
ProcessingCategory DeclinedTransactionSourceCardDeclineProcessingCategory `json:"processing_category" api:"required"`
// The identifier of the Real-Time Decision sent to approve or decline this
// transaction.
RealTimeDecisionID string `json:"real_time_decision_id" api:"required,nullable"`
// This is present if a specific decline reason was given in the real-time
// decision.
RealTimeDecisionReason DeclinedTransactionSourceCardDeclineRealTimeDecisionReason `json:"real_time_decision_reason" api:"required,nullable"`
// Why the transaction was declined.
Reason DeclinedTransactionSourceCardDeclineReason `json:"reason" api:"required"`
// The terminal identifier (commonly abbreviated as TID) of the terminal the card
// is transacting with.
TerminalID string `json:"terminal_id" api:"required,nullable"`
// Fields related to verification of cardholder-provided values.
Verification DeclinedTransactionSourceCardDeclineVerification `json:"verification" api:"required"`
ExtraFields map[string]interface{} `json:"-" api:"extrafields"`
JSON declinedTransactionSourceCardDeclineJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineJSON contains the JSON metadata for the
// struct [DeclinedTransactionSourceCardDecline]
type declinedTransactionSourceCardDeclineJSON struct {
ID apijson.Field
Actioner apijson.Field
AdditionalAmounts apijson.Field
Amount apijson.Field
CardPaymentID apijson.Field
Currency apijson.Field
DeclinedTransactionID apijson.Field
DigitalWalletTokenID apijson.Field
Direction apijson.Field
IncrementedCardAuthorizationID apijson.Field
MerchantAcceptorID apijson.Field
MerchantCategoryCode apijson.Field
MerchantCity apijson.Field
MerchantCountry apijson.Field
MerchantDescriptor apijson.Field
MerchantPostalCode apijson.Field
MerchantState apijson.Field
NetworkDetails apijson.Field
NetworkIdentifiers apijson.Field
NetworkRiskScore apijson.Field
PhysicalCardID apijson.Field
PresentmentAmount apijson.Field
PresentmentCurrency apijson.Field
ProcessingCategory apijson.Field
RealTimeDecisionID apijson.Field
RealTimeDecisionReason apijson.Field
Reason apijson.Field
TerminalID apijson.Field
Verification apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDecline) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineJSON) RawJSON() string {
return r.raw
}
// Whether this authorization was approved by Increase, the card network through
// stand-in processing, or the user through a real-time decision.
type DeclinedTransactionSourceCardDeclineActioner string
const (
DeclinedTransactionSourceCardDeclineActionerUser DeclinedTransactionSourceCardDeclineActioner = "user"
DeclinedTransactionSourceCardDeclineActionerIncrease DeclinedTransactionSourceCardDeclineActioner = "increase"
DeclinedTransactionSourceCardDeclineActionerNetwork DeclinedTransactionSourceCardDeclineActioner = "network"
)
func (r DeclinedTransactionSourceCardDeclineActioner) IsKnown() bool {
switch r {
case DeclinedTransactionSourceCardDeclineActionerUser, DeclinedTransactionSourceCardDeclineActionerIncrease, DeclinedTransactionSourceCardDeclineActionerNetwork:
return true
}
return false
}
// Additional amounts associated with the card authorization, such as ATM
// surcharges fees. These are usually a subset of the `amount` field and are used
// to provide more detailed information about the transaction.
type DeclinedTransactionSourceCardDeclineAdditionalAmounts struct {
// The part of this transaction amount that was for clinic-related services.
Clinic DeclinedTransactionSourceCardDeclineAdditionalAmountsClinic `json:"clinic" api:"required,nullable"`
// The part of this transaction amount that was for dental-related services.
Dental DeclinedTransactionSourceCardDeclineAdditionalAmountsDental `json:"dental" api:"required,nullable"`
// The original pre-authorized amount.
Original DeclinedTransactionSourceCardDeclineAdditionalAmountsOriginal `json:"original" api:"required,nullable"`
// The part of this transaction amount that was for healthcare prescriptions.
Prescription DeclinedTransactionSourceCardDeclineAdditionalAmountsPrescription `json:"prescription" api:"required,nullable"`
// The surcharge amount charged for this transaction by the merchant.
Surcharge DeclinedTransactionSourceCardDeclineAdditionalAmountsSurcharge `json:"surcharge" api:"required,nullable"`
// The total amount of a series of incremental authorizations, optionally provided.
TotalCumulative DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulative `json:"total_cumulative" api:"required,nullable"`
// The total amount of healthcare-related additional amounts.
TotalHealthcare DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcare `json:"total_healthcare" api:"required,nullable"`
// The part of this transaction amount that was for transit-related services.
Transit DeclinedTransactionSourceCardDeclineAdditionalAmountsTransit `json:"transit" api:"required,nullable"`
// An unknown additional amount.
Unknown DeclinedTransactionSourceCardDeclineAdditionalAmountsUnknown `json:"unknown" api:"required,nullable"`
// The part of this transaction amount that was for vision-related services.
Vision DeclinedTransactionSourceCardDeclineAdditionalAmountsVision `json:"vision" api:"required,nullable"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsJSON contains the JSON
// metadata for the struct [DeclinedTransactionSourceCardDeclineAdditionalAmounts]
type declinedTransactionSourceCardDeclineAdditionalAmountsJSON struct {
Clinic apijson.Field
Dental apijson.Field
Original apijson.Field
Prescription apijson.Field
Surcharge apijson.Field
TotalCumulative apijson.Field
TotalHealthcare apijson.Field
Transit apijson.Field
Unknown apijson.Field
Vision apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmounts) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsJSON) RawJSON() string {
return r.raw
}
// The part of this transaction amount that was for clinic-related services.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsClinic struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsClinicJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsClinicJSON contains the
// JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsClinic]
type declinedTransactionSourceCardDeclineAdditionalAmountsClinicJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsClinic) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsClinicJSON) RawJSON() string {
return r.raw
}
// The part of this transaction amount that was for dental-related services.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsDental struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsDentalJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsDentalJSON contains the
// JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsDental]
type declinedTransactionSourceCardDeclineAdditionalAmountsDentalJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsDental) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsDentalJSON) RawJSON() string {
return r.raw
}
// The original pre-authorized amount.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsOriginal struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsOriginalJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsOriginalJSON contains the
// JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsOriginal]
type declinedTransactionSourceCardDeclineAdditionalAmountsOriginalJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsOriginal) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsOriginalJSON) RawJSON() string {
return r.raw
}
// The part of this transaction amount that was for healthcare prescriptions.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsPrescription struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsPrescriptionJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsPrescriptionJSON contains
// the JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsPrescription]
type declinedTransactionSourceCardDeclineAdditionalAmountsPrescriptionJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsPrescription) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsPrescriptionJSON) RawJSON() string {
return r.raw
}
// The surcharge amount charged for this transaction by the merchant.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsSurcharge struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsSurchargeJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsSurchargeJSON contains the
// JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsSurcharge]
type declinedTransactionSourceCardDeclineAdditionalAmountsSurchargeJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsSurcharge) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsSurchargeJSON) RawJSON() string {
return r.raw
}
// The total amount of a series of incremental authorizations, optionally provided.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulative struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulativeJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulativeJSON
// contains the JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulative]
type declinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulativeJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulative) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsTotalCumulativeJSON) RawJSON() string {
return r.raw
}
// The total amount of healthcare-related additional amounts.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcare struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcareJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcareJSON
// contains the JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcare]
type declinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcareJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcare) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsTotalHealthcareJSON) RawJSON() string {
return r.raw
}
// The part of this transaction amount that was for transit-related services.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsTransit struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsTransitJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsTransitJSON contains the
// JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsTransit]
type declinedTransactionSourceCardDeclineAdditionalAmountsTransitJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsTransit) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsTransitJSON) RawJSON() string {
return r.raw
}
// An unknown additional amount.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsUnknown struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsUnknownJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsUnknownJSON contains the
// JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsUnknown]
type declinedTransactionSourceCardDeclineAdditionalAmountsUnknownJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsUnknown) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsUnknownJSON) RawJSON() string {
return r.raw
}
// The part of this transaction amount that was for vision-related services.
type DeclinedTransactionSourceCardDeclineAdditionalAmountsVision struct {
// The amount in minor units of the `currency` field. The amount is positive if it
// is added to the amount (such as an ATM surcharge fee) and negative if it is
// subtracted from the amount (such as a discount).
Amount int64 `json:"amount" api:"required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
// amount's currency.
Currency string `json:"currency" api:"required"`
JSON declinedTransactionSourceCardDeclineAdditionalAmountsVisionJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineAdditionalAmountsVisionJSON contains the
// JSON metadata for the struct
// [DeclinedTransactionSourceCardDeclineAdditionalAmountsVision]
type declinedTransactionSourceCardDeclineAdditionalAmountsVisionJSON struct {
Amount apijson.Field
Currency apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineAdditionalAmountsVision) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineAdditionalAmountsVisionJSON) RawJSON() string {
return r.raw
}
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination
// account currency.
type DeclinedTransactionSourceCardDeclineCurrency string
const (
DeclinedTransactionSourceCardDeclineCurrencyUsd DeclinedTransactionSourceCardDeclineCurrency = "USD"
)
func (r DeclinedTransactionSourceCardDeclineCurrency) IsKnown() bool {
switch r {
case DeclinedTransactionSourceCardDeclineCurrencyUsd:
return true
}
return false
}
// The direction describes the direction the funds will move, either from the
// cardholder to the merchant or from the merchant to the cardholder.
type DeclinedTransactionSourceCardDeclineDirection string
const (
DeclinedTransactionSourceCardDeclineDirectionSettlement DeclinedTransactionSourceCardDeclineDirection = "settlement"
DeclinedTransactionSourceCardDeclineDirectionRefund DeclinedTransactionSourceCardDeclineDirection = "refund"
)
func (r DeclinedTransactionSourceCardDeclineDirection) IsKnown() bool {
switch r {
case DeclinedTransactionSourceCardDeclineDirectionSettlement, DeclinedTransactionSourceCardDeclineDirectionRefund:
return true
}
return false
}
// Fields specific to the `network`.
type DeclinedTransactionSourceCardDeclineNetworkDetails struct {
// The payment network used to process this card authorization.
Category DeclinedTransactionSourceCardDeclineNetworkDetailsCategory `json:"category" api:"required"`
// Fields specific to the `pulse` network.
Pulse DeclinedTransactionSourceCardDeclineNetworkDetailsPulse `json:"pulse" api:"required,nullable"`
// Fields specific to the `visa` network.
Visa DeclinedTransactionSourceCardDeclineNetworkDetailsVisa `json:"visa" api:"required,nullable"`
JSON declinedTransactionSourceCardDeclineNetworkDetailsJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineNetworkDetailsJSON contains the JSON
// metadata for the struct [DeclinedTransactionSourceCardDeclineNetworkDetails]
type declinedTransactionSourceCardDeclineNetworkDetailsJSON struct {
Category apijson.Field
Pulse apijson.Field
Visa apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineNetworkDetails) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineNetworkDetailsJSON) RawJSON() string {
return r.raw
}
// The payment network used to process this card authorization.
type DeclinedTransactionSourceCardDeclineNetworkDetailsCategory string
const (
DeclinedTransactionSourceCardDeclineNetworkDetailsCategoryVisa DeclinedTransactionSourceCardDeclineNetworkDetailsCategory = "visa"
DeclinedTransactionSourceCardDeclineNetworkDetailsCategoryPulse DeclinedTransactionSourceCardDeclineNetworkDetailsCategory = "pulse"
)
func (r DeclinedTransactionSourceCardDeclineNetworkDetailsCategory) IsKnown() bool {
switch r {
case DeclinedTransactionSourceCardDeclineNetworkDetailsCategoryVisa, DeclinedTransactionSourceCardDeclineNetworkDetailsCategoryPulse:
return true
}
return false
}
// Fields specific to the `pulse` network.
type DeclinedTransactionSourceCardDeclineNetworkDetailsPulse struct {
JSON declinedTransactionSourceCardDeclineNetworkDetailsPulseJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineNetworkDetailsPulseJSON contains the JSON
// metadata for the struct
// [DeclinedTransactionSourceCardDeclineNetworkDetailsPulse]
type declinedTransactionSourceCardDeclineNetworkDetailsPulseJSON struct {
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineNetworkDetailsPulse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineNetworkDetailsPulseJSON) RawJSON() string {
return r.raw
}
// Fields specific to the `visa` network.
type DeclinedTransactionSourceCardDeclineNetworkDetailsVisa struct {
// For electronic commerce transactions, this identifies the level of security used
// in obtaining the customer's payment credential. For mail or telephone order
// transactions, identifies the type of mail or telephone order.
ElectronicCommerceIndicator DeclinedTransactionSourceCardDeclineNetworkDetailsVisaElectronicCommerceIndicator `json:"electronic_commerce_indicator" api:"required,nullable"`
// The method used to enter the cardholder's primary account number and card
// expiration date.
PointOfServiceEntryMode DeclinedTransactionSourceCardDeclineNetworkDetailsVisaPointOfServiceEntryMode `json:"point_of_service_entry_mode" api:"required,nullable"`
// Only present when `actioner: network`. Describes why a card authorization was
// approved or declined by Visa through stand-in processing.
StandInProcessingReason DeclinedTransactionSourceCardDeclineNetworkDetailsVisaStandInProcessingReason `json:"stand_in_processing_reason" api:"required,nullable"`
// The capability of the terminal being used to read the card. Shows whether a
// terminal can e.g., accept chip cards or if it only supports magnetic stripe
// reads. This reflects the highest capability of the terminal — for example, a
// terminal that supports both chip and magnetic stripe will be identified as
// chip-capable.
TerminalEntryCapability DeclinedTransactionSourceCardDeclineNetworkDetailsVisaTerminalEntryCapability `json:"terminal_entry_capability" api:"required,nullable"`
JSON declinedTransactionSourceCardDeclineNetworkDetailsVisaJSON `json:"-"`
}
// declinedTransactionSourceCardDeclineNetworkDetailsVisaJSON contains the JSON
// metadata for the struct [DeclinedTransactionSourceCardDeclineNetworkDetailsVisa]
type declinedTransactionSourceCardDeclineNetworkDetailsVisaJSON struct {
ElectronicCommerceIndicator apijson.Field
PointOfServiceEntryMode apijson.Field
StandInProcessingReason apijson.Field
TerminalEntryCapability apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *DeclinedTransactionSourceCardDeclineNetworkDetailsVisa) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r declinedTransactionSourceCardDeclineNetworkDetailsVisaJSON) RawJSON() string {
return r.raw
}