-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathreal-time-decisions.ts
More file actions
2598 lines (2314 loc) · 88.5 KB
/
real-time-decisions.ts
File metadata and controls
2598 lines (2314 loc) · 88.5 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.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';
export class RealTimeDecisions extends APIResource {
/**
* Retrieve a Real-Time Decision
*
* @example
* ```ts
* const realTimeDecision =
* await client.realTimeDecisions.retrieve(
* 'real_time_decision_j76n2e810ezcg3zh5qtn',
* );
* ```
*/
retrieve(realTimeDecisionID: string, options?: RequestOptions): APIPromise<RealTimeDecision> {
return this._client.get(path`/real_time_decisions/${realTimeDecisionID}`, options);
}
/**
* Action a Real-Time Decision
*
* @example
* ```ts
* const realTimeDecision =
* await client.realTimeDecisions.action(
* 'real_time_decision_j76n2e810ezcg3zh5qtn',
* );
* ```
*/
action(
realTimeDecisionID: string,
body: RealTimeDecisionActionParams,
options?: RequestOptions,
): APIPromise<RealTimeDecision> {
return this._client.post(path`/real_time_decisions/${realTimeDecisionID}/action`, { body, ...options });
}
}
/**
* Real Time Decisions are created when your application needs to take action in
* real-time to some event such as a card authorization. For more information, see
* our
* [Real-Time Decisions guide](https://increase.com/documentation/real-time-decisions).
*/
export interface RealTimeDecision {
/**
* The Real-Time Decision identifier.
*/
id: string;
/**
* Fields related to a 3DS authentication attempt.
*/
card_authentication: RealTimeDecision.CardAuthentication | null;
/**
* Fields related to a 3DS authentication attempt.
*/
card_authentication_challenge: RealTimeDecision.CardAuthenticationChallenge | null;
/**
* Fields related to a card authorization.
*/
card_authorization: RealTimeDecision.CardAuthorization | null;
/**
* Fields related to a card balance inquiry.
*/
card_balance_inquiry: RealTimeDecision.CardBalanceInquiry | null;
/**
* The category of the Real-Time Decision.
*
* - `card_authorization_requested` - A card is being authorized.
* - `card_balance_inquiry_requested` - A balance inquiry is being made on a card.
* - `card_authentication_requested` - 3DS authentication is requested.
* - `card_authentication_challenge_requested` - 3DS authentication challenge
* requires cardholder involvement.
* - `digital_wallet_token_requested` - A card is being loaded into a digital
* wallet.
* - `digital_wallet_authentication_requested` - A card is being loaded into a
* digital wallet and requires cardholder authentication.
*/
category:
| 'card_authorization_requested'
| 'card_balance_inquiry_requested'
| 'card_authentication_requested'
| 'card_authentication_challenge_requested'
| 'digital_wallet_token_requested'
| 'digital_wallet_authentication_requested';
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
* the Real-Time Decision was created.
*/
created_at: string;
/**
* Fields related to a digital wallet authentication attempt.
*/
digital_wallet_authentication: RealTimeDecision.DigitalWalletAuthentication | null;
/**
* Fields related to a digital wallet token provisioning attempt.
*/
digital_wallet_token: RealTimeDecision.DigitalWalletToken | null;
/**
* The status of the Real-Time Decision.
*
* - `pending` - The decision is pending action via real-time webhook.
* - `responded` - Your webhook actioned the real-time decision.
* - `timed_out` - Your webhook failed to respond to the authorization in time.
*/
status: 'pending' | 'responded' | 'timed_out';
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
* your application can no longer respond to the Real-Time Decision.
*/
timeout_at: string;
/**
* A constant representing the object's type. For this resource it will always be
* `real_time_decision`.
*/
type: 'real_time_decision';
}
export namespace RealTimeDecision {
/**
* Fields related to a 3DS authentication attempt.
*/
export interface CardAuthentication {
/**
* A unique identifier assigned by the Access Control Server (us) for this
* transaction.
*/
access_control_server_transaction_identifier: string;
/**
* The identifier of the Account the card belongs to.
*/
account_id: string;
/**
* The city of the cardholder billing address associated with the card used for
* this purchase.
*/
billing_address_city: string | null;
/**
* The country of the cardholder billing address associated with the card used for
* this purchase.
*/
billing_address_country: string | null;
/**
* The first line of the cardholder billing address associated with the card used
* for this purchase.
*/
billing_address_line1: string | null;
/**
* The second line of the cardholder billing address associated with the card used
* for this purchase.
*/
billing_address_line2: string | null;
/**
* The third line of the cardholder billing address associated with the card used
* for this purchase.
*/
billing_address_line3: string | null;
/**
* The postal code of the cardholder billing address associated with the card used
* for this purchase.
*/
billing_address_postal_code: string | null;
/**
* The US state of the cardholder billing address associated with the card used for
* this purchase.
*/
billing_address_state: string | null;
/**
* The identifier of the Card.
*/
card_id: string;
/**
* The email address of the cardholder.
*/
cardholder_email: string | null;
/**
* The name of the cardholder.
*/
cardholder_name: string | null;
/**
* Whether or not the authentication attempt was approved.
*
* - `approve` - Approve the authentication attempt without triggering a challenge.
* - `challenge` - Request further validation before approving the authentication
* attempt.
* - `deny` - Deny the authentication attempt.
*/
decision: 'approve' | 'challenge' | 'deny' | null;
/**
* The device channel of the card authentication attempt.
*/
device_channel: CardAuthentication.DeviceChannel;
/**
* A unique identifier assigned by the Directory Server (the card network) for this
* transaction.
*/
directory_server_transaction_identifier: string;
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card
* is transacting with.
*/
merchant_acceptor_id: string | null;
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the
* card is transacting with.
*/
merchant_category_code: string | null;
/**
* The country the merchant resides in.
*/
merchant_country: string | null;
/**
* The name of the merchant.
*/
merchant_name: string | null;
/**
* The message category of the card authentication attempt.
*/
message_category: CardAuthentication.MessageCategory;
/**
* The ID of a prior Card Authentication that the requestor used to authenticate
* this cardholder for a previous transaction.
*/
prior_authenticated_card_payment_id: string | null;
/**
* The 3DS requestor authentication indicator describes why the authentication
* attempt is performed, such as for a recurring transaction.
*
* - `payment_transaction` - The authentication is for a payment transaction.
* - `recurring_transaction` - The authentication is for a recurring transaction.
* - `installment_transaction` - The authentication is for an installment
* transaction.
* - `add_card` - The authentication is for adding a card.
* - `maintain_card` - The authentication is for maintaining a card.
* - `emv_token_cardholder_verification` - The authentication is for EMV token
* cardholder verification.
* - `billing_agreement` - The authentication is for a billing agreement.
*/
requestor_authentication_indicator:
| 'payment_transaction'
| 'recurring_transaction'
| 'installment_transaction'
| 'add_card'
| 'maintain_card'
| 'emv_token_cardholder_verification'
| 'billing_agreement'
| null;
/**
* Indicates whether a challenge is requested for this transaction.
*
* - `no_preference` - No preference.
* - `no_challenge_requested` - No challenge requested.
* - `challenge_requested_3ds_requestor_preference` - Challenge requested, 3DS
* Requestor preference.
* - `challenge_requested_mandate` - Challenge requested, mandate.
* - `no_challenge_requested_transactional_risk_analysis_already_performed` - No
* challenge requested, transactional risk analysis already performed.
* - `no_challenge_requested_data_share_only` - No challenge requested, data share
* only.
* - `no_challenge_requested_strong_consumer_authentication_already_performed` - No
* challenge requested, strong consumer authentication already performed.
* - `no_challenge_requested_utilize_whitelist_exemption_if_no_challenge_required` -
* No challenge requested, utilize whitelist exemption if no challenge required.
* - `challenge_requested_whitelist_prompt_requested_if_challenge_required` -
* Challenge requested, whitelist prompt requested if challenge required.
*/
requestor_challenge_indicator:
| 'no_preference'
| 'no_challenge_requested'
| 'challenge_requested_3ds_requestor_preference'
| 'challenge_requested_mandate'
| 'no_challenge_requested_transactional_risk_analysis_already_performed'
| 'no_challenge_requested_data_share_only'
| 'no_challenge_requested_strong_consumer_authentication_already_performed'
| 'no_challenge_requested_utilize_whitelist_exemption_if_no_challenge_required'
| 'challenge_requested_whitelist_prompt_requested_if_challenge_required'
| null;
/**
* The name of the 3DS requestor.
*/
requestor_name: string;
/**
* The URL of the 3DS requestor.
*/
requestor_url: string;
/**
* The city of the shipping address associated with this purchase.
*/
shipping_address_city: string | null;
/**
* The country of the shipping address associated with this purchase.
*/
shipping_address_country: string | null;
/**
* The first line of the shipping address associated with this purchase.
*/
shipping_address_line1: string | null;
/**
* The second line of the shipping address associated with this purchase.
*/
shipping_address_line2: string | null;
/**
* The third line of the shipping address associated with this purchase.
*/
shipping_address_line3: string | null;
/**
* The postal code of the shipping address associated with this purchase.
*/
shipping_address_postal_code: string | null;
/**
* The US state of the shipping address associated with this purchase.
*/
shipping_address_state: string | null;
/**
* A unique identifier assigned by the 3DS Server initiating the authentication
* attempt for this transaction.
*/
three_d_secure_server_transaction_identifier: string;
/**
* The identifier of the Card Payment this authentication attempt will belong to.
* Available in the API once the card authentication has completed.
*/
upcoming_card_payment_id: string;
}
export namespace CardAuthentication {
/**
* The device channel of the card authentication attempt.
*/
export interface DeviceChannel {
/**
* Fields specific to the browser device channel.
*/
browser: DeviceChannel.Browser | null;
/**
* The category of the device channel.
*
* - `app` - The authentication attempt was made from an app.
* - `browser` - The authentication attempt was made from a browser.
* - `three_ds_requestor_initiated` - The authentication attempt was initiated by
* the 3DS Requestor.
*/
category: 'app' | 'browser' | 'three_ds_requestor_initiated';
/**
* Fields specific to merchant initiated transactions.
*/
merchant_initiated: DeviceChannel.MerchantInitiated | null;
}
export namespace DeviceChannel {
/**
* Fields specific to the browser device channel.
*/
export interface Browser {
/**
* The accept header from the cardholder's browser.
*/
accept_header: string | null;
/**
* The IP address of the cardholder's browser.
*/
ip_address: string | null;
/**
* Whether JavaScript is enabled in the cardholder's browser.
*
* - `enabled` - JavaScript is enabled in the cardholder's browser.
* - `disabled` - JavaScript is not enabled in the cardholder's browser.
*/
javascript_enabled: 'enabled' | 'disabled' | null;
/**
* The language of the cardholder's browser.
*/
language: string | null;
/**
* The user agent of the cardholder's browser.
*/
user_agent: string | null;
}
/**
* Fields specific to merchant initiated transactions.
*/
export interface MerchantInitiated {
/**
* The merchant initiated indicator for the transaction.
*
* - `recurring_transaction` - Recurring transaction.
* - `installment_transaction` - Installment transaction.
* - `add_card` - Add card.
* - `maintain_card_information` - Maintain card information.
* - `account_verification` - Account verification.
* - `split_delayed_shipment` - Split or delayed shipment.
* - `top_up` - Top up.
* - `mail_order` - Mail order.
* - `telephone_order` - Telephone order.
* - `whitelist_status_check` - Whitelist status check.
* - `other_payment` - Other payment.
* - `billing_agreement` - Billing agreement.
* - `device_binding_status_check` - Device binding status check.
* - `card_security_code_status_check` - Card security code status check.
* - `delayed_shipment` - Delayed shipment.
* - `split_payment` - Split payment.
* - `fido_credential_deletion` - FIDO credential deletion.
* - `fido_credential_registration` - FIDO credential registration.
* - `decoupled_authentication_fallback` - Decoupled authentication fallback.
*/
indicator:
| 'recurring_transaction'
| 'installment_transaction'
| 'add_card'
| 'maintain_card_information'
| 'account_verification'
| 'split_delayed_shipment'
| 'top_up'
| 'mail_order'
| 'telephone_order'
| 'whitelist_status_check'
| 'other_payment'
| 'billing_agreement'
| 'device_binding_status_check'
| 'card_security_code_status_check'
| 'delayed_shipment'
| 'split_payment'
| 'fido_credential_deletion'
| 'fido_credential_registration'
| 'decoupled_authentication_fallback';
}
}
/**
* The message category of the card authentication attempt.
*/
export interface MessageCategory {
/**
* The category of the card authentication attempt.
*
* - `payment_authentication` - The authentication attempt is for a payment.
* - `non_payment_authentication` - The authentication attempt is not for a
* payment.
*/
category: 'payment_authentication' | 'non_payment_authentication';
/**
* Fields specific to non-payment authentication attempts.
*/
non_payment: MessageCategory.NonPayment | null;
/**
* Fields specific to payment authentication attempts.
*/
payment: MessageCategory.Payment | null;
}
export namespace MessageCategory {
/**
* Fields specific to non-payment authentication attempts.
*/
export interface NonPayment {}
/**
* Fields specific to payment authentication attempts.
*/
export interface Payment {
/**
* The purchase amount in minor units.
*/
purchase_amount: number;
/**
* The purchase amount in the cardholder's currency (i.e., USD) estimated using
* daily conversion rates from the card network.
*/
purchase_amount_cardholder_estimated: number | null;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
* authentication attempt's purchase currency.
*/
purchase_currency: string;
/**
* The type of transaction being authenticated.
*
* - `goods_service_purchase` - Purchase of goods or services.
* - `check_acceptance` - Check acceptance.
* - `account_funding` - Account funding.
* - `quasi_cash_transaction` - Quasi-cash transaction.
* - `prepaid_activation_and_load` - Prepaid activation and load.
*/
transaction_type:
| 'goods_service_purchase'
| 'check_acceptance'
| 'account_funding'
| 'quasi_cash_transaction'
| 'prepaid_activation_and_load'
| null;
}
}
}
/**
* Fields related to a 3DS authentication attempt.
*/
export interface CardAuthenticationChallenge {
/**
* The identifier of the Account the card belongs to.
*/
account_id: string;
/**
* The identifier of the Card that is being tokenized.
*/
card_id: string;
/**
* The identifier of the Card Payment this authentication challenge attempt belongs
* to.
*/
card_payment_id: string;
/**
* The one-time code delivered to the cardholder.
*/
one_time_code: string;
/**
* Whether or not the challenge was delivered to the cardholder.
*
* - `success` - Your application successfully delivered the one-time code to the
* cardholder.
* - `failure` - Your application was unable to deliver the one-time code to the
* cardholder.
*/
result: 'success' | 'failure' | null;
}
/**
* Fields related to a card authorization.
*/
export interface CardAuthorization {
/**
* The identifier of the Account the authorization will debit.
*/
account_id: string;
/**
* 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.
*/
additional_amounts: CardAuthorization.AdditionalAmounts;
/**
* Present if and only if `decision` is `approve`. Contains information related to
* the approval of the authorization.
*/
approval: CardAuthorization.Approval | null;
/**
* The identifier of the Card that is being authorized.
*/
card_id: string;
/**
* Whether or not the authorization was approved.
*
* - `approve` - Approve the authorization.
* - `decline` - Decline the authorization.
*/
decision: 'approve' | 'decline' | null;
/**
* Present if and only if `decision` is `decline`. Contains information related to
* the reason the authorization was declined.
*/
decline: CardAuthorization.Decline | null;
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
digital_wallet_token_id: string | null;
/**
* The direction describes the direction the funds will move, either from the
* cardholder to the merchant or from the merchant to the cardholder.
*
* - `settlement` - A regular card authorization where funds are debited from the
* cardholder.
* - `refund` - A refund card authorization, sometimes referred to as a credit
* voucher authorization, where funds are credited to the cardholder.
*/
direction: 'settlement' | 'refund';
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card
* is transacting with.
*/
merchant_acceptor_id: string;
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the
* card is transacting with.
*/
merchant_category_code: string;
/**
* The city the merchant resides in.
*/
merchant_city: string | null;
/**
* The country the merchant resides in.
*/
merchant_country: string;
/**
* The merchant descriptor of the merchant the card is transacting with.
*/
merchant_descriptor: string;
/**
* 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.
*/
merchant_postal_code: string | null;
/**
* The state the merchant resides in.
*/
merchant_state: string | null;
/**
* Fields specific to the `network`.
*/
network_details: CardAuthorization.NetworkDetails;
/**
* Network-specific identifiers for a specific request or transaction.
*/
network_identifiers: CardAuthorization.NetworkIdentifiers;
/**
* 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.
*/
network_risk_score: number | null;
/**
* Whether or not the authorization supports partial approvals.
*
* - `supported` - This transaction supports partial approvals.
* - `not_supported` - This transaction does not support partial approvals.
*/
partial_approval_capability: 'supported' | 'not_supported';
/**
* If the authorization was made in-person with a physical card, the Physical Card
* that was used.
*/
physical_card_id: string | null;
/**
* The amount of the attempted authorization in the currency the card user sees at
* the time of purchase, in the minor unit of that currency. For dollars, for
* example, this is cents.
*/
presentment_amount: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the currency the
* user sees at the time of purchase.
*/
presentment_currency: string;
/**
* The processing category describes the intent behind the authorization, such as
* whether it was used for bill payments or an automatic fuel dispenser.
*
* - `account_funding` - Account funding transactions are transactions used to
* e.g., fund an account or transfer funds between accounts.
* - `automatic_fuel_dispenser` - 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.
* - `bill_payment` - A transaction used to pay a bill.
* - `original_credit` - Original credit transactions are used to send money to a
* cardholder.
* - `purchase` - A regular purchase.
* - `quasi_cash` - Quasi-cash transactions represent purchases of items which may
* be convertible to cash.
* - `refund` - A refund card authorization, sometimes referred to as a credit
* voucher authorization, where funds are credited to the cardholder.
* - `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
* from an ATM or a point of sale.
* - `balance_inquiry` - A balance inquiry transaction is used to check the balance
* of an account associated with a card.
* - `unknown` - The processing category is unknown.
*/
processing_category:
| 'account_funding'
| 'automatic_fuel_dispenser'
| 'bill_payment'
| 'original_credit'
| 'purchase'
| 'quasi_cash'
| 'refund'
| 'cash_disbursement'
| 'balance_inquiry'
| 'unknown';
/**
* Fields specific to the type of request, such as an incremental authorization.
*/
request_details: CardAuthorization.RequestDetails;
/**
* The amount of the attempted authorization in the currency it will be settled in.
* This currency is the same as that of the Account the card belongs to.
*/
settlement_amount: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the currency the
* transaction will be settled in.
*/
settlement_currency: string;
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card
* is transacting with.
*/
terminal_id: string | null;
/**
* The identifier of the Card Payment this authorization will belong to. Available
* in the API once the card authorization has completed.
*/
upcoming_card_payment_id: string;
/**
* Fields related to verification of cardholder-provided values.
*/
verification: CardAuthorization.Verification;
[k: string]: unknown;
}
export namespace CardAuthorization {
/**
* 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.
*/
export interface AdditionalAmounts {
/**
* The part of this transaction amount that was for clinic-related services.
*/
clinic: AdditionalAmounts.Clinic | null;
/**
* The part of this transaction amount that was for dental-related services.
*/
dental: AdditionalAmounts.Dental | null;
/**
* The original pre-authorized amount.
*/
original: AdditionalAmounts.Original | null;
/**
* The part of this transaction amount that was for healthcare prescriptions.
*/
prescription: AdditionalAmounts.Prescription | null;
/**
* The surcharge amount charged for this transaction by the merchant.
*/
surcharge: AdditionalAmounts.Surcharge | null;
/**
* The total amount of a series of incremental authorizations, optionally provided.
*/
total_cumulative: AdditionalAmounts.TotalCumulative | null;
/**
* The total amount of healthcare-related additional amounts.
*/
total_healthcare: AdditionalAmounts.TotalHealthcare | null;
/**
* The part of this transaction amount that was for transit-related services.
*/
transit: AdditionalAmounts.Transit | null;
/**
* An unknown additional amount.
*/
unknown: AdditionalAmounts.Unknown | null;
/**
* The part of this transaction amount that was for vision-related services.
*/
vision: AdditionalAmounts.Vision | null;
}
export namespace AdditionalAmounts {
/**
* The part of this transaction amount that was for clinic-related services.
*/
export interface Clinic {
/**
* 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: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
* amount's currency.
*/
currency: string;
}
/**
* The part of this transaction amount that was for dental-related services.
*/
export interface Dental {
/**
* 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: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
* amount's currency.
*/
currency: string;
}
/**
* The original pre-authorized amount.
*/
export interface Original {
/**
* 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: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
* amount's currency.
*/
currency: string;
}
/**
* The part of this transaction amount that was for healthcare prescriptions.
*/
export interface Prescription {
/**
* 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: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
* amount's currency.
*/
currency: string;
}
/**
* The surcharge amount charged for this transaction by the merchant.
*/
export interface Surcharge {
/**
* 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: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
* amount's currency.
*/
currency: string;
}
/**
* The total amount of a series of incremental authorizations, optionally provided.
*/
export interface TotalCumulative {
/**
* 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: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
* amount's currency.
*/
currency: string;
}
/**
* The total amount of healthcare-related additional amounts.
*/
export interface TotalHealthcare {
/**
* 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: number;
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
* amount's currency.
*/
currency: string;
}
/**
* The part of this transaction amount that was for transit-related services.
*/
export interface Transit {
/**
* 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: number;