Merge pull request #33682 from 0xJoKe/stripe-paymentintents

[stripe] added missing signatures for paymentIntents
This commit is contained in:
Gabriela Britto
2019-03-08 13:24:33 -08:00
committed by GitHub
2 changed files with 49 additions and 0 deletions
+47
View File
@@ -3359,6 +3359,15 @@ declare namespace Stripe {
source?: string;
}
interface IPaymentIntentRetrieveOptions {
/**
* The client secret of the PaymentIntent. Required if a publishable key is used to retrieve the source.
*
* REQUIRED IF USING PUBLISHABLE KEY!
*/
client_secret: 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.
@@ -7276,6 +7285,17 @@ declare namespace Stripe {
* 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,
data: paymentIntents.IPaymentIntentRetrieveOptions,
options: HeaderOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
retrieve(
id: string,
data: paymentIntents.IPaymentIntentRetrieveOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
retrieve(
id: string,
options: HeaderOptions,
@@ -7304,6 +7324,15 @@ declare namespace Stripe {
data: paymentIntents.IPaymentIntentConfirmOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
confirm(
paymentIntentId: string,
options: HeaderOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
confirm(
paymentIntentId: string,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
/**
* Capture the funds of an existing uncaptured PaymentIntent where `required_action="requires_capture"`.
@@ -7322,6 +7351,15 @@ declare namespace Stripe {
data: paymentIntents.IPaymentIntentCaptureOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
capture(
paymentIntentId: string,
options: HeaderOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
capture(
paymentIntentId: string,
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`.
@@ -7337,6 +7375,11 @@ declare namespace Stripe {
options: HeaderOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
cancel(
paymentIntentId: string,
options: HeaderOptions,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
cancel(
paymentIntentId: string,
data: {
@@ -7344,6 +7387,10 @@ declare namespace Stripe {
},
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
cancel(
paymentIntentId: string,
response?: IResponseFn<paymentIntents.IPaymentIntent>,
): Promise<paymentIntents.IPaymentIntent>;
}
class Payouts extends StripeResource {
+2
View File
@@ -1057,6 +1057,8 @@ 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", {}, (err, intent) => {});
stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", {}).then((intent) => {});
stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", { cancellation_reason: 'duplicate' }, (err, intent) => {});