@commercetools/checkout-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +172 -0
- package/dist/commercetools-checkout-sdk.browser.cjs.js +499 -0
- package/dist/commercetools-checkout-sdk.browser.esm.js +481 -0
- package/dist/commercetools-checkout-sdk.cjs.d.ts +2 -0
- package/dist/commercetools-checkout-sdk.cjs.dev.js +499 -0
- package/dist/commercetools-checkout-sdk.cjs.js +7 -0
- package/dist/commercetools-checkout-sdk.cjs.prod.js +499 -0
- package/dist/commercetools-checkout-sdk.esm.js +481 -0
- package/dist/declarations/src/ctp/ctp-client.d.ts +3 -0
- package/dist/declarations/src/ctp/ctp-client.d.ts.map +1 -0
- package/dist/declarations/src/generated/client/api-root.d.ts +19 -0
- package/dist/declarations/src/generated/client/api-root.d.ts.map +1 -0
- package/dist/declarations/src/generated/client/by-project-key-request-builder.d.ts +29 -0
- package/dist/declarations/src/generated/client/by-project-key-request-builder.d.ts.map +1 -0
- package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-by-payment-id-request-builder.d.ts +42 -0
- package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-by-payment-id-request-builder.d.ts.map +1 -0
- package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-request-builder.d.ts +29 -0
- package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-request-builder.d.ts.map +1 -0
- package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-by-id-request-builder.d.ts +40 -0
- package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-by-id-request-builder.d.ts.map +1 -0
- package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-key-by-key-request-builder.d.ts +40 -0
- package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-key-by-key-request-builder.d.ts.map +1 -0
- package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-request-builder.d.ts +50 -0
- package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-request-builder.d.ts.map +1 -0
- package/dist/declarations/src/generated/index.d.ts +27 -0
- package/dist/declarations/src/generated/index.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/application.d.ts +39 -0
- package/dist/declarations/src/generated/models/application.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/cart.d.ts +52 -0
- package/dist/declarations/src/generated/models/cart.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/common.d.ts +100 -0
- package/dist/declarations/src/generated/models/common.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/error.d.ts +144 -0
- package/dist/declarations/src/generated/models/error.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/order.d.ts +26 -0
- package/dist/declarations/src/generated/models/order.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/payment-integration.d.ts +39 -0
- package/dist/declarations/src/generated/models/payment-integration.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/payment-intents.d.ts +111 -0
- package/dist/declarations/src/generated/models/payment-intents.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/payment.d.ts +39 -0
- package/dist/declarations/src/generated/models/payment.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/responses.d.ts +1647 -0
- package/dist/declarations/src/generated/models/responses.d.ts.map +1 -0
- package/dist/declarations/src/generated/models/transaction.d.ts +170 -0
- package/dist/declarations/src/generated/models/transaction.d.ts.map +1 -0
- package/dist/declarations/src/generated/shared/utils/common-types.d.ts +56 -0
- package/dist/declarations/src/generated/shared/utils/common-types.d.ts.map +1 -0
- package/dist/declarations/src/generated/shared/utils/middleware.d.ts +9 -0
- package/dist/declarations/src/generated/shared/utils/middleware.d.ts.map +1 -0
- package/dist/declarations/src/generated/shared/utils/requests-utils.d.ts +14 -0
- package/dist/declarations/src/generated/shared/utils/requests-utils.d.ts.map +1 -0
- package/dist/declarations/src/generated/shared/utils/uri-utils.d.ts +8 -0
- package/dist/declarations/src/generated/shared/utils/uri-utils.d.ts.map +1 -0
- package/dist/declarations/src/index.d.ts +3 -0
- package/dist/declarations/src/index.d.ts.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
|
|
3
|
+
* Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
|
|
4
|
+
* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
|
|
5
|
+
*/
|
|
6
|
+
import { Amount } from "./common.js";
|
|
7
|
+
export interface PaymentIntent {
|
|
8
|
+
/**
|
|
9
|
+
* Action to execute for the given Payment.
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
readonly actions: PaymentIntentAction[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Depending on the action specified, Checkout requests the [payment service provider](/connectors-and-applications#supported-psps-payment-integration-types-and-payment-methods) (PSP) or gift card management system to capture, refund, or cancel the authorization for the given Payment.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export type PaymentIntentAction = PaymentIntentCancelAction | PaymentIntentCaptureAction | PaymentIntentRefundAction | PaymentIntentReverseAction;
|
|
20
|
+
export interface IPaymentIntentAction {
|
|
21
|
+
/**
|
|
22
|
+
* Action to execute for the given [Payment](/../api/projects/payments#payment).
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
readonly action: PaymentIntentOperation;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Requests to [cancel the authorization](/payments-lifecycle#authorization-cancellation) for a Payment. Checkout will cancel the [Payment](/../api/projects/payments#payment) and will request the PSP or gift card management system to proceed with the financial process to cancel the authorization.
|
|
30
|
+
*
|
|
31
|
+
* You cannot request to cancel the authorization for a Payment that has already been [captured](/payments-lifecycle#payment-capture).
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export interface PaymentIntentCancelAction extends IPaymentIntentAction {
|
|
35
|
+
readonly action: 'cancelPayment';
|
|
36
|
+
/**
|
|
37
|
+
* A merchant-defined identifier associated with the [Payment](/../api/projects/payments#payment) to track and reconcile the [Payment Intent Action](ctp:checkout:type:PaymentIntentAction) on the merchant's side. For example, an invoice number.
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
readonly merchantReference?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Requests to [capture](/payments-lifecycle#payment-capture) the given amount from the customer. Checkout will request the PSP or gift card management system to proceed with the financial process to capture the amount.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export interface PaymentIntentCaptureAction extends IPaymentIntentAction {
|
|
48
|
+
readonly action: 'capturePayment';
|
|
49
|
+
/**
|
|
50
|
+
* Amount to be captured. It must be less than or equal to the [authorized](/payments-lifecycle#authorization) amount.
|
|
51
|
+
*
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
readonly amount: Amount;
|
|
55
|
+
/**
|
|
56
|
+
* A merchant-defined identifier associated with the [Payment](/../api/projects/payments#payment) to track and reconcile the [Payment Intent Action](ctp:checkout:type:PaymentIntentAction) on the merchant's side. For example, an invoice number.
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
readonly merchantReference?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The possible values for a [Payment Intent Action](ctp:checkout:type:PaymentIntentAction).
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
export declare enum PaymentIntentOperationValues {
|
|
67
|
+
CancelPayment = "cancelPayment",
|
|
68
|
+
CapturePayment = "capturePayment",
|
|
69
|
+
RefundPayment = "refundPayment",
|
|
70
|
+
ReversePayment = "reversePayment"
|
|
71
|
+
}
|
|
72
|
+
export type PaymentIntentOperation = 'cancelPayment' | 'capturePayment' | 'refundPayment' | 'reversePayment' | (string & {});
|
|
73
|
+
/**
|
|
74
|
+
* Requests to [refund](/payments-lifecycle#refund) the given amount to the customer. Checkout will request the PSP or gift card management system to proceed with the financial process to refund the amount.
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
export interface PaymentIntentRefundAction extends IPaymentIntentAction {
|
|
78
|
+
readonly action: 'refundPayment';
|
|
79
|
+
/**
|
|
80
|
+
* Amount to be refunded. It must be less than or equal to the [captured](/payments-lifecycle#payment-capture) amount.
|
|
81
|
+
*
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
readonly amount: Amount;
|
|
85
|
+
/**
|
|
86
|
+
* The identifier of the capture transaction that is associated with the refund action.
|
|
87
|
+
*
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
readonly transactionId?: string;
|
|
91
|
+
/**
|
|
92
|
+
* A merchant-defined identifier associated with the [Payment](/../api/projects/payments#payment) to track and reconcile the [Payment Intent Action](ctp:checkout:type:PaymentIntentAction) on the merchant's side. For example, an invoice number.
|
|
93
|
+
*
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
96
|
+
readonly merchantReference?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Requests to [reverse](/payment-integration-predicates) a [Payment](/../api/projects/payments#payment). Checkout reverses the Payment, and then requests the PSP or gift card management system to proceed with the relevant process to reverse the Payment.
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
export interface PaymentIntentReverseAction extends IPaymentIntentAction {
|
|
103
|
+
readonly action: 'reversePayment';
|
|
104
|
+
/**
|
|
105
|
+
* A merchant-defined identifier associated with the [Payment](/../api/projects/payments#payment) to track and reconcile the [Payment Intent Action](ctp:checkout:type:PaymentIntentAction) on the merchant's side. For example, an invoice number.
|
|
106
|
+
*
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
readonly merchantReference?: string;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=payment-intents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-intents.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["payment-intents.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,oBAAgB;AAEjC,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,mBAAmB,EAAE,CAAA;CACxC;AACD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,0BAA0B,CAAA;AAC9B,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAA;CACxC;AACD;;;;;GAKG;AACH,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACpC;AACD;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;IACjC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACpC;AACD;;;GAGG;AACH,oBAAY,4BAA4B;IACtC,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;CAClC;AAED,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AACjB;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACpC;AACD;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAA;IACjC;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACpC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
|
|
3
|
+
* Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
|
|
4
|
+
* For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
|
|
5
|
+
*/
|
|
6
|
+
import { IReference, IResourceIdentifier } from "./common.js";
|
|
7
|
+
/**
|
|
8
|
+
* Reference to a [Payment](/../api/projects/payments).
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export interface PaymentReference extends IReference {
|
|
12
|
+
readonly typeId: 'payment';
|
|
13
|
+
/**
|
|
14
|
+
* Unique identifier of the referenced [Payment](/../api/projects/payments).
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
readonly id: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resource identifier to a [Payment](/../api/projects/payments). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export interface PaymentResourceIdentifier extends IResourceIdentifier {
|
|
25
|
+
readonly typeId: 'payment';
|
|
26
|
+
/**
|
|
27
|
+
* Unique identifier of the referenced [Payment](/../api/projects/payments). Required if `key` is absent.
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
readonly id?: string;
|
|
32
|
+
/**
|
|
33
|
+
* User-defined unique identifier of the referenced [Payment](/../api/projects/payments). Required if `id` is absent.
|
|
34
|
+
*
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
readonly key?: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=payment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["payment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAgB;AAE1D;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB;AACD;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACtB"}
|