mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
Merge pull request #33577 from 0xJoKe/stripe-paymentintents
[stripe] Added Stripe PaymentIntents
This commit is contained in:
Vendored
+531
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for stripe 6.19
|
||||
// Type definitions for stripe 6.25
|
||||
// Project: https://github.com/stripe/stripe-node/
|
||||
// Definitions by: William Johnston <https://github.com/wjohnsto>
|
||||
// Peter Harris <https://github.com/codeanimal>
|
||||
@@ -17,6 +17,7 @@
|
||||
// Slava Yultyyev <https://github.com/yultyyev>
|
||||
// Corey Psoinos <https://github.com/cpsoinos>
|
||||
// Saransh Kataria <https://github.com/saranshkataria>
|
||||
// Jonas Keisel <https://github.com/0xJoKe>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -53,6 +54,7 @@ declare class Stripe {
|
||||
events: Stripe.resources.Events;
|
||||
invoices: Stripe.resources.Invoices;
|
||||
invoiceItems: Stripe.resources.InvoiceItems;
|
||||
paymentIntents: Stripe.resources.PaymentIntents;
|
||||
payouts: Stripe.resources.Payouts;
|
||||
plans: Stripe.resources.Plans;
|
||||
/**
|
||||
@@ -2980,6 +2982,408 @@ declare namespace Stripe {
|
||||
type PayoutTypes = "bank_account" | "card";
|
||||
}
|
||||
|
||||
namespace paymentIntents {
|
||||
interface IPaymentIntent extends IResourceObject {
|
||||
/**
|
||||
* Value is "payment_intent".
|
||||
*/
|
||||
object: 'payment_intent';
|
||||
|
||||
/**
|
||||
* The amount in cents that is to be collected from this PaymentIntent.
|
||||
*/
|
||||
amount: number;
|
||||
|
||||
/**
|
||||
* The amount that can be captured with from this PaymentIntent (in cents).
|
||||
*/
|
||||
amount_capturable: number;
|
||||
|
||||
/**
|
||||
* The amount that was collected from this PaymentIntent (in cents).
|
||||
*/
|
||||
amount_received: number;
|
||||
|
||||
/**
|
||||
* ID of the Connect application that created the PaymentIntent. [Expandable]
|
||||
*/
|
||||
application?: string | applications.IApplication | null;
|
||||
|
||||
/**
|
||||
* A fee in cents that will be applied to the invoice and transferred to the application owner's Stripe account.
|
||||
*/
|
||||
application_fee_amount?: number | null;
|
||||
|
||||
/**
|
||||
* Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled.
|
||||
* Measured in seconds since the Unix epoch.
|
||||
*/
|
||||
canceled_at: number | null;
|
||||
|
||||
/**
|
||||
* User-given reason for cancellation of this PaymentIntent.
|
||||
*/
|
||||
cancelation_reason: PaymentIntentCancelationReason | null;
|
||||
|
||||
/**
|
||||
* Capture method of this PaymentIntent.
|
||||
*/
|
||||
capture_method: 'automatic' | 'manual';
|
||||
|
||||
/**
|
||||
* Charges that were created by this PaymentIntent, if any.
|
||||
*/
|
||||
charges: IList<charges.ICharge>;
|
||||
|
||||
/**
|
||||
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled.
|
||||
*/
|
||||
client_secret: string;
|
||||
|
||||
/**
|
||||
* Confirmation method of this PaymentIntent.
|
||||
*/
|
||||
confirmation_method: 'secret' | 'publishable';
|
||||
|
||||
/**
|
||||
* Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
*/
|
||||
created: number;
|
||||
|
||||
/**
|
||||
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
||||
*/
|
||||
currency: string;
|
||||
|
||||
/**
|
||||
* ID of the Customer this PaymentIntent is for if one exists. [Expandable]
|
||||
*/
|
||||
customer: string | customers.ICustomer | null;
|
||||
|
||||
/**
|
||||
* An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* The payment error encountered in the previous PaymentIntent confirmation.
|
||||
*/
|
||||
last_payment_error: IStripeError | null;
|
||||
|
||||
livemode: boolean;
|
||||
|
||||
metadata: IMetadata;
|
||||
|
||||
/**
|
||||
* If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
|
||||
*/
|
||||
next_action:
|
||||
| IPaymentIntentNextActionUseStripeSdk
|
||||
| IPaymentIntentNextActionRedirectToUrl;
|
||||
|
||||
/**
|
||||
* The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents Connect usage guide for details. [Expandable]
|
||||
*/
|
||||
on_behalf_of?: string | null;
|
||||
|
||||
/**
|
||||
* The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
|
||||
*/
|
||||
payment_method_types: string[];
|
||||
|
||||
/**
|
||||
* Email address that the receipt for the resulting payment will be sent to.
|
||||
*/
|
||||
receipt_email: string | null;
|
||||
|
||||
/**
|
||||
* ID of the review associated with this PaymentIntent, if any. [Expandable]
|
||||
*/
|
||||
review?: string | reviews.IReview | null;
|
||||
|
||||
/**
|
||||
* Shipping information for this PaymentIntent.
|
||||
*/
|
||||
shipping?: IShippingInformation | null;
|
||||
|
||||
/**
|
||||
* ID of the source used in this PaymentIntent. [Expandable]
|
||||
*/
|
||||
source:
|
||||
| string
|
||||
| cards.ICard
|
||||
| bitcoinReceivers.IBitcoinReceiver
|
||||
| bankAccounts.IBankAccount;
|
||||
|
||||
/**
|
||||
* Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge.
|
||||
*/
|
||||
statement_descriptor: string | null;
|
||||
|
||||
/**
|
||||
* The several states the PaymentIntent goes through until it it either canceled or succeeds.
|
||||
*/
|
||||
status:
|
||||
| 'requires_payment_method'
|
||||
| 'requires_action'
|
||||
| 'processing'
|
||||
| 'requires_authorization'
|
||||
| 'requires_capture'
|
||||
| 'canceled'
|
||||
| 'succeeded';
|
||||
|
||||
/**
|
||||
* The data with which to automatically create a Transfer when the payment is finalized.
|
||||
*/
|
||||
transfer_data: IPaymentIntentTransferData | null;
|
||||
|
||||
/**
|
||||
* A string that identifies the resulting payment as part of a group.
|
||||
*/
|
||||
transfer_group: string | null;
|
||||
}
|
||||
|
||||
interface IPaymentIntentTransferData {
|
||||
/**
|
||||
* The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to upon payment success. [Expandable]
|
||||
*/
|
||||
destination:
|
||||
| string
|
||||
| bankAccounts.IBankAccount
|
||||
| cards.ICardHash
|
||||
| accounts.IAccountCreationOptions;
|
||||
}
|
||||
|
||||
interface IPaymentIntentNextActionRedirectToUrl {
|
||||
type: 'redirect_to_url';
|
||||
/**
|
||||
* Contains instructions for authenticating a payment by redirecting your customer to another page or application.
|
||||
*/
|
||||
redirect_to_url: { return_url: string; url: string };
|
||||
}
|
||||
|
||||
interface IPaymentIntentNextActionUseStripeSdk {
|
||||
type: 'use_stripe_sdk';
|
||||
/**
|
||||
* When confirming a PaymentIntent with js, js depends on the contents of this object to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by js.
|
||||
*/
|
||||
use_stripe_sdk: any;
|
||||
}
|
||||
|
||||
type PaymentIntentCancelationReason = 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'failed_invoice';
|
||||
|
||||
interface IPaymentIntentCreationOptions {
|
||||
/**
|
||||
* Amount intended to be collected by this PaymentIntent (in cents).
|
||||
*/
|
||||
amount: number;
|
||||
|
||||
/**
|
||||
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
||||
*/
|
||||
currency: string;
|
||||
|
||||
/**
|
||||
* The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
|
||||
*/
|
||||
payment_method_types: string[];
|
||||
|
||||
/**
|
||||
* The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key.
|
||||
*/
|
||||
application_fee_amount?: number;
|
||||
|
||||
/**
|
||||
* Capture method of this PaymentIntent.
|
||||
*/
|
||||
capture_method?: 'automatic' | 'manual';
|
||||
|
||||
/**
|
||||
* Attempt to confirm this PaymentIntent immediately. If the payment method attached is a card, a return_url must be provided in case additional authentication is required.
|
||||
*/
|
||||
confirm?: boolean;
|
||||
|
||||
/**
|
||||
* ID of the customer this PaymentIntent is for if one exists.
|
||||
*/
|
||||
customer?: string;
|
||||
|
||||
/**
|
||||
* An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving.
|
||||
*/
|
||||
description?: string | null;
|
||||
|
||||
/**
|
||||
* A set of key/value pairs that you can attach to an object. It can be
|
||||
* useful for storing additional information about the object in a structured
|
||||
* format. You can unset an individual key by setting its value to null and
|
||||
* then saving. To clear all keys, set metadata to null, then save.
|
||||
*/
|
||||
metadata?: IOptionsMetadata;
|
||||
|
||||
/**
|
||||
* The Stripe account ID for which these funds are intended.
|
||||
*/
|
||||
on_behalf_of?: string;
|
||||
|
||||
/**
|
||||
* Email address that the receipt for the resulting payment will be sent to.
|
||||
*/
|
||||
receipt_email?: string;
|
||||
|
||||
/**
|
||||
* The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This param can only be used if `confirm=true`.
|
||||
*/
|
||||
return_url?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added.
|
||||
*/
|
||||
save_payment_method?: boolean;
|
||||
|
||||
/**
|
||||
* Shipping information for this PaymentIntent.
|
||||
*/
|
||||
shipping?: IShippingInformation;
|
||||
|
||||
/**
|
||||
* ID of the Source object to attach to this PaymentIntent.
|
||||
*/
|
||||
source?: string;
|
||||
|
||||
/**
|
||||
* Extra information about a PaymentIntent. This will appear on your customer’s statement when this PaymentIntent succeeds in creating a charge.
|
||||
*/
|
||||
statement_descriptor?: string;
|
||||
|
||||
/**
|
||||
* The parameters used to automatically create a Transfer when the payment succeeds.
|
||||
*/
|
||||
transfer_data?: IPaymentIntentTransferData;
|
||||
|
||||
/**
|
||||
* A string that identifies the resulting payment as part of a group.
|
||||
*/
|
||||
transfer_group?: string;
|
||||
}
|
||||
|
||||
interface IPaymentIntentUpdateOptions {
|
||||
/**
|
||||
* Amount intended to be collected by this PaymentIntent (in cents).
|
||||
*/
|
||||
amount?: number;
|
||||
|
||||
/**
|
||||
* The amount of the application fee in cents (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key.
|
||||
*/
|
||||
application_fee_amount?: number;
|
||||
|
||||
/**
|
||||
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
||||
*/
|
||||
currency?: string;
|
||||
|
||||
/**
|
||||
* ID of the customer this PaymentIntent is for if one exists.
|
||||
*/
|
||||
customer?: string;
|
||||
|
||||
/**
|
||||
* An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving.
|
||||
*/
|
||||
description?: string | null;
|
||||
|
||||
/**
|
||||
* A set of key/value pairs that you can attach to an object. It can be
|
||||
* useful for storing additional information about the object in a structured
|
||||
* format. You can unset an individual key by setting its value to null and
|
||||
* then saving. To clear all keys, set metadata to null, then save.
|
||||
*/
|
||||
metadata?: IOptionsMetadata;
|
||||
|
||||
/**
|
||||
* Email address that the receipt for the resulting payment will be sent to.
|
||||
*/
|
||||
receipt_email?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added.
|
||||
*/
|
||||
save_payment_method?: boolean;
|
||||
|
||||
/**
|
||||
* Shipping information for this PaymentIntent.
|
||||
*/
|
||||
shipping?: IShippingInformation;
|
||||
|
||||
/**
|
||||
* ID of the Source object to attach to this PaymentIntent.
|
||||
*/
|
||||
source?: string;
|
||||
|
||||
/**
|
||||
* A string that identifies the resulting payment as part of a group.
|
||||
*/
|
||||
transfer_group?: string;
|
||||
}
|
||||
|
||||
interface IPaymentIntentConfirmOptions {
|
||||
/**
|
||||
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. Please refer to dynamic authentication guide on how client_secret should be handled. Required if using Publishable Key!
|
||||
*/
|
||||
client_secret?: string;
|
||||
|
||||
/**
|
||||
* Email address that the receipt for the resulting payment will be sent to.
|
||||
*/
|
||||
receipt_email?: string | null;
|
||||
|
||||
/**
|
||||
* The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods.
|
||||
*/
|
||||
return_url?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to save this PaymentIntent’s payment method to the associated Customer, if the payment method is not already attached. This parameter only applies to the payment method passed in the same request or the current payment method attached to the PaymentIntent and must be specified again if a new payment method is added.
|
||||
*/
|
||||
save_payment_method?: boolean;
|
||||
|
||||
/**
|
||||
* Shipping information for this PaymentIntent.
|
||||
*/
|
||||
shipping?: IShippingInformation | null;
|
||||
|
||||
/**
|
||||
* ID of the source used in this PaymentIntent.
|
||||
*/
|
||||
source?: string;
|
||||
}
|
||||
|
||||
interface IPaymentIntentCaptureOptions {
|
||||
/**
|
||||
* The amount to capture (in cents) from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided.
|
||||
*/
|
||||
amount_to_capture?: number;
|
||||
|
||||
/**
|
||||
* The amount of the application fee (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key.
|
||||
*/
|
||||
application_fee_amount?: number;
|
||||
}
|
||||
|
||||
interface IPaymentIntentListOptions extends IListOptionsCreated {
|
||||
/**
|
||||
* Filter links by their expiration status. By default, all links are returned.
|
||||
*/
|
||||
expired?: boolean;
|
||||
|
||||
/**
|
||||
* Only return links for the given file.
|
||||
*/
|
||||
file?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
namespace plans {
|
||||
interface ITier {
|
||||
/**
|
||||
@@ -6816,6 +7220,132 @@ declare namespace Stripe {
|
||||
del(invoiceItemId: string, response?: IResponseFn<IDeleteConfirmation>): Promise<IDeleteConfirmation>;
|
||||
}
|
||||
|
||||
class PaymentIntents extends StripeResource {
|
||||
/**
|
||||
* Creates a PaymentIntent object.
|
||||
*/
|
||||
create(
|
||||
data: paymentIntents.IPaymentIntentCreationOptions,
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
create(
|
||||
data: paymentIntents.IPaymentIntentCreationOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
|
||||
/**
|
||||
* Returns a list of PaymentIntents.
|
||||
*
|
||||
* @returns A object with a data property that contains an array of up to limit PaymentIntents, starting after PaymentIntent starting_after. Each entry in the array is a separate PaymentIntent object. If no more PaymentIntents are available, the resulting array will be empty. This request should never throw an error.
|
||||
*/
|
||||
list(
|
||||
data: paymentIntents.IPaymentIntentListOptions,
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<IList<paymentIntents.IPaymentIntent>>,
|
||||
): Promise<IList<paymentIntents.IPaymentIntent>>;
|
||||
list(
|
||||
data: paymentIntents.IPaymentIntentListOptions,
|
||||
response?: IResponseFn<IList<paymentIntents.IPaymentIntent>>,
|
||||
): Promise<IList<paymentIntents.IPaymentIntent>>;
|
||||
list(
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<IList<paymentIntents.IPaymentIntent>>,
|
||||
): Promise<IList<paymentIntents.IPaymentIntent>>;
|
||||
list(
|
||||
response?: IResponseFn<IList<paymentIntents.IPaymentIntent>>,
|
||||
): Promise<IList<paymentIntents.IPaymentIntent>>;
|
||||
|
||||
/**
|
||||
* Updates a PaymentIntent object.
|
||||
*/
|
||||
update(
|
||||
id: string,
|
||||
data: paymentIntents.IPaymentIntentUpdateOptions,
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
update(
|
||||
id: string,
|
||||
data: paymentIntents.IPaymentIntentUpdateOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
|
||||
/**
|
||||
* Retrieves the details of a PaymentIntent that has previously been created.
|
||||
* Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string.
|
||||
* When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the payment intent object reference for more details.
|
||||
*/
|
||||
retrieve(
|
||||
id: string,
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
retrieve(
|
||||
id: string,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
|
||||
/**
|
||||
* Confirm that your customer intends to pay with current or provided `source`. Upon confirmation, the PaymentIntent will attempt to initiate a payment.
|
||||
*
|
||||
* If the selected source requires additional authentication steps, the PaymentIntent will transition to the `requires_action` status and suggest additional actions via `next_source_action`. If payment fails, the PaymentIntent will transition to the `requires_payment_method` status. If payment succeeds, the PaymentIntent will transition to the `succeeded` status (or `requires_capture`, if `capture_method` is set to `manual`).
|
||||
*
|
||||
* When using a publishable key, the client_secret must be provided to confirm the PaymentIntent.
|
||||
*/
|
||||
confirm(
|
||||
paymentIntentId: string,
|
||||
data: paymentIntents.IPaymentIntentConfirmOptions,
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
confirm(
|
||||
paymentIntentId: string,
|
||||
data: paymentIntents.IPaymentIntentConfirmOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
|
||||
/**
|
||||
* Capture the funds of an existing uncaptured PaymentIntent where `required_action="requires_capture"`.
|
||||
* Uncaptured PaymentIntents will be canceled exactly seven days after they are created.
|
||||
*
|
||||
* @returns Returns a PaymentIntent object with `status="succeeded"` if the PaymentIntent was capturable. Returns an error if the PaymentIntent was not capturable or an invalid amount to capture was provided.
|
||||
*/
|
||||
capture(
|
||||
paymentIntentId: string,
|
||||
data: paymentIntents.IPaymentIntentCaptureOptions,
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
capture(
|
||||
paymentIntentId: string,
|
||||
data: paymentIntents.IPaymentIntentCaptureOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
|
||||
/**
|
||||
* A PaymentIntent object can be canceled when it is in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action`.
|
||||
* Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with `status='requires_capture'`, the remaining `amount_capturable` will automatically be refunded.
|
||||
*
|
||||
* @returns Returns a PaymentIntent object if the cancellation succeeded. Returns an error if the PaymentIntent has already been canceled or is not in a cancelable state.
|
||||
*/
|
||||
cancel(
|
||||
paymentIntentId: string,
|
||||
data: {
|
||||
cancellation_reason?: paymentIntents.PaymentIntentCancelationReason,
|
||||
},
|
||||
options: HeaderOptions,
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
cancel(
|
||||
paymentIntentId: string,
|
||||
data: {
|
||||
cancellation_reason?: paymentIntents.PaymentIntentCancelationReason,
|
||||
},
|
||||
response?: IResponseFn<paymentIntents.IPaymentIntent>,
|
||||
): Promise<paymentIntents.IPaymentIntent>;
|
||||
}
|
||||
|
||||
class Payouts extends StripeResource {
|
||||
/**
|
||||
* To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or you’ll receive an “Insufficient Funds” error.
|
||||
|
||||
@@ -1018,6 +1018,51 @@ stripe.invoices.retrieve("in_15fvyXEe31JkLCeQH7QbgZZb", { expand: ["subscription
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Payment Intents test
|
||||
// ##################################################################################
|
||||
stripe.paymentIntents.create({
|
||||
amount: 2000,
|
||||
currency: "eur",
|
||||
payment_method_types: ["card"],
|
||||
}, (err, intent) => {});
|
||||
|
||||
stripe.paymentIntents.create({
|
||||
amount: 2000,
|
||||
currency: "eur",
|
||||
payment_method_types: ["card"],
|
||||
}).then((intent) => {});
|
||||
|
||||
stripe.paymentIntents.list({}, (err, intent) => {});
|
||||
stripe.paymentIntents.list({}).then((intent) => {});
|
||||
stripe.paymentIntents.list((err, intent) => {});
|
||||
stripe.paymentIntents.list().then((intent) => {});
|
||||
stripe.paymentIntents.list({ expired: true }, (err, intent) => {});
|
||||
stripe.paymentIntents.list({ expired: true }).then((intent) => {});
|
||||
|
||||
stripe.paymentIntents.update("pi_Aabcxyz01aDfoo", {
|
||||
amount: 2001,
|
||||
currency: 'usd',
|
||||
}, (err, intent) => {});
|
||||
stripe.paymentIntents.update("pi_Aabcxyz01aDfoo", {
|
||||
amount: 2001,
|
||||
currency: 'usd',
|
||||
}).then((intent) => {});
|
||||
|
||||
stripe.paymentIntents.retrieve("pi_Aabcxyz01aDfoo", (err, intent) => {});
|
||||
stripe.paymentIntents.retrieve("pi_Aabcxyz01aDfoo").then((intent) => {});
|
||||
|
||||
stripe.paymentIntents.confirm("pi_Aabcxyz01aDfoo", {}, (err, intent) => {});
|
||||
stripe.paymentIntents.confirm("pi_Aabcxyz01aDfoo", {}).then((intent) => {});
|
||||
|
||||
stripe.paymentIntents.capture("pi_Aabcxyz01aDfoo", {}, (err, intent) => {});
|
||||
stripe.paymentIntents.capture("pi_Aabcxyz01aDfoo", {}).then((intent) => {});
|
||||
|
||||
stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", {}, (err, intent) => {});
|
||||
stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", {}).then((intent) => {});
|
||||
stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", { cancellation_reason: 'duplicate' }, (err, intent) => {});
|
||||
stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", { cancellation_reason: 'requested_by_customer' }).then((intent) => {});
|
||||
//#endregion
|
||||
|
||||
//#region Payouts tests
|
||||
// ##################################################################################
|
||||
stripe.payouts.create({
|
||||
|
||||
Reference in New Issue
Block a user