class Stripe::PaymentMethodsApi

Defined in:

stripe/api/payment_methods_api.cr

Constant Summary

GET_PAYMENT_METHODS_MAX_LENGTH_FOR_CUSTOMER = 5000
GET_PAYMENT_METHODS_PAYMENT_METHOD_MAX_LENGTH_FOR_PAYMENT_METHOD = 5000
GET_PAYMENT_METHODS_VALID_VALUES_FOR__TYPE = String.static_array("acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip")
POST_PAYMENT_METHODS_MAX_LENGTH_FOR_CUSTOMER = 5000
POST_PAYMENT_METHODS_MAX_LENGTH_FOR_PAYMENT_METHOD = 5000
POST_PAYMENT_METHODS_PAYMENT_METHOD_ATTACH_MAX_LENGTH_FOR_CUSTOMER = 5000
POST_PAYMENT_METHODS_PAYMENT_METHOD_ATTACH_MAX_LENGTH_FOR_PAYMENT_METHOD = 5000
POST_PAYMENT_METHODS_PAYMENT_METHOD_DETACH_MAX_LENGTH_FOR_PAYMENT_METHOD = 5000
POST_PAYMENT_METHODS_PAYMENT_METHOD_MAX_LENGTH_FOR_PAYMENT_METHOD = 5000
POST_PAYMENT_METHODS_PAYMENT_METHOD_VALID_VALUES_FOR_ALLOW_REDISPLAY = String.static_array("always", "limited", "unspecified")
POST_PAYMENT_METHODS_VALID_VALUES_FOR__TYPE = String.static_array("acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip")
POST_PAYMENT_METHODS_VALID_VALUES_FOR_ALLOW_REDISPLAY = String.static_array("always", "limited", "unspecified")

Constructors

Instance Method Summary

Constructor Detail

def self.new(api_client : Stripe::ApiClient = ApiClient.default) #

[View source]

Instance Method Detail

def api_client : ApiClient #

[View source]
def api_client=(api_client : ApiClient) #

