-
Notifications
You must be signed in to change notification settings - Fork 0
/
pendingtransaction.go
1407 lines (1258 loc) · 72.9 KB
/
pendingtransaction.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
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"
"fmt"
"net/http"
"net/url"
"time"
"github.com/increase/increase-go/internal/apijson"
"github.com/increase/increase-go/internal/apiquery"
"github.com/increase/increase-go/internal/pagination"
"github.com/increase/increase-go/internal/param"
"github.com/increase/increase-go/internal/requestconfig"
"github.com/increase/increase-go/option"
)
// PendingTransactionService 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 [NewPendingTransactionService] method instead.
type PendingTransactionService struct {
Options []option.RequestOption
}
// NewPendingTransactionService 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 NewPendingTransactionService(opts ...option.RequestOption) (r *PendingTransactionService) {
r = &PendingTransactionService{}
r.Options = opts
return
}
// Retrieve a Pending Transaction
func (r *PendingTransactionService) Get(ctx context.Context, pendingTransactionID string, opts ...option.RequestOption) (res *PendingTransaction, err error) {
opts = append(r.Options[:], opts...)
path := fmt.Sprintf("pending_transactions/%s", pendingTransactionID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}
// List Pending Transactions
func (r *PendingTransactionService) List(ctx context.Context, query PendingTransactionListParams, opts ...option.RequestOption) (res *pagination.Page[PendingTransaction], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "pending_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 Pending Transactions
func (r *PendingTransactionService) ListAutoPaging(ctx context.Context, query PendingTransactionListParams, opts ...option.RequestOption) *pagination.PageAutoPager[PendingTransaction] {
return pagination.NewPageAutoPager(r.List(ctx, query, opts...))
}
// Pending Transactions are potential future additions and removals of money from
// your bank account.
type PendingTransaction struct {
// The Pending Transaction identifier.
ID string `json:"id,required"`
// The identifier for the account this Pending Transaction belongs to.
AccountID string `json:"account_id,required"`
// The Pending Transaction amount in the minor unit of its currency. For dollars,
// for example, this is cents.
Amount int64 `json:"amount,required"`
// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending
// Transaction was completed.
CompletedAt time.Time `json:"completed_at,required,nullable" format:"date-time"`
// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending
// Transaction occurred.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Pending
// Transaction's currency. This will match the currency on the Pending
// Transaction's Account.
Currency PendingTransactionCurrency `json:"currency,required"`
// For a Pending Transaction related to a transfer, this is the description you
// provide. For a Pending Transaction related to a payment, this is the description
// the vendor provides.
Description string `json:"description,required"`
// The identifier for the route this Pending Transaction came through. Routes are
// things like cards and ACH details.
RouteID string `json:"route_id,required,nullable"`
// The type of the route this Pending Transaction came through.
RouteType PendingTransactionRouteType `json:"route_type,required,nullable"`
// This is an object giving more details on the network-level event that caused the
// Pending Transaction. For example, for a card transaction this lists the
// merchant's industry and location.
Source PendingTransactionSource `json:"source,required"`
// Whether the Pending Transaction has been confirmed and has an associated
// Transaction.
Status PendingTransactionStatus `json:"status,required"`
// A constant representing the object's type. For this resource it will always be
// `pending_transaction`.
Type PendingTransactionType `json:"type,required"`
JSON pendingTransactionJSON `json:"-"`
}
// pendingTransactionJSON contains the JSON metadata for the struct
// [PendingTransaction]
type pendingTransactionJSON struct {
ID apijson.Field
AccountID apijson.Field
Amount apijson.Field
CompletedAt apijson.Field
CreatedAt apijson.Field
Currency apijson.Field
Description apijson.Field
RouteID apijson.Field
RouteType apijson.Field
Source apijson.Field
Status apijson.Field
Type apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransaction) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionJSON) RawJSON() string {
return r.raw
}
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Pending
// Transaction's currency. This will match the currency on the Pending
// Transaction's Account.
type PendingTransactionCurrency string
const (
// Canadian Dollar (CAD)
PendingTransactionCurrencyCad PendingTransactionCurrency = "CAD"
// Swiss Franc (CHF)
PendingTransactionCurrencyChf PendingTransactionCurrency = "CHF"
// Euro (EUR)
PendingTransactionCurrencyEur PendingTransactionCurrency = "EUR"
// British Pound (GBP)
PendingTransactionCurrencyGbp PendingTransactionCurrency = "GBP"
// Japanese Yen (JPY)
PendingTransactionCurrencyJpy PendingTransactionCurrency = "JPY"
// US Dollar (USD)
PendingTransactionCurrencyUsd PendingTransactionCurrency = "USD"
)
func (r PendingTransactionCurrency) IsKnown() bool {
switch r {
case PendingTransactionCurrencyCad, PendingTransactionCurrencyChf, PendingTransactionCurrencyEur, PendingTransactionCurrencyGbp, PendingTransactionCurrencyJpy, PendingTransactionCurrencyUsd:
return true
}
return false
}
// The type of the route this Pending Transaction came through.
type PendingTransactionRouteType string
const (
// An Account Number.
PendingTransactionRouteTypeAccountNumber PendingTransactionRouteType = "account_number"
// A Card.
PendingTransactionRouteTypeCard PendingTransactionRouteType = "card"
)
func (r PendingTransactionRouteType) IsKnown() bool {
switch r {
case PendingTransactionRouteTypeAccountNumber, PendingTransactionRouteTypeCard:
return true
}
return false
}
// This is an object giving more details on the network-level event that caused the
// Pending Transaction. For example, for a card transaction this lists the
// merchant's industry and location.
type PendingTransactionSource struct {
// An Account Transfer Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `account_transfer_instruction`.
AccountTransferInstruction PendingTransactionSourceAccountTransferInstruction `json:"account_transfer_instruction,required,nullable"`
// An ACH Transfer Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `ach_transfer_instruction`.
ACHTransferInstruction PendingTransactionSourceACHTransferInstruction `json:"ach_transfer_instruction,required,nullable"`
// A Card Authorization object. This field will be present in the JSON response if
// and only if `category` is equal to `card_authorization`.
CardAuthorization PendingTransactionSourceCardAuthorization `json:"card_authorization,required,nullable"`
// 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 PendingTransactionSourceCategory `json:"category,required"`
// A Check Deposit Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `check_deposit_instruction`.
CheckDepositInstruction PendingTransactionSourceCheckDepositInstruction `json:"check_deposit_instruction,required,nullable"`
// A Check Transfer Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `check_transfer_instruction`.
CheckTransferInstruction PendingTransactionSourceCheckTransferInstruction `json:"check_transfer_instruction,required,nullable"`
// An Inbound Funds Hold object. This field will be present in the JSON response if
// and only if `category` is equal to `inbound_funds_hold`.
InboundFundsHold PendingTransactionSourceInboundFundsHold `json:"inbound_funds_hold,required,nullable"`
// A Real-Time Payments Transfer Instruction object. This field will be present in
// the JSON response if and only if `category` is equal to
// `real_time_payments_transfer_instruction`.
RealTimePaymentsTransferInstruction PendingTransactionSourceRealTimePaymentsTransferInstruction `json:"real_time_payments_transfer_instruction,required,nullable"`
// A Wire Transfer Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `wire_transfer_instruction`.
WireTransferInstruction PendingTransactionSourceWireTransferInstruction `json:"wire_transfer_instruction,required,nullable"`
JSON pendingTransactionSourceJSON `json:"-"`
}
// pendingTransactionSourceJSON contains the JSON metadata for the struct
// [PendingTransactionSource]
type pendingTransactionSourceJSON struct {
AccountTransferInstruction apijson.Field
ACHTransferInstruction apijson.Field
CardAuthorization apijson.Field
Category apijson.Field
CheckDepositInstruction apijson.Field
CheckTransferInstruction apijson.Field
InboundFundsHold apijson.Field
RealTimePaymentsTransferInstruction apijson.Field
WireTransferInstruction apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSource) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceJSON) RawJSON() string {
return r.raw
}
// An Account Transfer Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `account_transfer_instruction`.
type PendingTransactionSourceAccountTransferInstruction struct {
// The pending amount in the minor unit of the transaction's currency. For dollars,
// for example, this is cents.
Amount int64 `json:"amount,required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination
// account currency.
Currency PendingTransactionSourceAccountTransferInstructionCurrency `json:"currency,required"`
// The identifier of the Account Transfer that led to this Pending Transaction.
TransferID string `json:"transfer_id,required"`
JSON pendingTransactionSourceAccountTransferInstructionJSON `json:"-"`
}
// pendingTransactionSourceAccountTransferInstructionJSON contains the JSON
// metadata for the struct [PendingTransactionSourceAccountTransferInstruction]
type pendingTransactionSourceAccountTransferInstructionJSON struct {
Amount apijson.Field
Currency apijson.Field
TransferID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceAccountTransferInstruction) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceAccountTransferInstructionJSON) RawJSON() string {
return r.raw
}
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination
// account currency.
type PendingTransactionSourceAccountTransferInstructionCurrency string
const (
// Canadian Dollar (CAD)
PendingTransactionSourceAccountTransferInstructionCurrencyCad PendingTransactionSourceAccountTransferInstructionCurrency = "CAD"
// Swiss Franc (CHF)
PendingTransactionSourceAccountTransferInstructionCurrencyChf PendingTransactionSourceAccountTransferInstructionCurrency = "CHF"
// Euro (EUR)
PendingTransactionSourceAccountTransferInstructionCurrencyEur PendingTransactionSourceAccountTransferInstructionCurrency = "EUR"
// British Pound (GBP)
PendingTransactionSourceAccountTransferInstructionCurrencyGbp PendingTransactionSourceAccountTransferInstructionCurrency = "GBP"
// Japanese Yen (JPY)
PendingTransactionSourceAccountTransferInstructionCurrencyJpy PendingTransactionSourceAccountTransferInstructionCurrency = "JPY"
// US Dollar (USD)
PendingTransactionSourceAccountTransferInstructionCurrencyUsd PendingTransactionSourceAccountTransferInstructionCurrency = "USD"
)
func (r PendingTransactionSourceAccountTransferInstructionCurrency) IsKnown() bool {
switch r {
case PendingTransactionSourceAccountTransferInstructionCurrencyCad, PendingTransactionSourceAccountTransferInstructionCurrencyChf, PendingTransactionSourceAccountTransferInstructionCurrencyEur, PendingTransactionSourceAccountTransferInstructionCurrencyGbp, PendingTransactionSourceAccountTransferInstructionCurrencyJpy, PendingTransactionSourceAccountTransferInstructionCurrencyUsd:
return true
}
return false
}
// An ACH Transfer Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `ach_transfer_instruction`.
type PendingTransactionSourceACHTransferInstruction struct {
// The pending amount in the minor unit of the transaction's currency. For dollars,
// for example, this is cents.
Amount int64 `json:"amount,required"`
// The identifier of the ACH Transfer that led to this Pending Transaction.
TransferID string `json:"transfer_id,required"`
JSON pendingTransactionSourceACHTransferInstructionJSON `json:"-"`
}
// pendingTransactionSourceACHTransferInstructionJSON contains the JSON metadata
// for the struct [PendingTransactionSourceACHTransferInstruction]
type pendingTransactionSourceACHTransferInstructionJSON struct {
Amount apijson.Field
TransferID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceACHTransferInstruction) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceACHTransferInstructionJSON) RawJSON() string {
return r.raw
}
// A Card Authorization object. This field will be present in the JSON response if
// and only if `category` is equal to `card_authorization`.
type PendingTransactionSourceCardAuthorization struct {
// The Card Authorization identifier.
ID string `json:"id,required"`
// Whether this authorization was approved by Increase, the card network through
// stand-in processing, or the user through a real-time decision.
Actioner PendingTransactionSourceCardAuthorizationActioner `json:"actioner,required"`
// The pending amount in the minor unit of the transaction's currency. For dollars,
// for example, this is cents.
Amount int64 `json:"amount,required"`
// The ID of the Card Payment this transaction belongs to.
CardPaymentID string `json:"card_payment_id,required,nullable"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
// transaction's currency.
Currency PendingTransactionSourceCardAuthorizationCurrency `json:"currency,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,required,nullable"`
// The direction descibes the direction the funds will move, either from the
// cardholder to the merchant or from the merchant to the cardholder.
Direction PendingTransactionSourceCardAuthorizationDirection `json:"direction,required"`
// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization
// will expire and the pending transaction will be released.
ExpiresAt time.Time `json:"expires_at,required" format:"date-time"`
// The merchant identifier (commonly abbreviated as MID) of the merchant the card
// is transacting with.
MerchantAcceptorID string `json:"merchant_acceptor_id,required"`
// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the
// card is transacting with.
MerchantCategoryCode string `json:"merchant_category_code,required,nullable"`
// The city the merchant resides in.
MerchantCity string `json:"merchant_city,required,nullable"`
// The country the merchant resides in.
MerchantCountry string `json:"merchant_country,required,nullable"`
// The merchant descriptor of the merchant the card is transacting with.
MerchantDescriptor string `json:"merchant_descriptor,required"`
// Fields specific to the `network`.
NetworkDetails PendingTransactionSourceCardAuthorizationNetworkDetails `json:"network_details,required"`
// Network-specific identifiers for a specific request or transaction.
NetworkIdentifiers PendingTransactionSourceCardAuthorizationNetworkIdentifiers `json:"network_identifiers,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.
NetworkRiskScore int64 `json:"network_risk_score,required,nullable"`
// The identifier of the Pending Transaction associated with this Transaction.
PendingTransactionID string `json:"pending_transaction_id,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,required,nullable"`
// The pending amount in the minor unit of the transaction's presentment currency.
PresentmentAmount int64 `json:"presentment_amount,required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
// transaction's presentment currency.
PresentmentCurrency string `json:"presentment_currency,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 PendingTransactionSourceCardAuthorizationProcessingCategory `json:"processing_category,required"`
// The identifier of the Real-Time Decision sent to approve or decline this
// transaction.
RealTimeDecisionID string `json:"real_time_decision_id,required,nullable"`
// A constant representing the object's type. For this resource it will always be
// `card_authorization`.
Type PendingTransactionSourceCardAuthorizationType `json:"type,required"`
// Fields related to verification of cardholder-provided values.
Verification PendingTransactionSourceCardAuthorizationVerification `json:"verification,required"`
JSON pendingTransactionSourceCardAuthorizationJSON `json:"-"`
}
// pendingTransactionSourceCardAuthorizationJSON contains the JSON metadata for the
// struct [PendingTransactionSourceCardAuthorization]
type pendingTransactionSourceCardAuthorizationJSON struct {
ID apijson.Field
Actioner apijson.Field
Amount apijson.Field
CardPaymentID apijson.Field
Currency apijson.Field
DigitalWalletTokenID apijson.Field
Direction apijson.Field
ExpiresAt apijson.Field
MerchantAcceptorID apijson.Field
MerchantCategoryCode apijson.Field
MerchantCity apijson.Field
MerchantCountry apijson.Field
MerchantDescriptor apijson.Field
NetworkDetails apijson.Field
NetworkIdentifiers apijson.Field
NetworkRiskScore apijson.Field
PendingTransactionID apijson.Field
PhysicalCardID apijson.Field
PresentmentAmount apijson.Field
PresentmentCurrency apijson.Field
ProcessingCategory apijson.Field
RealTimeDecisionID apijson.Field
Type apijson.Field
Verification apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCardAuthorization) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCardAuthorizationJSON) 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 PendingTransactionSourceCardAuthorizationActioner string
const (
// This object was actioned by the user through a real-time decision.
PendingTransactionSourceCardAuthorizationActionerUser PendingTransactionSourceCardAuthorizationActioner = "user"
// This object was actioned by Increase without user intervention.
PendingTransactionSourceCardAuthorizationActionerIncrease PendingTransactionSourceCardAuthorizationActioner = "increase"
// This object was actioned by the network, through stand-in processing.
PendingTransactionSourceCardAuthorizationActionerNetwork PendingTransactionSourceCardAuthorizationActioner = "network"
)
func (r PendingTransactionSourceCardAuthorizationActioner) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationActionerUser, PendingTransactionSourceCardAuthorizationActionerIncrease, PendingTransactionSourceCardAuthorizationActionerNetwork:
return true
}
return false
}
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
// transaction's currency.
type PendingTransactionSourceCardAuthorizationCurrency string
const (
// Canadian Dollar (CAD)
PendingTransactionSourceCardAuthorizationCurrencyCad PendingTransactionSourceCardAuthorizationCurrency = "CAD"
// Swiss Franc (CHF)
PendingTransactionSourceCardAuthorizationCurrencyChf PendingTransactionSourceCardAuthorizationCurrency = "CHF"
// Euro (EUR)
PendingTransactionSourceCardAuthorizationCurrencyEur PendingTransactionSourceCardAuthorizationCurrency = "EUR"
// British Pound (GBP)
PendingTransactionSourceCardAuthorizationCurrencyGbp PendingTransactionSourceCardAuthorizationCurrency = "GBP"
// Japanese Yen (JPY)
PendingTransactionSourceCardAuthorizationCurrencyJpy PendingTransactionSourceCardAuthorizationCurrency = "JPY"
// US Dollar (USD)
PendingTransactionSourceCardAuthorizationCurrencyUsd PendingTransactionSourceCardAuthorizationCurrency = "USD"
)
func (r PendingTransactionSourceCardAuthorizationCurrency) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationCurrencyCad, PendingTransactionSourceCardAuthorizationCurrencyChf, PendingTransactionSourceCardAuthorizationCurrencyEur, PendingTransactionSourceCardAuthorizationCurrencyGbp, PendingTransactionSourceCardAuthorizationCurrencyJpy, PendingTransactionSourceCardAuthorizationCurrencyUsd:
return true
}
return false
}
// The direction descibes the direction the funds will move, either from the
// cardholder to the merchant or from the merchant to the cardholder.
type PendingTransactionSourceCardAuthorizationDirection string
const (
// A regular card authorization where funds are debited from the cardholder.
PendingTransactionSourceCardAuthorizationDirectionSettlement PendingTransactionSourceCardAuthorizationDirection = "settlement"
// A refund card authorization, sometimes referred to as a credit voucher
// authorization, where funds are credited to the cardholder.
PendingTransactionSourceCardAuthorizationDirectionRefund PendingTransactionSourceCardAuthorizationDirection = "refund"
)
func (r PendingTransactionSourceCardAuthorizationDirection) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationDirectionSettlement, PendingTransactionSourceCardAuthorizationDirectionRefund:
return true
}
return false
}
// Fields specific to the `network`.
type PendingTransactionSourceCardAuthorizationNetworkDetails struct {
// The payment network used to process this card authorization.
Category PendingTransactionSourceCardAuthorizationNetworkDetailsCategory `json:"category,required"`
// Fields specific to the `visa` network.
Visa PendingTransactionSourceCardAuthorizationNetworkDetailsVisa `json:"visa,required,nullable"`
JSON pendingTransactionSourceCardAuthorizationNetworkDetailsJSON `json:"-"`
}
// pendingTransactionSourceCardAuthorizationNetworkDetailsJSON contains the JSON
// metadata for the struct
// [PendingTransactionSourceCardAuthorizationNetworkDetails]
type pendingTransactionSourceCardAuthorizationNetworkDetailsJSON struct {
Category apijson.Field
Visa apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCardAuthorizationNetworkDetails) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCardAuthorizationNetworkDetailsJSON) RawJSON() string {
return r.raw
}
// The payment network used to process this card authorization.
type PendingTransactionSourceCardAuthorizationNetworkDetailsCategory string
const (
// Visa
PendingTransactionSourceCardAuthorizationNetworkDetailsCategoryVisa PendingTransactionSourceCardAuthorizationNetworkDetailsCategory = "visa"
)
func (r PendingTransactionSourceCardAuthorizationNetworkDetailsCategory) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationNetworkDetailsCategoryVisa:
return true
}
return false
}
// Fields specific to the `visa` network.
type PendingTransactionSourceCardAuthorizationNetworkDetailsVisa 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 PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator `json:"electronic_commerce_indicator,required,nullable"`
// The method used to enter the cardholder's primary account number and card
// expiration date.
PointOfServiceEntryMode PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode `json:"point_of_service_entry_mode,required,nullable"`
JSON pendingTransactionSourceCardAuthorizationNetworkDetailsVisaJSON `json:"-"`
}
// pendingTransactionSourceCardAuthorizationNetworkDetailsVisaJSON contains the
// JSON metadata for the struct
// [PendingTransactionSourceCardAuthorizationNetworkDetailsVisa]
type pendingTransactionSourceCardAuthorizationNetworkDetailsVisaJSON struct {
ElectronicCommerceIndicator apijson.Field
PointOfServiceEntryMode apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCardAuthorizationNetworkDetailsVisa) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCardAuthorizationNetworkDetailsVisaJSON) RawJSON() string {
return r.raw
}
// 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.
type PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator string
const (
// Single transaction of a mail/phone order: Use to indicate that the transaction
// is a mail/phone order purchase, not a recurring transaction or installment
// payment. For domestic transactions in the US region, this value may also
// indicate one bill payment transaction in the card-present or card-absent
// environments.
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorMailPhoneOrder PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "mail_phone_order"
// Recurring transaction: Payment indicator used to indicate a recurring
// transaction that originates from an acquirer in the US region.
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorRecurring PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "recurring"
// Installment payment: Payment indicator used to indicate one purchase of goods or
// services that is billed to the account in multiple charges over a period of time
// agreed upon by the cardholder and merchant from transactions that originate from
// an acquirer in the US region.
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorInstallment PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "installment"
// Unknown classification: other mail order: Use to indicate that the type of
// mail/telephone order is unknown.
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorUnknownMailPhoneOrder PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "unknown_mail_phone_order"
// Secure electronic commerce transaction: Use to indicate that the electronic
// commerce transaction has been authenticated using e.g., 3-D Secure
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorSecureElectronicCommerce PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "secure_electronic_commerce"
// Non-authenticated security transaction at a 3-D Secure-capable merchant, and
// merchant attempted to authenticate the cardholder using 3-D Secure: Use to
// identify an electronic commerce transaction where the merchant attempted to
// authenticate the cardholder using 3-D Secure, but was unable to complete the
// authentication because the issuer or cardholder does not participate in the 3-D
// Secure program.
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorNonAuthenticatedSecurityTransactionAt3DSCapableMerchant PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "non_authenticated_security_transaction_at_3ds_capable_merchant"
// Non-authenticated security transaction: Use to identify an electronic commerce
// transaction that uses data encryption for security however , cardholder
// authentication is not performed using 3-D Secure.
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorNonAuthenticatedSecurityTransaction PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "non_authenticated_security_transaction"
// Non-secure transaction: Use to identify an electronic commerce transaction that
// has no data protection.
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorNonSecureTransaction PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator = "non_secure_transaction"
)
func (r PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicator) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorMailPhoneOrder, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorRecurring, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorInstallment, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorUnknownMailPhoneOrder, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorSecureElectronicCommerce, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorNonAuthenticatedSecurityTransactionAt3DSCapableMerchant, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorNonAuthenticatedSecurityTransaction, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaElectronicCommerceIndicatorNonSecureTransaction:
return true
}
return false
}
// The method used to enter the cardholder's primary account number and card
// expiration date.
type PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode string
const (
// Unknown
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeUnknown PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "unknown"
// Manual key entry
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeManual PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "manual"
// Magnetic stripe read, without card verification value
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeMagneticStripeNoCvv PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "magnetic_stripe_no_cvv"
// Optical code
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeOpticalCode PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "optical_code"
// Contact chip card
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeIntegratedCircuitCard PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "integrated_circuit_card"
// Contactless read of chip card
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeContactless PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "contactless"
// Transaction initiated using a credential that has previously been stored on file
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeCredentialOnFile PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "credential_on_file"
// Magnetic stripe read
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeMagneticStripe PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "magnetic_stripe"
// Contactless read of magnetic stripe data
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeContactlessMagneticStripe PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "contactless_magnetic_stripe"
// Contact chip card, without card verification value
PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeIntegratedCircuitCardNoCvv PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode = "integrated_circuit_card_no_cvv"
)
func (r PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryMode) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeUnknown, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeManual, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeMagneticStripeNoCvv, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeOpticalCode, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeIntegratedCircuitCard, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeContactless, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeCredentialOnFile, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeMagneticStripe, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeContactlessMagneticStripe, PendingTransactionSourceCardAuthorizationNetworkDetailsVisaPointOfServiceEntryModeIntegratedCircuitCardNoCvv:
return true
}
return false
}
// Network-specific identifiers for a specific request or transaction.
type PendingTransactionSourceCardAuthorizationNetworkIdentifiers struct {
// A life-cycle identifier used across e.g., an authorization and a reversal.
// Expected to be unique per acquirer within a window of time. For some card
// networks the retrieval reference number includes the trace counter.
RetrievalReferenceNumber string `json:"retrieval_reference_number,required,nullable"`
// A counter used to verify an individual authorization. Expected to be unique per
// acquirer within a window of time.
TraceNumber string `json:"trace_number,required,nullable"`
// A globally unique transaction identifier provided by the card network, used
// across multiple life-cycle requests.
TransactionID string `json:"transaction_id,required,nullable"`
JSON pendingTransactionSourceCardAuthorizationNetworkIdentifiersJSON `json:"-"`
}
// pendingTransactionSourceCardAuthorizationNetworkIdentifiersJSON contains the
// JSON metadata for the struct
// [PendingTransactionSourceCardAuthorizationNetworkIdentifiers]
type pendingTransactionSourceCardAuthorizationNetworkIdentifiersJSON struct {
RetrievalReferenceNumber apijson.Field
TraceNumber apijson.Field
TransactionID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCardAuthorizationNetworkIdentifiers) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCardAuthorizationNetworkIdentifiersJSON) RawJSON() string {
return r.raw
}
// The processing category describes the intent behind the authorization, such as
// whether it was used for bill payments or an automatic fuel dispenser.
type PendingTransactionSourceCardAuthorizationProcessingCategory string
const (
// Account funding transactions are transactions used to e.g., fund an account or
// transfer funds between accounts.
PendingTransactionSourceCardAuthorizationProcessingCategoryAccountFunding PendingTransactionSourceCardAuthorizationProcessingCategory = "account_funding"
// Automatic fuel dispenser authorizations occur when a card is used at a gas pump,
// prior to the actual transaction amount being known. They are followed by an
// advice message that updates the amount of the pending transaction.
PendingTransactionSourceCardAuthorizationProcessingCategoryAutomaticFuelDispenser PendingTransactionSourceCardAuthorizationProcessingCategory = "automatic_fuel_dispenser"
// A transaction used to pay a bill.
PendingTransactionSourceCardAuthorizationProcessingCategoryBillPayment PendingTransactionSourceCardAuthorizationProcessingCategory = "bill_payment"
// A regular purchase.
PendingTransactionSourceCardAuthorizationProcessingCategoryPurchase PendingTransactionSourceCardAuthorizationProcessingCategory = "purchase"
// Quasi-cash transactions represent purchases of items which may be convertible to
// cash.
PendingTransactionSourceCardAuthorizationProcessingCategoryQuasiCash PendingTransactionSourceCardAuthorizationProcessingCategory = "quasi_cash"
// A refund card authorization, sometimes referred to as a credit voucher
// authorization, where funds are credited to the cardholder.
PendingTransactionSourceCardAuthorizationProcessingCategoryRefund PendingTransactionSourceCardAuthorizationProcessingCategory = "refund"
)
func (r PendingTransactionSourceCardAuthorizationProcessingCategory) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationProcessingCategoryAccountFunding, PendingTransactionSourceCardAuthorizationProcessingCategoryAutomaticFuelDispenser, PendingTransactionSourceCardAuthorizationProcessingCategoryBillPayment, PendingTransactionSourceCardAuthorizationProcessingCategoryPurchase, PendingTransactionSourceCardAuthorizationProcessingCategoryQuasiCash, PendingTransactionSourceCardAuthorizationProcessingCategoryRefund:
return true
}
return false
}
// A constant representing the object's type. For this resource it will always be
// `card_authorization`.
type PendingTransactionSourceCardAuthorizationType string
const (
PendingTransactionSourceCardAuthorizationTypeCardAuthorization PendingTransactionSourceCardAuthorizationType = "card_authorization"
)
func (r PendingTransactionSourceCardAuthorizationType) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationTypeCardAuthorization:
return true
}
return false
}
// Fields related to verification of cardholder-provided values.
type PendingTransactionSourceCardAuthorizationVerification struct {
// Fields related to verification of the Card Verification Code, a 3-digit code on
// the back of the card.
CardVerificationCode PendingTransactionSourceCardAuthorizationVerificationCardVerificationCode `json:"card_verification_code,required"`
// Cardholder address provided in the authorization request and the address on file
// we verified it against.
CardholderAddress PendingTransactionSourceCardAuthorizationVerificationCardholderAddress `json:"cardholder_address,required"`
JSON pendingTransactionSourceCardAuthorizationVerificationJSON `json:"-"`
}
// pendingTransactionSourceCardAuthorizationVerificationJSON contains the JSON
// metadata for the struct [PendingTransactionSourceCardAuthorizationVerification]
type pendingTransactionSourceCardAuthorizationVerificationJSON struct {
CardVerificationCode apijson.Field
CardholderAddress apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCardAuthorizationVerification) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCardAuthorizationVerificationJSON) RawJSON() string {
return r.raw
}
// Fields related to verification of the Card Verification Code, a 3-digit code on
// the back of the card.
type PendingTransactionSourceCardAuthorizationVerificationCardVerificationCode struct {
// The result of verifying the Card Verification Code.
Result PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResult `json:"result,required"`
JSON pendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeJSON `json:"-"`
}
// pendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeJSON
// contains the JSON metadata for the struct
// [PendingTransactionSourceCardAuthorizationVerificationCardVerificationCode]
type pendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeJSON struct {
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCardAuthorizationVerificationCardVerificationCode) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeJSON) RawJSON() string {
return r.raw
}
// The result of verifying the Card Verification Code.
type PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResult string
const (
// No card verification code was provided in the authorization request.
PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResultNotChecked PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResult = "not_checked"
// The card verification code matched the one on file.
PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResultMatch PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResult = "match"
// The card verification code did not match the one on file.
PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResultNoMatch PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResult = "no_match"
)
func (r PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResult) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResultNotChecked, PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResultMatch, PendingTransactionSourceCardAuthorizationVerificationCardVerificationCodeResultNoMatch:
return true
}
return false
}
// Cardholder address provided in the authorization request and the address on file
// we verified it against.
type PendingTransactionSourceCardAuthorizationVerificationCardholderAddress struct {
// Line 1 of the address on file for the cardholder.
ActualLine1 string `json:"actual_line1,required,nullable"`
// The postal code of the address on file for the cardholder.
ActualPostalCode string `json:"actual_postal_code,required,nullable"`
// The cardholder address line 1 provided for verification in the authorization
// request.
ProvidedLine1 string `json:"provided_line1,required,nullable"`
// The postal code provided for verification in the authorization request.
ProvidedPostalCode string `json:"provided_postal_code,required,nullable"`
// The address verification result returned to the card network.
Result PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult `json:"result,required"`
JSON pendingTransactionSourceCardAuthorizationVerificationCardholderAddressJSON `json:"-"`
}
// pendingTransactionSourceCardAuthorizationVerificationCardholderAddressJSON
// contains the JSON metadata for the struct
// [PendingTransactionSourceCardAuthorizationVerificationCardholderAddress]
type pendingTransactionSourceCardAuthorizationVerificationCardholderAddressJSON struct {
ActualLine1 apijson.Field
ActualPostalCode apijson.Field
ProvidedLine1 apijson.Field
ProvidedPostalCode apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCardAuthorizationVerificationCardholderAddress) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCardAuthorizationVerificationCardholderAddressJSON) RawJSON() string {
return r.raw
}
// The address verification result returned to the card network.
type PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult string
const (
// No adress was provided in the authorization request.
PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultNotChecked PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult = "not_checked"
// Postal code matches, but the street address was not verified.
PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultPostalCodeMatchAddressNotChecked PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult = "postal_code_match_address_not_checked"
// Postal code matches, but the street address does not match.
PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultPostalCodeMatchAddressNoMatch PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult = "postal_code_match_address_no_match"
// Postal code does not match, but the street address matches.
PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultPostalCodeNoMatchAddressMatch PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult = "postal_code_no_match_address_match"
// Postal code and street address match.
PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultMatch PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult = "match"
// Postal code and street address do not match.
PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultNoMatch PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult = "no_match"
)
func (r PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResult) IsKnown() bool {
switch r {
case PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultNotChecked, PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultPostalCodeMatchAddressNotChecked, PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultPostalCodeMatchAddressNoMatch, PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultPostalCodeNoMatchAddressMatch, PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultMatch, PendingTransactionSourceCardAuthorizationVerificationCardholderAddressResultNoMatch:
return true
}
return false
}
// 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 PendingTransactionSourceCategory string
const (
// Account Transfer Instruction: details will be under the
// `account_transfer_instruction` object.
PendingTransactionSourceCategoryAccountTransferInstruction PendingTransactionSourceCategory = "account_transfer_instruction"
// ACH Transfer Instruction: details will be under the `ach_transfer_instruction`
// object.
PendingTransactionSourceCategoryACHTransferInstruction PendingTransactionSourceCategory = "ach_transfer_instruction"
// Card Authorization: details will be under the `card_authorization` object.
PendingTransactionSourceCategoryCardAuthorization PendingTransactionSourceCategory = "card_authorization"
// Check Deposit Instruction: details will be under the `check_deposit_instruction`
// object.
PendingTransactionSourceCategoryCheckDepositInstruction PendingTransactionSourceCategory = "check_deposit_instruction"
// Check Transfer Instruction: details will be under the
// `check_transfer_instruction` object.
PendingTransactionSourceCategoryCheckTransferInstruction PendingTransactionSourceCategory = "check_transfer_instruction"
// Inbound Funds Hold: details will be under the `inbound_funds_hold` object.
PendingTransactionSourceCategoryInboundFundsHold PendingTransactionSourceCategory = "inbound_funds_hold"
// Real-Time Payments Transfer Instruction: details will be under the
// `real_time_payments_transfer_instruction` object.
PendingTransactionSourceCategoryRealTimePaymentsTransferInstruction PendingTransactionSourceCategory = "real_time_payments_transfer_instruction"
// Wire Transfer Instruction: details will be under the `wire_transfer_instruction`
// object.
PendingTransactionSourceCategoryWireTransferInstruction PendingTransactionSourceCategory = "wire_transfer_instruction"
// The Pending Transaction was made for an undocumented or deprecated reason.
PendingTransactionSourceCategoryOther PendingTransactionSourceCategory = "other"
)
func (r PendingTransactionSourceCategory) IsKnown() bool {
switch r {
case PendingTransactionSourceCategoryAccountTransferInstruction, PendingTransactionSourceCategoryACHTransferInstruction, PendingTransactionSourceCategoryCardAuthorization, PendingTransactionSourceCategoryCheckDepositInstruction, PendingTransactionSourceCategoryCheckTransferInstruction, PendingTransactionSourceCategoryInboundFundsHold, PendingTransactionSourceCategoryRealTimePaymentsTransferInstruction, PendingTransactionSourceCategoryWireTransferInstruction, PendingTransactionSourceCategoryOther:
return true
}
return false
}
// A Check Deposit Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `check_deposit_instruction`.
type PendingTransactionSourceCheckDepositInstruction struct {
// The pending amount in the minor unit of the transaction's currency. For dollars,
// for example, this is cents.
Amount int64 `json:"amount,required"`
// The identifier of the File containing the image of the back of the check that
// was deposited.
BackImageFileID string `json:"back_image_file_id,required,nullable"`
// The identifier of the Check Deposit.
CheckDepositID string `json:"check_deposit_id,required,nullable"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
// transaction's currency.
Currency PendingTransactionSourceCheckDepositInstructionCurrency `json:"currency,required"`
// The identifier of the File containing the image of the front of the check that
// was deposited.
FrontImageFileID string `json:"front_image_file_id,required"`
JSON pendingTransactionSourceCheckDepositInstructionJSON `json:"-"`
}
// pendingTransactionSourceCheckDepositInstructionJSON contains the JSON metadata
// for the struct [PendingTransactionSourceCheckDepositInstruction]
type pendingTransactionSourceCheckDepositInstructionJSON struct {
Amount apijson.Field
BackImageFileID apijson.Field
CheckDepositID apijson.Field
Currency apijson.Field
FrontImageFileID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PendingTransactionSourceCheckDepositInstruction) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r pendingTransactionSourceCheckDepositInstructionJSON) RawJSON() string {
return r.raw
}
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
// transaction's currency.
type PendingTransactionSourceCheckDepositInstructionCurrency string
const (
// Canadian Dollar (CAD)
PendingTransactionSourceCheckDepositInstructionCurrencyCad PendingTransactionSourceCheckDepositInstructionCurrency = "CAD"
// Swiss Franc (CHF)
PendingTransactionSourceCheckDepositInstructionCurrencyChf PendingTransactionSourceCheckDepositInstructionCurrency = "CHF"
// Euro (EUR)
PendingTransactionSourceCheckDepositInstructionCurrencyEur PendingTransactionSourceCheckDepositInstructionCurrency = "EUR"
// British Pound (GBP)
PendingTransactionSourceCheckDepositInstructionCurrencyGbp PendingTransactionSourceCheckDepositInstructionCurrency = "GBP"
// Japanese Yen (JPY)
PendingTransactionSourceCheckDepositInstructionCurrencyJpy PendingTransactionSourceCheckDepositInstructionCurrency = "JPY"
// US Dollar (USD)
PendingTransactionSourceCheckDepositInstructionCurrencyUsd PendingTransactionSourceCheckDepositInstructionCurrency = "USD"
)
func (r PendingTransactionSourceCheckDepositInstructionCurrency) IsKnown() bool {
switch r {
case PendingTransactionSourceCheckDepositInstructionCurrencyCad, PendingTransactionSourceCheckDepositInstructionCurrencyChf, PendingTransactionSourceCheckDepositInstructionCurrencyEur, PendingTransactionSourceCheckDepositInstructionCurrencyGbp, PendingTransactionSourceCheckDepositInstructionCurrencyJpy, PendingTransactionSourceCheckDepositInstructionCurrencyUsd:
return true
}
return false
}
// A Check Transfer Instruction object. This field will be present in the JSON
// response if and only if `category` is equal to `check_transfer_instruction`.
type PendingTransactionSourceCheckTransferInstruction struct {
// The pending amount in the minor unit of the transaction's currency. For dollars,
// for example, this is cents.
Amount int64 `json:"amount,required"`
// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's
// currency.
Currency PendingTransactionSourceCheckTransferInstructionCurrency `json:"currency,required"`
// The identifier of the Check Transfer that led to this Pending Transaction.
TransferID string `json:"transfer_id,required"`
JSON pendingTransactionSourceCheckTransferInstructionJSON `json:"-"`