From 98a95be49334bafc3b37d7c11c3bd86532bf7b09 Mon Sep 17 00:00:00 2001 From: Munaz <57273637+munaz2-stripe@users.noreply.github.com> Date: Thu, 29 Feb 2024 13:04:44 -0500 Subject: [PATCH] Update Payment Intent typings for Stripe --- lib/stripe/all/stripe.rbi | 47 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/lib/stripe/all/stripe.rbi b/lib/stripe/all/stripe.rbi index 1be11ac..4463c70 100644 --- a/lib/stripe/all/stripe.rbi +++ b/lib/stripe/all/stripe.rbi @@ -196,22 +196,63 @@ module Stripe end class PaymentIntent < APIResource + sig {returns(Integer)} + def amount_received; end + + sig {returns(T.nilable(String))} + def application; end + + sig { returns(Stripe::ListObject) } + def charges; end + sig { returns(String) } def client_secret; end + sig { returns(Integer)} + def created; end + sig { returns(String) } - def status; end + def currency; end - sig { returns(Stripe::ListObject) } - def charges; end + sig {returns(T.nilable(StripeError))} + def last_payment_error; end sig { returns(Stripe::ListObject) } def line_items; end + sig {returns(T.nilable(PaymentIntentNextAction))} + def next_action; end + + sig {returns(T.nilable(PaymentIntentPaymentMethodOptions))} + def payment_method_options; end + + sig { returns(String) } + def status; end + sig { returns(PaymentIntent).params(id: T.any(String, T::Hash[Symbol, T.any(String, T::Array[String])]), opts: T.nilable(T::Hash[Symbol, T.untyped])) } def self.retrieve(id, opts = nil); end end + class PaymentIntentNextAction < StripeObject + sig {returns(String)} + def type; end + end + + class PaymentIntentNextActionRedirectToUrl < StripeObject + sig {returns(T.nilable(String))} + def url; end + end + + class PaymentIntentPaymentMethodOptions < StripeObject + sig {returns(T.nilable(String))} + def card; end + end + + class PaymentIntentPaymentMethodOptionsCard < StripeObject + sig {returns(T.nilable(String))} + def capture_method; end + end + class Invoice < APIResource sig { returns(T.nilable(Stripe::PaymentIntent)) } def payment_intent; end