[View source]
def build_api_request_for_get_payment_methods(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, _type : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, customer : String | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_payment_methods_payment_method(*, payment_method : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_payment_methods(*, acss_debit : Stripe::PaymentMethodParam | Nil = nil, affirm : JSON::Any | Nil = nil, afterpay_clearpay : JSON::Any | Nil = nil, alipay : JSON::Any | Nil = nil, allow_redisplay : String | Nil = nil, amazon_pay : JSON::Any | Nil = nil, au_becs_debit : Stripe::Param | Nil = nil, bacs_debit : Stripe::Param1 | Nil = nil, bancontact : JSON::Any | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, blik : JSON::Any | Nil = nil, boleto : Stripe::Param2 | Nil = nil, card : Stripe::PostPaymentMethodsRequestCard | Nil = nil, cashapp : JSON::Any | Nil = nil, customer : String | Nil = nil, customer_balance : JSON::Any | Nil = nil, eps : Stripe::Param3 | Nil = nil, expand : Array(String) | Nil = nil, fpx : Stripe::PaymentMethodFpx | Nil = nil, giropay : JSON::Any | Nil = nil, grabpay : JSON::Any | Nil = nil, ideal : Stripe::Param4 | Nil = nil, interac_present : JSON::Any | Nil = nil, klarna : Stripe::Param5 | Nil = nil, konbini : JSON::Any | Nil = nil, link : JSON::Any | Nil = nil, metadata : Hash(String, String) | Nil = nil, mobilepay : JSON::Any | Nil = nil, multibanco : JSON::Any | Nil = nil, oxxo : JSON::Any | Nil = nil, p24 : Stripe::Param6 | Nil = nil, payment_method : String | Nil = nil, paynow : JSON::Any | Nil = nil, paypal : JSON::Any | Nil = nil, pix : JSON::Any | Nil = nil, promptpay : JSON::Any | Nil = nil, radar_options : Stripe::RadarOptionsWithHiddenOptions | Nil = nil, revolut_pay : JSON::Any | Nil = nil, sepa_debit : Stripe::Param7 | Nil = nil, sofort : Stripe::Param8 | Nil = nil, swish : JSON::Any | Nil = nil, twint : JSON::Any | Nil = nil, _type : String | Nil = nil, us_bank_account : Stripe::PaymentMethodParam | Nil = nil, wechat_pay : JSON::Any | Nil = nil, zip : JSON::Any | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_payment_methods_payment_method(*, payment_method : String | Nil = nil, allow_redisplay : String | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, card : Stripe::UpdateApiParam | Nil = nil, expand : Array(String) | Nil = nil, link : JSON::Any | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, us_bank_account : Stripe::UpdateParam | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_payment_methods_payment_method_attach(*, payment_method : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_payment_methods_payment_method_detach(*, payment_method : String | Nil = nil, expand : Array(String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def client_side_validation?(*args, **options) #

[View source]
def client_side_validation?(*args, **options, &) #

[View source]
def debugging?(*args, **options) #

[View source]
def debugging?(*args, **options, &) #

[View source]
def get_payment_methods(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, _type : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, customer : String | Nil = nil) : Stripe::PaymentFlowsPaymentMethodList #

Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.

@optional @param ending_before [String?] A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param _type [String?] An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param customer [String?] The ID of the customer whose PaymentMethods will be retrieved. @return [Stripe::PaymentFlowsPaymentMethodList]

[View source]
def get_payment_methods(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, _type : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, customer : String | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the <a href=&quot;/docs/api/payment_methods/customer_list&quot;>List a Customer’s PaymentMethods</a> API instead.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param _type [String?] An optional filter on the list, based on the object type field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param customer [String?] The ID of the customer whose PaymentMethods will be retrieved. @return nil


[View source]
def get_payment_methods_payment_method(*, payment_method : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Stripe::PaymentMethod #

Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use Retrieve a Customer’s PaymentMethods

@required @param payment_method [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Stripe::PaymentMethod]

[View source]
def get_payment_methods_payment_method(*, payment_method : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use <a href=&quot;/docs/api/payment_methods/customer&quot;>Retrieve a Customer’s PaymentMethods</a></p> @required @param payment_method [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return nil


[View source]
def get_payment_methods_payment_method_with_http_info(*, payment_method : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Tuple(Stripe::PaymentMethod, Int32, Hash(String, Array(String) | String)) #

<p>Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use <a href=&quot;/docs/api/payment_methods/customer&quot;>Retrieve a Customer’s PaymentMethods</a></p> @required @param payment_method [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::PaymentMethod, Integer, Hash)] Stripe::PaymentMethod, response status code and response headers


[View source]
def get_payment_methods_with_http_info(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, _type : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, customer : String | Nil = nil) : Tuple(Stripe::PaymentFlowsPaymentMethodList, Int32, Hash(String, Array(String) | String)) #

<p>Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the <a href=&quot;/docs/api/payment_methods/customer_list&quot;>List a Customer’s PaymentMethods</a> API instead.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param _type [String?] An optional filter on the list, based on the object type field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param customer [String?] The ID of the customer whose PaymentMethods will be retrieved. @return [Tuple(Stripe::PaymentFlowsPaymentMethodList, Integer, Hash)] Stripe::PaymentFlowsPaymentMethodList, response status code and response headers


[View source]
def post_payment_methods(*, acss_debit : Stripe::PaymentMethodParam | Nil = nil, affirm : JSON::Any | Nil = nil, afterpay_clearpay : JSON::Any | Nil = nil, alipay : JSON::Any | Nil = nil, allow_redisplay : String | Nil = nil, amazon_pay : JSON::Any | Nil = nil, au_becs_debit : Stripe::Param | Nil = nil, bacs_debit : Stripe::Param1 | Nil = nil, bancontact : JSON::Any | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, blik : JSON::Any | Nil = nil, boleto : Stripe::Param2 | Nil = nil, card : Stripe::PostPaymentMethodsRequestCard | Nil = nil, cashapp : JSON::Any | Nil = nil, customer : String | Nil = nil, customer_balance : JSON::Any | Nil = nil, eps : Stripe::Param3 | Nil = nil, expand : Array(String) | Nil = nil, fpx : Stripe::PaymentMethodFpx | Nil = nil, giropay : JSON::Any | Nil = nil, grabpay : JSON::Any | Nil = nil, ideal : Stripe::Param4 | Nil = nil, interac_present : JSON::Any | Nil = nil, klarna : Stripe::Param5 | Nil = nil, konbini : JSON::Any | Nil = nil, link : JSON::Any | Nil = nil, metadata : Hash(String, String) | Nil = nil, mobilepay : JSON::Any | Nil = nil, multibanco : JSON::Any | Nil = nil, oxxo : JSON::Any | Nil = nil, p24 : Stripe::Param6 | Nil = nil, payment_method : String | Nil = nil, paynow : JSON::Any | Nil = nil, paypal : JSON::Any | Nil = nil, pix : JSON::Any | Nil = nil, promptpay : JSON::Any | Nil = nil, radar_options : Stripe::RadarOptionsWithHiddenOptions | Nil = nil, revolut_pay : JSON::Any | Nil = nil, sepa_debit : Stripe::Param7 | Nil = nil, sofort : Stripe::Param8 | Nil = nil, swish : JSON::Any | Nil = nil, twint : JSON::Any | Nil = nil, _type : String | Nil = nil, us_bank_account : Stripe::PaymentMethodParam | Nil = nil, wechat_pay : JSON::Any | Nil = nil, zip : JSON::Any | Nil = nil) : Stripe::PaymentMethod #

Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.

Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.

@optional @param acss_debit [Stripe::PaymentMethodParam?] @optional @param affirm [JSON::Any?] If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. @optional @param afterpay_clearpay [JSON::Any?] If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. @optional @param alipay [JSON::Any?] If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. @optional @param allow_redisplay [String?] This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. @optional @param amazon_pay [JSON::Any?] If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. @optional @param au_becs_debit [Stripe::Param?] @optional @param bacs_debit [Stripe::Param1?] @optional @param bancontact [JSON::Any?] If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. @optional @param billing_details [Stripe::BillingDetailsInnerParams?] @optional @param blik [JSON::Any?] If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. @optional @param boleto [Stripe::Param2?] @optional @param card [Stripe::PostPaymentMethodsRequestCard?] @optional @param cashapp [JSON::Any?] If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. @optional @param customer [String?] The `Customer` to whom the original PaymentMethod is attached. @optional @param customer_balance [JSON::Any?] If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. @optional @param eps [Stripe::Param3?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param fpx [Stripe::PaymentMethodFpx?] @optional @param giropay [JSON::Any?] If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. @optional @param grabpay [JSON::Any?] If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. @optional @param ideal [Stripe::Param4?] @optional @param interac_present [JSON::Any?] If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. @optional @param klarna [Stripe::Param5?] @optional @param konbini [JSON::Any?] If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. @optional @param link [JSON::Any?] If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @optional @param metadata [Hash(String, String)?] @optional @param mobilepay [JSON::Any?] If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. @optional @param multibanco [JSON::Any?] If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. @optional @param oxxo [JSON::Any?] If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. @optional @param p24 [Stripe::Param6?] @optional @param payment_method [String?] The PaymentMethod to share. @optional @param paynow [JSON::Any?] If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. @optional @param paypal [JSON::Any?] If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. @optional @param pix [JSON::Any?] If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. @optional @param promptpay [JSON::Any?] If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. @optional @param radar_options [Stripe::RadarOptionsWithHiddenOptions?] @optional @param revolut_pay [JSON::Any?] If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. @optional @param sepa_debit [Stripe::Param7?] @optional @param sofort [Stripe::Param8?] @optional @param swish [JSON::Any?] If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. @optional @param twint [JSON::Any?] If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. @optional @param _type [String?] The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @optional @param us_bank_account [Stripe::PaymentMethodParam?] @optional @param wechat_pay [JSON::Any?] If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. @optional @param zip [JSON::Any?] If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. @return [Stripe::PaymentMethod]

[View source]
def post_payment_methods(*, acss_debit : Stripe::PaymentMethodParam | Nil = nil, affirm : JSON::Any | Nil = nil, afterpay_clearpay : JSON::Any | Nil = nil, alipay : JSON::Any | Nil = nil, allow_redisplay : String | Nil = nil, amazon_pay : JSON::Any | Nil = nil, au_becs_debit : Stripe::Param | Nil = nil, bacs_debit : Stripe::Param1 | Nil = nil, bancontact : JSON::Any | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, blik : JSON::Any | Nil = nil, boleto : Stripe::Param2 | Nil = nil, card : Stripe::PostPaymentMethodsRequestCard | Nil = nil, cashapp : JSON::Any | Nil = nil, customer : String | Nil = nil, customer_balance : JSON::Any | Nil = nil, eps : Stripe::Param3 | Nil = nil, expand : Array(String) | Nil = nil, fpx : Stripe::PaymentMethodFpx | Nil = nil, giropay : JSON::Any | Nil = nil, grabpay : JSON::Any | Nil = nil, ideal : Stripe::Param4 | Nil = nil, interac_present : JSON::Any | Nil = nil, klarna : Stripe::Param5 | Nil = nil, konbini : JSON::Any | Nil = nil, link : JSON::Any | Nil = nil, metadata : Hash(String, String) | Nil = nil, mobilepay : JSON::Any | Nil = nil, multibanco : JSON::Any | Nil = nil, oxxo : JSON::Any | Nil = nil, p24 : Stripe::Param6 | Nil = nil, payment_method : String | Nil = nil, paynow : JSON::Any | Nil = nil, paypal : JSON::Any | Nil = nil, pix : JSON::Any | Nil = nil, promptpay : JSON::Any | Nil = nil, radar_options : Stripe::RadarOptionsWithHiddenOptions | Nil = nil, revolut_pay : JSON::Any | Nil = nil, sepa_debit : Stripe::Param7 | Nil = nil, sofort : Stripe::Param8 | Nil = nil, swish : JSON::Any | Nil = nil, twint : JSON::Any | Nil = nil, _type : String | Nil = nil, us_bank_account : Stripe::PaymentMethodParam | Nil = nil, wechat_pay : JSON::Any | Nil = nil, zip : JSON::Any | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Creates a PaymentMethod object. Read the <a href=&quot;/docs/stripe-js/reference#stripe-create-payment-method&quot;>Stripe.js reference</a> to learn how to create PaymentMethods via Stripe.js.</p> <p>Instead of creating a PaymentMethod directly, we recommend using the <a href=&quot;/docs/payments/accept-a-payment&quot;>PaymentIntents</a> API to accept a payment immediately or the <a href=&quot;/docs/payments/save-and-reuse&quot;>SetupIntent</a> API to collect payment method details ahead of a future payment.</p> @optional @param acss_debit [Stripe::PaymentMethodParam?] @optional @param affirm [JSON::Any?] If this is an affirm PaymentMethod, this hash contains details about the Affirm payment method. @optional @param afterpay_clearpay [JSON::Any?] If this is an AfterpayClearpay PaymentMethod, this hash contains details about the AfterpayClearpay payment method. @optional @param alipay [JSON::Any?] If this is an Alipay PaymentMethod, this hash contains details about the Alipay payment method. @optional @param allow_redisplay [String?] This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to unspecified. @optional @param amazon_pay [JSON::Any?] If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. @optional @param au_becs_debit [Stripe::Param?] @optional @param bacs_debit [Stripe::Param1?] @optional @param bancontact [JSON::Any?] If this is a bancontact PaymentMethod, this hash contains details about the Bancontact payment method. @optional @param billing_details [Stripe::BillingDetailsInnerParams?] @optional @param blik [JSON::Any?] If this is a blik PaymentMethod, this hash contains details about the BLIK payment method. @optional @param boleto [Stripe::Param2?] @optional @param card [Stripe::PostPaymentMethodsRequestCard?] @optional @param cashapp [JSON::Any?] If this is a cashapp PaymentMethod, this hash contains details about the Cash App Pay payment method. @optional @param customer [String?] The Customer to whom the original PaymentMethod is attached. @optional @param customer_balance [JSON::Any?] If this is a customer_balance PaymentMethod, this hash contains details about the CustomerBalance payment method. @optional @param eps [Stripe::Param3?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param fpx [Stripe::PaymentMethodFpx?] @optional @param giropay [JSON::Any?] If this is a giropay PaymentMethod, this hash contains details about the Giropay payment method. @optional @param grabpay [JSON::Any?] If this is a grabpay PaymentMethod, this hash contains details about the GrabPay payment method. @optional @param ideal [Stripe::Param4?] @optional @param interac_present [JSON::Any?] If this is an interac_present PaymentMethod, this hash contains details about the Interac Present payment method. @optional @param klarna [Stripe::Param5?] @optional @param konbini [JSON::Any?] If this is a konbini PaymentMethod, this hash contains details about the Konbini payment method. @optional @param link [JSON::Any?] If this is an Link PaymentMethod, this hash contains details about the Link payment method. @optional @param metadata [Hash(String, String)?] @optional @param mobilepay [JSON::Any?] If this is a mobilepay PaymentMethod, this hash contains details about the MobilePay payment method. @optional @param multibanco [JSON::Any?] If this is a multibanco PaymentMethod, this hash contains details about the Multibanco payment method. @optional @param oxxo [JSON::Any?] If this is an oxxo PaymentMethod, this hash contains details about the OXXO payment method. @optional @param p24 [Stripe::Param6?] @optional @param payment_method [String?] The PaymentMethod to share. @optional @param paynow [JSON::Any?] If this is a paynow PaymentMethod, this hash contains details about the PayNow payment method. @optional @param paypal [JSON::Any?] If this is a paypal PaymentMethod, this hash contains details about the PayPal payment method. @optional @param pix [JSON::Any?] If this is a pix PaymentMethod, this hash contains details about the Pix payment method. @optional @param promptpay [JSON::Any?] If this is a promptpay PaymentMethod, this hash contains details about the PromptPay payment method. @optional @param radar_options [Stripe::RadarOptionsWithHiddenOptions?] @optional @param revolut_pay [JSON::Any?] If this is a Revolut Pay PaymentMethod, this hash contains details about the Revolut Pay payment method. @optional @param sepa_debit [Stripe::Param7?] @optional @param sofort [Stripe::Param8?] @optional @param swish [JSON::Any?] If this is a swish PaymentMethod, this hash contains details about the Swish payment method. @optional @param twint [JSON::Any?] If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. @optional @param _type [String?] The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @optional @param us_bank_account [Stripe::PaymentMethodParam?] @optional @param wechat_pay [JSON::Any?] If this is an wechat_pay PaymentMethod, this hash contains details about the wechat_pay payment method. @optional @param zip [JSON::Any?] If this is a zip PaymentMethod, this hash contains details about the Zip payment method. @return nil


[View source]
def post_payment_methods_payment_method(*, payment_method : String | Nil = nil, allow_redisplay : String | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, card : Stripe::UpdateApiParam | Nil = nil, expand : Array(String) | Nil = nil, link : JSON::Any | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, us_bank_account : Stripe::UpdateParam | Nil = nil) : Stripe::PaymentMethod #

Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.

@required @param payment_method [String?] @optional @param allow_redisplay [String?] This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. @optional @param billing_details [Stripe::BillingDetailsInnerParams?] @optional @param card [Stripe::UpdateApiParam?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param link [JSON::Any?] If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param us_bank_account [Stripe::UpdateParam?] @return [Stripe::PaymentMethod]

[View source]
def post_payment_methods_payment_method(*, payment_method : String | Nil = nil, allow_redisplay : String | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, card : Stripe::UpdateApiParam | Nil = nil, expand : Array(String) | Nil = nil, link : JSON::Any | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, us_bank_account : Stripe::UpdateParam | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.</p> @required @param payment_method [String?] @optional @param allow_redisplay [String?] This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to unspecified. @optional @param billing_details [Stripe::BillingDetailsInnerParams?] @optional @param card [Stripe::UpdateApiParam?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param link [JSON::Any?] If this is an Link PaymentMethod, this hash contains details about the Link payment method. @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param us_bank_account [Stripe::UpdateParam?] @return nil


[View source]
def post_payment_methods_payment_method_attach(*, payment_method : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil) : Stripe::PaymentMethod #

Attaches a PaymentMethod object to a Customer.

To attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent or a PaymentIntent with setup_future_usage. These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See Optimizing cards for future payments for more information about setting up future payments.

To use this PaymentMethod as the default for invoice or subscription payments, set invoice_settings.default_payment_method, on the Customer to the PaymentMethod’s ID.

@required @param payment_method [String?] @required @param customer [String?] The ID of the customer to which to attach the PaymentMethod. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Stripe::PaymentMethod]

[View source]
def post_payment_methods_payment_method_attach(*, payment_method : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Attaches a PaymentMethod object to a Customer.</p> <p>To attach a new PaymentMethod to a customer for future payments, we recommend you use a <a href=&quot;/docs/api/setup_intents&quot;>SetupIntent</a> or a PaymentIntent with <a href=&quot;/docs/api/payment_intents/create#create_payment_intent-setup_future_usage&quot;>setup_future_usage</a>. These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the <code>/v1/payment_methods/:id/attach</code> endpoint without first using a SetupIntent or PaymentIntent with <code>setup_future_usage</code> does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See <a href=&quot;/docs/payments/payment-intents#future-usage&quot;>Optimizing cards for future payments</a> for more information about setting up future payments.</p> <p>To use this PaymentMethod as the default for invoice or subscription payments, set <a href=&quot;/docs/api/customers/update#update_customer-invoice_settings-default_payment_method&quot;><code>invoice_settings.default_payment_method</code></a>, on the Customer to the PaymentMethod’s ID.</p> @required @param payment_method [String?] @required @param customer [String?] The ID of the customer to which to attach the PaymentMethod. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return nil


[View source]
def post_payment_methods_payment_method_attach_with_http_info(*, payment_method : String | Nil = nil, customer : String | Nil = nil, expand : Array(String) | Nil = nil) : Tuple(Stripe::PaymentMethod, Int32, Hash(String, Array(String) | String)) #

<p>Attaches a PaymentMethod object to a Customer.</p> <p>To attach a new PaymentMethod to a customer for future payments, we recommend you use a <a href=&quot;/docs/api/setup_intents&quot;>SetupIntent</a> or a PaymentIntent with <a href=&quot;/docs/api/payment_intents/create#create_payment_intent-setup_future_usage&quot;>setup_future_usage</a>. These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the <code>/v1/payment_methods/:id/attach</code> endpoint without first using a SetupIntent or PaymentIntent with <code>setup_future_usage</code> does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See <a href=&quot;/docs/payments/payment-intents#future-usage&quot;>Optimizing cards for future payments</a> for more information about setting up future payments.</p> <p>To use this PaymentMethod as the default for invoice or subscription payments, set <a href=&quot;/docs/api/customers/update#update_customer-invoice_settings-default_payment_method&quot;><code>invoice_settings.default_payment_method</code></a>, on the Customer to the PaymentMethod’s ID.</p> @required @param payment_method [String?] @required @param customer [String?] The ID of the customer to which to attach the PaymentMethod. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::PaymentMethod, Integer, Hash)] Stripe::PaymentMethod, response status code and response headers


[View source]
def post_payment_methods_payment_method_detach(*, payment_method : String | Nil = nil, expand : Array(String) | Nil = nil) : Stripe::PaymentMethod #

Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.

@required @param payment_method [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Stripe::PaymentMethod]

[View source]
def post_payment_methods_payment_method_detach(*, payment_method : String | Nil = nil, expand : Array(String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.</p> @required @param payment_method [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return nil


[View source]
def post_payment_methods_payment_method_detach_with_http_info(*, payment_method : String | Nil = nil, expand : Array(String) | Nil = nil) : Tuple(Stripe::PaymentMethod, Int32, Hash(String, Array(String) | String)) #

<p>Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.</p> @required @param payment_method [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::PaymentMethod, Integer, Hash)] Stripe::PaymentMethod, response status code and response headers


[View source]
def post_payment_methods_payment_method_with_http_info(*, payment_method : String | Nil = nil, allow_redisplay : String | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, card : Stripe::UpdateApiParam | Nil = nil, expand : Array(String) | Nil = nil, link : JSON::Any | Nil = nil, metadata : Stripe::PostAccountsRequestMetadata | Nil = nil, us_bank_account : Stripe::UpdateParam | Nil = nil) : Tuple(Stripe::PaymentMethod, Int32, Hash(String, Array(String) | String)) #

<p>Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.</p> @required @param payment_method [String?] @optional @param allow_redisplay [String?] This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to unspecified. @optional @param billing_details [Stripe::BillingDetailsInnerParams?] @optional @param card [Stripe::UpdateApiParam?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param link [JSON::Any?] If this is an Link PaymentMethod, this hash contains details about the Link payment method. @optional @param metadata [Stripe::PostAccountsRequestMetadata?] @optional @param us_bank_account [Stripe::UpdateParam?] @return [Tuple(Stripe::PaymentMethod, Integer, Hash)] Stripe::PaymentMethod, response status code and response headers


[View source]
def post_payment_methods_with_http_info(*, acss_debit : Stripe::PaymentMethodParam | Nil = nil, affirm : JSON::Any | Nil = nil, afterpay_clearpay : JSON::Any | Nil = nil, alipay : JSON::Any | Nil = nil, allow_redisplay : String | Nil = nil, amazon_pay : JSON::Any | Nil = nil, au_becs_debit : Stripe::Param | Nil = nil, bacs_debit : Stripe::Param1 | Nil = nil, bancontact : JSON::Any | Nil = nil, billing_details : Stripe::BillingDetailsInnerParams | Nil = nil, blik : JSON::Any | Nil = nil, boleto : Stripe::Param2 | Nil = nil, card : Stripe::PostPaymentMethodsRequestCard | Nil = nil, cashapp : JSON::Any | Nil = nil, customer : String | Nil = nil, customer_balance : JSON::Any | Nil = nil, eps : Stripe::Param3 | Nil = nil, expand : Array(String) | Nil = nil, fpx : Stripe::PaymentMethodFpx | Nil = nil, giropay : JSON::Any | Nil = nil, grabpay : JSON::Any | Nil = nil, ideal : Stripe::Param4 | Nil = nil, interac_present : JSON::Any | Nil = nil, klarna : Stripe::Param5 | Nil = nil, konbini : JSON::Any | Nil = nil, link : JSON::Any | Nil = nil, metadata : Hash(String, String) | Nil = nil, mobilepay : JSON::Any | Nil = nil, multibanco : JSON::Any | Nil = nil, oxxo : JSON::Any | Nil = nil, p24 : Stripe::Param6 | Nil = nil, payment_method : String | Nil = nil, paynow : JSON::Any | Nil = nil, paypal : JSON::Any | Nil = nil, pix : JSON::Any | Nil = nil, promptpay : JSON::Any | Nil = nil, radar_options : Stripe::RadarOptionsWithHiddenOptions | Nil = nil, revolut_pay : JSON::Any | Nil = nil, sepa_debit : Stripe::Param7 | Nil = nil, sofort : Stripe::Param8 | Nil = nil, swish : JSON::Any | Nil = nil, twint : JSON::Any | Nil = nil, _type : String | Nil = nil, us_bank_account : Stripe::PaymentMethodParam | Nil = nil, wechat_pay : JSON::Any | Nil = nil, zip : JSON::Any | Nil = nil) : Tuple(Stripe::PaymentMethod, Int32, Hash(String, Array(String) | String)) #

<p>Creates a PaymentMethod object. Read the <a href=&quot;/docs/stripe-js/reference#stripe-create-payment-method&quot;>Stripe.js reference</a> to learn how to create PaymentMethods via Stripe.js.</p> <p>Instead of creating a PaymentMethod directly, we recommend using the <a href=&quot;/docs/payments/accept-a-payment&quot;>PaymentIntents</a> API to accept a payment immediately or the <a href=&quot;/docs/payments/save-and-reuse&quot;>SetupIntent</a> API to collect payment method details ahead of a future payment.</p> @optional @param acss_debit [Stripe::PaymentMethodParam?] @optional @param affirm [JSON::Any?] If this is an affirm PaymentMethod, this hash contains details about the Affirm payment method. @optional @param afterpay_clearpay [JSON::Any?] If this is an AfterpayClearpay PaymentMethod, this hash contains details about the AfterpayClearpay payment method. @optional @param alipay [JSON::Any?] If this is an Alipay PaymentMethod, this hash contains details about the Alipay payment method. @optional @param allow_redisplay [String?] This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to unspecified. @optional @param amazon_pay [JSON::Any?] If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. @optional @param au_becs_debit [Stripe::Param?] @optional @param bacs_debit [Stripe::Param1?] @optional @param bancontact [JSON::Any?] If this is a bancontact PaymentMethod, this hash contains details about the Bancontact payment method. @optional @param billing_details [Stripe::BillingDetailsInnerParams?] @optional @param blik [JSON::Any?] If this is a blik PaymentMethod, this hash contains details about the BLIK payment method. @optional @param boleto [Stripe::Param2?] @optional @param card [Stripe::PostPaymentMethodsRequestCard?] @optional @param cashapp [JSON::Any?] If this is a cashapp PaymentMethod, this hash contains details about the Cash App Pay payment method. @optional @param customer [String?] The Customer to whom the original PaymentMethod is attached. @optional @param customer_balance [JSON::Any?] If this is a customer_balance PaymentMethod, this hash contains details about the CustomerBalance payment method. @optional @param eps [Stripe::Param3?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param fpx [Stripe::PaymentMethodFpx?] @optional @param giropay [JSON::Any?] If this is a giropay PaymentMethod, this hash contains details about the Giropay payment method. @optional @param grabpay [JSON::Any?] If this is a grabpay PaymentMethod, this hash contains details about the GrabPay payment method. @optional @param ideal [Stripe::Param4?] @optional @param interac_present [JSON::Any?] If this is an interac_present PaymentMethod, this hash contains details about the Interac Present payment method. @optional @param klarna [Stripe::Param5?] @optional @param konbini [JSON::Any?] If this is a konbini PaymentMethod, this hash contains details about the Konbini payment method. @optional @param link [JSON::Any?] If this is an Link PaymentMethod, this hash contains details about the Link payment method. @optional @param metadata [Hash(String, String)?] @optional @param mobilepay [JSON::Any?] If this is a mobilepay PaymentMethod, this hash contains details about the MobilePay payment method. @optional @param multibanco [JSON::Any?] If this is a multibanco PaymentMethod, this hash contains details about the Multibanco payment method. @optional @param oxxo [JSON::Any?] If this is an oxxo PaymentMethod, this hash contains details about the OXXO payment method. @optional @param p24 [Stripe::Param6?] @optional @param payment_method [String?] The PaymentMethod to share. @optional @param paynow [JSON::Any?] If this is a paynow PaymentMethod, this hash contains details about the PayNow payment method. @optional @param paypal [JSON::Any?] If this is a paypal PaymentMethod, this hash contains details about the PayPal payment method. @optional @param pix [JSON::Any?] If this is a pix PaymentMethod, this hash contains details about the Pix payment method. @optional @param promptpay [JSON::Any?] If this is a promptpay PaymentMethod, this hash contains details about the PromptPay payment method. @optional @param radar_options [Stripe::RadarOptionsWithHiddenOptions?] @optional @param revolut_pay [JSON::Any?] If this is a Revolut Pay PaymentMethod, this hash contains details about the Revolut Pay payment method. @optional @param sepa_debit [Stripe::Param7?] @optional @param sofort [Stripe::Param8?] @optional @param swish [JSON::Any?] If this is a swish PaymentMethod, this hash contains details about the Swish payment method. @optional @param twint [JSON::Any?] If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. @optional @param _type [String?] The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @optional @param us_bank_account [Stripe::PaymentMethodParam?] @optional @param wechat_pay [JSON::Any?] If this is an wechat_pay PaymentMethod, this hash contains details about the wechat_pay payment method. @optional @param zip [JSON::Any?] If this is a zip PaymentMethod, this hash contains details about the Zip payment method. @return [Tuple(Stripe::PaymentMethod, Integer, Hash)] Stripe::PaymentMethod, response status code and response headers


[View source]