-
Notifications
You must be signed in to change notification settings - Fork 66
/
data.ts
934 lines (910 loc) · 38 KB
/
data.ts
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
import type Nullable from '../../types/Nullable';
import { type ChargebackData } from '../chargebacks/Chargeback';
import {
type Address,
type Amount,
type ApiMode,
type CardAudience,
type CardFailureReason,
type CardLabel,
type FeeRegion,
type HistoricPaymentMethod,
type Links,
type Locale,
type PaymentMethod,
type SequenceType,
type Url,
} from '../global';
import type Model from '../Model';
import { type RefundData } from '../refunds/data';
import { type CaptureData } from './captures/data';
export interface PaymentData extends Model<'payment'> {
/**
* The mode used to create this payment. Mode determines whether a payment is *real* (live mode) or a *test* payment.
*
* Possible values: `live` `test`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=mode#response
*/
mode: ApiMode;
/**
* The payment's date and time of creation, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=createdAt#response
*/
createdAt: string;
/**
* The payment's status. Refer to the documentation regarding statuses for more info about which statuses occur at what point.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=status#response
*/
status: PaymentStatus;
/**
* Whether or not the payment can be canceled. This parameter is omitted if the payment reaches a final state.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=isCancelable#response
*/
isCancelable: boolean;
/**
* The date and time the payment became authorized, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. This parameter is omitted if the payment is not authorized (yet).
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=authorizedAt#response
*/
authorizedAt?: string;
/**
* The date and time the payment became paid, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. This parameter is omitted if the payment is not completed (yet).
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=paidAt#response
*/
paidAt?: string;
/**
* The date and time the payment was canceled, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. This parameter is omitted if the payment is not canceled (yet).
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=canceledAt#response
*/
canceledAt?: string;
/**
* The date and time the payment will expire, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. This parameter is omitted if the payment can no longer expire.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=expiresAt#response
*/
expiresAt?: string; // TODO: check if this should become a required field, even as an embedded object
/**
* The date and time the payment was expired, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. This parameter is omitted if the payment did not expire (yet).
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=expiredAt#response
*/
expiredAt?: string;
/**
* The date and time the payment failed, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. This parameter is omitted if the payment did not fail (yet).
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=failedAt#response
*/
failedAt?: string;
/**
* The amount of the payment, e.g. `{"currency":"EUR", "value":"100.00"}` for a €100.00 payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=amount#response
*/
amount: Amount;
/**
* The total amount that is already refunded. Only available when refunds are available for this payment. For some payment methods, this amount may be higher than the payment amount, for example to
* allow reimbursement of the costs for a return shipment to the customer.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=amountRefunded#response
*/
amountRefunded?: Amount;
/**
* The remaining amount that can be refunded. Only available when refunds are available for this payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=amountRemaining#response
*/
amountRemaining?: Amount;
/**
* The total amount that is already captured for this payment. Only available when this payment supports captures.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=amountCaptured#response
*/
amountCaptured?: Amount;
/**
* The total amount that was charged back for this payment. Only available when the total charged back amount is not zero.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=amountChargedBack#response
*/
amountChargedBack?: Amount;
/**
* A short description of the payment. The description is visible in the Dashboard and will be shown on the customer's bank or card statement when possible.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=description#response
*/
description: string;
/**
* The URL your customer will be redirected to after completing or canceling the payment process.
*
* The URL will be `null` for recurring payments.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=redirectUrl#response
*/
redirectUrl?: string;
/**
* The optional redirect URL you provided during payment creation. Consumer that explicitly cancel the payment will be redirected to this URL if provided, or otherwise to the `redirectUrl` instead —
* see above.
*
* Mollie will always give you status updates via webhooks, including for the `canceled` status. This parameter is therefore entirely optional, but can be useful when implementing a dedicated
* consumer-facing flow to handle payment cancellations.
*
* The URL will be `null` for recurring payments.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=cancelUrl#response
*/
cancelUrl?: string;
/**
* The URL Mollie will call as soon an important status change takes place.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=webhookUrl#response
*/
webhookUrl?: string;
/**
* The payment method used for this payment, either forced on creation by specifying the `method` parameter, or chosen by the customer on our payment method selection screen.
*
* If the payment is only partially paid with a gift card, the method remains `giftcard`.
*
* Possible values: `null` `bancontact` `banktransfer` `belfius` `creditcard` `directdebit` `eps` `giftcard` `giropay` `ideal` `in3` `kbc` `klarnapaylater` `klarnapaynow` `klarnasliceit` `mybank`
* `paypal` `paysafecard` `przelewy24` `sofort`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=method#response
*/
method?: PaymentMethod | HistoricPaymentMethod;
/**
* The optional metadata you provided upon payment creation. Metadata can for example be used to link an order to a payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=metadata#response
*/
metadata: unknown;
/**
* **Only relevant if you wish to manage authorization and capturing separately.**
*
* By default, the customer's card or bank account is immediately charged when they complete the payment.
*
* Some payment methods also allow placing a hold on the card or bank account. This hold or 'authorization' can then at a later point either be 'captured' or canceled.
*
* To enable this way of working, set the capture mode to `manual` and capture the payment manually using the `paymentCaptures.create` API.
*/
captureMode?: CaptureMethod;
/**
* **Only relevant if you wish to manage authorization and capturing separately.**
*
* Some payment methods allow placing a hold on the card or bank account. This hold or 'authorization' can then at a later point either be 'captured' or canceled.
*
* By default, we charge the customer's card or bank account immediately when they complete the payment. If you set a capture delay however, we will delay the automatic capturing of the payment for the specified amount of time. For example `8 hours` or `2 days`.
*
* To schedule an automatic capture, the `captureMode` must be set to `automatic`.
*
* The maximum delay is 7 days (168 hours).
*
* Possible values: `... hours`, `... days`
*/
captureDelay?: string;
/**
* **Only relevant if you wish to manage authorization and capturing separately.**
*
* Indicates the date before which the payment needs to be captured, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. From this date onwards we can no longer guarantee a successful capture. The parameter is omitted if the payment is not authorized (yet).
*/
captureBefore?: string;
/**
* The customer's locale, either forced on creation by specifying the `locale` parameter, or detected by us during checkout. Will be a full locale, for example `nl_NL`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=locale#response
*/
locale: Locale;
/**
* This optional field contains your customer's [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, detected by us during checkout. For example: `BE`. This field is
* omitted if the country code was not detected.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=countryCode#response
*/
countryCode?: string;
/**
* The identifier referring to the profile this payment was created on. For example, `pfl_QkEhN94Ba`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=profileId#response
*/
profileId: string;
/**
* This optional field will contain the amount that will be settled to your account, converted to the currency your account is settled in. It follows the same syntax as the `amount` property.
*
* Any amounts not settled by Mollie will not be reflected in this amount, e.g. PayPal or gift cards. If no amount is settled by Mollie the `settlementAmount` is omitted from the response.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=settlementAmount#response
*/
settlementAmount?: Amount;
/**
* The identifier referring to the settlement this payment was settled with. For example, `stl_BkEjN2eBb`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=settlementId#response
*/
settlementId?: string;
/**
* If a customer was specified upon payment creation, the customer's token will be available here as well. For example, `cst_XPn78q9CfT`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=customerId#response-parameters-for-recurring-payments
*/
customerId?: string;
/**
* Indicates which type of payment this is in a recurring sequence. Set to `first` for first payments that allow the customer to agree to automatic recurring charges taking place on their account in
* the future. Set to `recurring` for payments where the customer's card is charged automatically.
*
* Set to `oneoff` by default, which indicates the payment is a regular non-recurring payment.
*
* Possible values: `oneoff` `first` `recurring`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=sequenceType#response-parameters-for-recurring-payments
*/
sequenceType: SequenceType;
/**
* If the payment is a first or recurring payment, this field will hold the ID of the mandate.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=mandateId#response-parameters-for-recurring-payments
*/
mandateId?: string;
/**
* When implementing the Subscriptions API, any recurring charges resulting from the subscription will hold the ID of the subscription that triggered the payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=subscriptionId#response-parameters-for-recurring-payments
*/
subscriptionId?: string;
/**
* If the payment was created for an order, the ID of that order will be part of the response.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=orderId#response
*/
orderId?: string;
/**
* The application fee, if the payment was created with one.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=applicationFee#mollie-connect-response-parameters
*/
applicationFee?: {
amount: Amount;
description: string;
};
/**
* An object with several URL objects relevant to the payment. Every URL object will contain an `href` and a `type` field.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links#response
*/
_links: PaymentLinks;
/**
* An object with payment details.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details#ideal
*/
details?:
| BancontactDetails
| BankTransferDetails
| BelfiusPayButtonDetails
| BitcoinDetails
| CreditCardDetails
| GiftCardDetails
| IdealDetails
| IngHomePayDetails
| KbcCbcPaymentButtonDetails
| KlarnaDetails
| PayPalDetails
| PaysafecardDetails
| SepaDirectDebitDetails
| SofortBankingDetails
| VoucherDetails;
_embedded?: {
refunds?: Omit<RefundData, '_embedded'>[];
chargebacks?: Omit<ChargebackData, '_embedded'>[];
captures?: Omit<CaptureData, '_embedded'>[];
};
}
interface PaymentLinks extends Links {
/**
* The URL your customer should visit to make the payment. This is where you should redirect the consumer to.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/checkout#response
*/
checkout?: Url;
/**
* Recurring payments do not have a checkout URL, because these payments are executed without any user interaction. This link is included for test mode recurring payments, and allows you to set the
* final payment state for such payments.
*
* This link is also included for paid test mode payments. This allows you to create a refund or chargeback for the payment. This works for all payment types that can be charged back and/or
* refunded.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/changePaymentState#response-parameters-for-recurring-payments
*/
changePaymentState?: Url;
/**
* The API resource URL of the refunds that belong to this payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/refunds#response
*/
refunds?: Url;
/**
* The API resource URL of the chargebacks that belong to this payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/chargebacks#response
*/
chargebacks?: Url;
/**
* The API resource URL of the captures that belong to this payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/captures#response
*/
captures?: Url;
/**
* The API resource URL of the settlement this payment has been settled with. Not present if not yet settled.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/settlement#response
*/
settlement?: Url;
/**
* The API resource URL of the mandate linked to this payment. Not present if a one-off payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/mandate#response-parameters-for-recurring-payments
*/
mandate?: Url;
/**
* The API resource URL of the subscription this payment is part of. Not present if not a subscription payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/subscription#response-parameters-for-recurring-payments
*/
subscription?: Url;
/**
* The API resource URL of the customer this payment belongs to. Not present if not linked to a customer.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/customer#response-parameters-for-recurring-payments
*/
customer?: Url;
/**
* The API resource URL of the order this payment was created for. Not present if not created for an order.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/order#response
*/
order?: Url;
/**
* Direct link to the payment in the Mollie Dashboard.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/dashboard#response
*/
dashboard: Url;
}
export interface BancontactDetails {
/**
* Only available if the payment is completed - The last four digits of the card number.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardNumber#bancontact
*/
cardNumber: string;
/**
* Only available if the payment is completed - Unique alphanumeric representation of card, usable for identifying returning customers.
*
* @deprecated Use `consumerAccount` instead.
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardFingerprint#bancontact
*/
cardFingerprint: string;
/**
* Only available if requested during payment creation - The QR code that can be scanned by the mobile Bancontact application. This enables the desktop to mobile feature.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/qrCode#bancontact
*/
qrCode: QrCode;
/**
* Only available if the payment is completed – The consumer's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#bancontact
*/
consumerName: string;
/**
* Only available if the payment is completed – The consumer's bank account. This may be an IBAN, or it may be a domestic account number.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#bancontact
*/
consumerAccount: string;
/**
* Only available if the payment is completed – The consumer's bank's BIC / SWIFT code.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerBic#bancontact
*/
consumerBic: string;
/**
* The reason why the payment did not succeed. Only available when there's a reason known.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/failureReason#bancontact
*/
failureReason: string;
}
export interface BankTransferLinks extends Links {
/**
* A link to a hosted payment page where your customer can check the status of their payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/status#bank-transfer
*/
status: Url;
/**
* A link to a hosted payment page where your customer can finish the payment using an alternative payment method also activated on your website profile.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=_links/payOnline#bank-transfer
*/
payOnline: Url;
}
export interface BankTransferDetails {
/**
* The name of the bank the consumer should wire the amount to.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/bankName#bank-transfer
*/
bankName: string;
/**
* The IBAN the consumer should wire the amount to.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/bankAccount#bank-transfer
*/
bankAccount: string;
/**
* The BIC of the bank the consumer should wire the amount to.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/bankBic#bank-transfer
*/
bankBic: string;
/**
* The reference the consumer should use when wiring the amount. Note you should not apply any formatting here; show it to the consumer as-is.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/transferReference#bank-transfer
*/
transferReference: string;
/**
* Only available if the payment has been completed – The consumer's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#bank-transfer
*/
consumerName: string;
/**
* Only available if the payment has been completed – The consumer's bank account. This may be an IBAN, or it may be a domestic account number.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#bank-transfer
*/
consumerAccount: string;
/**
* Only available if the payment has been completed – The consumer's bank's BIC / SWIFT code.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerBic#bank-transfer
*/
consumerBic: string;
/**
* Only available if filled out in the API or by the consumer – The email address which the consumer asked the payment instructions to be sent to.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/billingEmail#bank-transfer
*/
billingEmail: string;
}
export interface BelfiusPayButtonDetails {
/**
* Only available one banking day after the payment has been completed – The consumer's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#belfius-pay-button
*/
consumerName: string;
/**
* Only available one banking day after the payment has been completed – The consumer's IBAN.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#belfius-pay-button
*/
consumerAccount: string;
/**
* Only available one banking day after the payment has been completed – `GKCCBEBB`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerBic#belfius-pay-button
*/
consumerBic: string;
}
export interface BitcoinDetails {
bitcoinAddress: string;
bitcoinAmount: string;
bitcoinUri: string;
qrCode: QrCode;
}
export interface CreditCardDetails {
/**
* Only available if the payment has been completed - The card holder's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardHolder#Credit%20card%20v2
*/
cardHolder: string;
/**
* Only available if the payment has been completed - The last four digits of the card number.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardNumber#Credit%20card%20v2
*/
cardNumber: string;
/**
* Only available if the payment has been completed - Unique alphanumeric representation of card, usable for identifying returning customers.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardFingerprint#Credit%20card%20v2
*/
cardFingerprint: string;
/**
* Only available if the payment has been completed and if the data is available - The card's target audience.
*
* Possible values: `consumer` `business` `null`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardAudience#Credit%20card%20v2
*/
cardAudience: Nullable<CardAudience>;
/**
* Only available if the payment has been completed - The card's label. Note that not all labels can be processed through Mollie.
*
* Possible values: `American Express` `Carta Si` `Carte Bleue` `Dankort` `Diners Club` `Discover` `JCB` `Laser` `Maestro` `Mastercard` `Unionpay` `Visa` `null`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardLabel#Credit%20card%20v2
*/
cardLabel: Nullable<CardLabel>;
/**
* Only available if the payment has been completed - The [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country the card was issued in. For example:
* `BE`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardCountryCode#Credit%20card%20v2
*/
cardCountryCode: string;
/**
* Only available if the payment has been completed – The type of security used during payment processing.
*
* Possible values: `normal` `3dsecure`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/cardSecurity#Credit%20card%20v2
*/
cardSecurity: 'normal' | '3dsecure';
/**
* Only available if the payment has been completed – The fee region for the payment. The `intra-eu` value is for consumer cards from the EEA.
*
* Possible values: `american-express` `amex-intra-eea` `carte-bancaire` `intra-eu` `intra-eu-corporate` `domestic` `maestro` `other`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/feeRegion#Credit%20card%20v2
*/
feeRegion: FeeRegion;
/**
* Only available for failed payments. Contains a failure reason code.
*
* Possible values: `authentication_abandoned` `authentication_failed` `authentication_required` `authentication_unavailable_acs` `card_declined` `card_expired` `inactive_card` `insufficient_funds`
* `invalid_cvv` `invalid_card_holder_name` `invalid_card_number` `invalid_card_type` `possible_fraud` `refused_by_issuer` `unknown_reason`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/failureReason#Credit%20card%20v2
*/
failureReason: CardFailureReason;
/**
* A localized message that can be shown to your customer, depending on the `failureReason`.
*
* Example value: `Der Kontostand Ihrer Kreditkarte ist unzureichend. Bitte verwenden Sie eine andere Karte.`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/failureMessage#Credit%20card%20v2
*/
failureMessage: string;
/**
* The wallet used when creating the payment.
*
* Possible values: `applepay`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/wallet#Credit%20card%20v2
*/
wallet?: 'applepay';
}
export interface GiftCardDetails {
/**
* The voucher number, with the last four digits masked. When multiple gift cards are used, this is the first voucher number. Example: `606436353088147****`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/voucherNumber#gift-cards
*/
voucherNumber: string;
/**
* A list of details of all giftcards that are used for this payment. Each object will contain the following properties.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/giftcards#gift-cards
*/
giftcards: GiftCard[];
/**
* Only available if another payment method was used to pay the remainder amount – The amount that was paid with another payment method for the remainder amount.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/remainderAmount#gift-cards
*/
remainderAmount: Amount;
/**
* Only available if another payment method was used to pay the remainder amount – The payment method that was used to pay the remainder amount.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/remainderMethod#gift-cards
*/
remainderMethod: Amount;
}
export interface IdealDetails {
/**
* Only available if the payment has been completed – The consumer's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#ideal
*/
consumerName: string;
/**
* Only available if the payment has been completed – The consumer's IBAN.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#ideal
*/
consumerAccount: string;
/**
* Only available if the payment has been completed – The consumer's bank's BIC.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerBic#ideal
*/
consumerBic: string;
}
export interface IngHomePayDetails {
consumerName: string;
consumerAccount: string;
consumerBic: string;
}
export interface KbcCbcPaymentButtonDetails {
/**
* Only available one banking day after the payment has been completed – The consumer's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#kbccbc-payment-button
*/
consumerName: string;
/**
* Only available one banking day after the payment has been completed – The consumer's IBAN.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#kbccbc-payment-button
*/
consumerAccount: string;
/**
* Only available one banking day after the payment has been completed – The consumer's bank's BIC.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerBic#kbccbc-payment-button
*/
consumerBic: string;
}
export interface KlarnaDetails {
extraMerchantData?: any;
}
export interface PayPalDetails {
/**
* Only available if the payment has been completed – The consumer's first and last name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#paypal
*/
consumerName: string;
/**
* Only available if the payment has been completed – The consumer's email address.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#paypal
*/
consumerAccount: string;
/**
* PayPal's reference for the transaction, for instance `9AL35361CF606152E`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/paypalReference#paypal
*/
paypalReference: string;
/**
* ID for the consumer's PayPal account, for instance `WDJJHEBZ4X2LY`.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/paypalPayerId#paypal
*/
paypalPayerId: string;
/**
* Indicates if the payment is eligible for PayPal's Seller Protection.
*
* Possible values: `Eligible` `Ineligible` `Partially Eligible - INR Only` `Partially Eligible - Unauth Only` `PartiallyEligible` `None` `Active Fraud Control - Unauth Premium Eligible`
*
* This parameter is omitted if we did not received the information from PayPal.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/sellerProtection#paypal
*/
sellerProtection?: 'Eligible' | 'Ineligible' | 'Partially Eligible - INR Only' | 'Partially Eligible - Unauth Only' | 'PartiallyEligible' | 'None' | 'Active Fraud Control - Unauth Premium Eligible';
/**
* The shipping address details.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/shippingAddress#paypal
*/
shippingAddress?: Address;
/**
* The amount of fee PayPal will charge for this transaction. This field is omitted if PayPal will not charge a fee for this transaction.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/paypalFee#paypal
*/
paypalFee?: Amount;
}
export interface PaysafecardDetails {
/**
* The consumer identification supplied when the payment was created.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/customerReference#paysafecard
*/
customerReference: string;
}
export interface SepaDirectDebitDetails {
/**
* Transfer reference used by Mollie to identify this payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/transferReference#sepa-direct-debit
*/
transferReference: string;
/**
* The creditor identifier indicates who is authorized to execute the payment. In this case, it is a reference to Mollie.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/creditorIdentifier#sepa-direct-debit
*/
creditorIdentifier: string;
/**
* The consumer's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#sepa-direct-debit
*/
consumerName: string;
/**
* The consumer's IBAN.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#sepa-direct-debit
*/
consumerAccount: string;
/**
* The consumer's bank's BIC.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerBic#sepa-direct-debit
*/
consumerBic: string;
/**
* Estimated date the payment is debited from the consumer's bank account, in `YYYY-MM-DD` format.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/dueDate#sepa-direct-debit
*/
dueDate: string;
/**
* Only available if the payment has been verified – Date the payment has been signed by the consumer, in `YYYY-MM-DD` format.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/signatureDate#sepa-direct-debit
*/
signatureDate: string;
/**
* Only available if the payment has failed – The official reason why this payment has failed. A detailed description of each reason is available on the website of the European Payments Council.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/bankReasonCode#sepa-direct-debit
*/
bankReasonCode: string;
/**
* Only available if the payment has failed – A textual description of the failure reason.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/bankReason#sepa-direct-debit
*/
bankReason: string;
/**
* Only available for batch transactions – The original end-to-end identifier that you've specified in your batch.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/endToEndIdentifier#sepa-direct-debit
*/
endToEndIdentifier: string;
/**
* Only available for batch transactions – The original mandate reference that you've specified in your batch.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/mandateReference#sepa-direct-debit
*/
mandateReference: string;
/**
* Only available for batch transactions – The original batch reference that you've specified in your batch.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/batchReference#sepa-direct-debit
*/
batchReference: string;
/**
* Only available for batch transactions – The original file reference that you've specified in your batch.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/fileReference#sepa-direct-debit
*/
fileReference: string;
}
export interface SofortBankingDetails {
/**
* Only available if the payment has been completed – The consumer's name.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerName#sofort-banking
*/
consumerName: string;
/**
* Only available if the payment has been completed – The consumer's IBAN.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerAccount#sofort-banking
*/
consumerAccount: string;
/**
* Only available if the payment has been completed – The consumer's bank's BIC.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/consumerBic#sofort-banking
*/
consumerBic: string;
}
export interface VoucherDetails {
/**
* The ID of the voucher brand that was used during the payment. When multiple vouchers are used, this is the issuer of the first voucher.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/issuer#vouchers
*/
issuer: string;
/**
* A list of details of all vouchers that are used for this payment. Each object will contain the following properties.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/vouchers#vouchers
*/
vouchers: {
/**
* The ID of the voucher brand that was used during the payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/vouchers/issuer#vouchers
*/
issuer: string;
/**
* The amount that was paid with this voucher.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/vouchers/amount#vouchers
*/
amount: Amount;
}[];
/**
* Only available if another payment method was used to pay the remainder amount – The amount that was paid with another payment method for the remainder amount.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/remainderAmount#vouchers
*/
remainderAmount: Amount;
/**
* Only available if another payment method was used to pay the remainder amount – The payment method that was used to pay the remainder amount.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/remainderMethod#vouchers
*/
remainderMethod: string;
}
export interface QrCode {
height: number;
width: number;
src: string;
}
export enum PaymentStatus {
open = 'open',
canceled = 'canceled',
pending = 'pending',
authorized = 'authorized',
expired = 'expired',
failed = 'failed',
paid = 'paid',
}
export enum PaymentInclude {
qrCode = 'details.qrCode',
remainderDetails = 'details.remainderDetails',
}
export enum PaymentEmbed {
refunds = 'refunds',
chargebacks = 'chargebacks',
captures = 'captures',
}
export enum CaptureMethod {
automatic = 'automatic',
manual = 'manual',
}
export interface GiftCard {
/**
* The ID of the gift card brand that was used during the payment.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/giftcards/issuer#gift-cards
*/
issuer: string;
/**
* The amount in EUR that was paid with this gift card.
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/giftcards/amount#gift-cards
*/
amount: Amount;
/**
* The voucher number, with the last four digits masked. Example: `606436353088147****`
*
* @see https://docs.mollie.com/reference/v2/payments-api/get-payment?path=details/giftcards/voucherNumber#gift-cards
*/
voucherNumber: string;
}