Class PaymentMethodService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionattach
(String paymentMethod, PaymentMethodAttachParams params) Attaches a PaymentMethod object to a Customer.attach
(String paymentMethod, PaymentMethodAttachParams params, RequestOptions options) Attaches a PaymentMethod object to a Customer.create()
Creates a PaymentMethod object.create
(RequestOptions options) Creates a PaymentMethod object.create
(PaymentMethodCreateParams params) Creates a PaymentMethod object.create
(PaymentMethodCreateParams params, RequestOptions options) Creates a PaymentMethod object.Detaches a PaymentMethod object from a Customer.detach
(String paymentMethod, RequestOptions options) Detaches a PaymentMethod object from a Customer.detach
(String paymentMethod, PaymentMethodDetachParams params) Detaches a PaymentMethod object from a Customer.detach
(String paymentMethod, PaymentMethodDetachParams params, RequestOptions options) Detaches a PaymentMethod object from a Customer.list()
Returns a list of PaymentMethods for Treasury flows.list
(RequestOptions options) Returns a list of PaymentMethods for Treasury flows.list
(PaymentMethodListParams params) Returns a list of PaymentMethods for Treasury flows.list
(PaymentMethodListParams params, RequestOptions options) Returns a list of PaymentMethods for Treasury flows.Retrieves a PaymentMethod object attached to the StripeAccount.retrieve
(String paymentMethod, RequestOptions options) Retrieves a PaymentMethod object attached to the StripeAccount.retrieve
(String paymentMethod, PaymentMethodRetrieveParams params) Retrieves a PaymentMethod object attached to the StripeAccount.retrieve
(String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) Retrieves a PaymentMethod object attached to the StripeAccount.Updates a PaymentMethod object.update
(String paymentMethod, RequestOptions options) Updates a PaymentMethod object.update
(String paymentMethod, PaymentMethodUpdateParams params) Updates a PaymentMethod object.update
(String paymentMethod, PaymentMethodUpdateParams params, RequestOptions options) Updates a PaymentMethod object.Methods inherited from class com.stripe.net.ApiService
getResponseGetter, request, requestStream
-
Constructor Details
-
PaymentMethodService
-
-
Method Details
-
list
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.- Throws:
StripeException
-
list
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.- Throws:
StripeException
-
list
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.- Throws:
StripeException
-
list
public StripeCollection<PaymentMethod> list(PaymentMethodListParams params, RequestOptions options) throws StripeException 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.- Throws:
StripeException
-
create
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.
- Throws:
StripeException
-
create
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.
- Throws:
StripeException
-
create
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.
- Throws:
StripeException
-
create
public PaymentMethod create(PaymentMethodCreateParams params, RequestOptions options) throws StripeException 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.
- Throws:
StripeException
-
retrieve
public PaymentMethod retrieve(String paymentMethod, PaymentMethodRetrieveParams params) throws StripeException 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- Throws:
StripeException
-
retrieve
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- Throws:
StripeException
-
retrieve
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- Throws:
StripeException
-
retrieve
public PaymentMethod retrieve(String paymentMethod, PaymentMethodRetrieveParams params, RequestOptions options) throws StripeException 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- Throws:
StripeException
-
update
public PaymentMethod update(String paymentMethod, PaymentMethodUpdateParams params) throws StripeException Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Throws:
StripeException
-
update
Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Throws:
StripeException
-
update
Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Throws:
StripeException
-
update
public PaymentMethod update(String paymentMethod, PaymentMethodUpdateParams params, RequestOptions options) throws StripeException Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.- Throws:
StripeException
-
attach
public PaymentMethod attach(String paymentMethod, PaymentMethodAttachParams params) throws StripeException 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 withsetup_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.- Throws:
StripeException
-
attach
public PaymentMethod attach(String paymentMethod, PaymentMethodAttachParams params, RequestOptions options) throws StripeException 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 withsetup_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.- Throws:
StripeException
-
detach
public PaymentMethod detach(String paymentMethod, PaymentMethodDetachParams params) throws StripeException 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.- Throws:
StripeException
-
detach
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.- Throws:
StripeException
-
detach
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.- Throws:
StripeException
-
detach
public PaymentMethod detach(String paymentMethod, PaymentMethodDetachParams params, RequestOptions options) throws StripeException 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.- Throws:
StripeException
-