Create a 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.
Parameters
- typeenumRequired
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.
- billing_
detailshash Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
- metadatahash
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
.
More parameters
- acss_
debithash - affirmhash
- afterpay_
clearpayhash - alipayhash
- allow_
redisplayenum - amazon_
payhash - au_
becs_ debithash - bacs_
debithash - bancontacthash
- blikhash
- boletohash
- cardhash
- cashapphash
- customer_
balancehash - epshash
- fpxhash
- giropayhash
- grabpayhash
- idealhash
- interac_
presenthashPreview feature - klarnahash
- konbinihash
- linkhash
- mobilepayhash
- oxxohash
- p24hash
- paynowhash
- paypalhash
- pixhash
- promptpayhash
- radar_
optionshash - revolut_
payhash - sepa_
debithash - soforthash
- swishhash
- us_
bank_ accounthash - wechat_
payhash - ziphash
Returns
Returns a PaymentMethod object.
Update a PaymentMethod
Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
Parameters
- billing_
detailshash Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
- metadatahash
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
.
More parameters
- allow_
redisplayenum - cardhash
- linkhash
- us_
bank_ accounthash
Returns
Returns a PaymentMethod object.
Retrieve a Customer's PaymentMethod
Retrieves a PaymentMethod object for a given Customer.
Parameters
No parameters.
Returns
Returns a PaymentMethod object.
Retrieve a 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
Parameters
No parameters.
Returns
Returns a PaymentMethod object.
List a Customer's PaymentMethods
Returns a list of PaymentMethods for a given Customer
Parameters
- typeenum
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.
More parameters
- allow_
redisplayenum - ending_
beforestring - limitinteger
- starting_
afterstring
Returns
A hash with a data
property that contains an array of up to limit
PaymentMethods of type type
, starting after PaymentMethods starting_after
. Each entry in the array is a separate PaymentMethod object. If no more PaymentMethods are available, the resulting array will be empty.