1. Payments
Documentation
  • Back to home
  • StripeKit
  • Installation
  • Getting Started
  • Choosing a Mode
  • Type Reference
  • Setup
    • Configuration
    • Timezones
    • Storage Adapter
    • Money and Currency
    • Error Handling
  • Stripe
    • Elements
  • Modules
    • Overview
    • Customers
      • Overview
      • List
      • Retrieve
      • Find or Create by Email
      • Create
      • Update
      • Sync
      • Delete
    • Payment Methods
      • Overview
      • Create Setup Intent
      • List
      • Attach
      • Detach
      • Set Default
      • Sync
    • Payments
      • Overview
      • Pay With Saved Method
      • Create
      • Retrieve
      • Confirm
      • Cancel
      • Sync
    • Checkout
      • Overview
      • Get
      • Create
      • Submit Fields
      • Apply Coupon
      • Mark Complete
    • Subscriptions
      • Overview
      • Create
      • Retrieve
      • Cancel
      • Resume
      • Toggle Collection Method
      • Update Fields
      • Apply Promotion Code
      • List By Customer
      • Find By Metadata
      • Sync
    • Invoices
      • Overview
      • Retrieve
      • List By Customer
      • List By Subscription
      • Pay With Saved Method
      • Void
      • Finalize
      • Sync
    • Coupons
      • Overview
      • Create
      • Validate
      • Apply To Subscription
      • List
      • Deactivate
    • Webhooks
      • Overview
      • Process
      • Events Reference
    • Sync
      • Overview
  1. Payments

Pay With Saved Method

$kit->payments->payWithSavedMethod()#

Charges a payment method the customer already saved, entirely server-side, with no customer interaction. This is the method for recurring or scheduled off-session charges that are not part of a Stripe Subscription, for example a usage-based top-up.

Signature#

Parameters#

FieldTypeRequiredDescription
paymentIntentIdstringNoIf given, confirms this existing PaymentIntent off-session instead of creating a new one.
amountintOnly if paymentIntentId is not givenAmount in minor currency units, minimum 50.
currencystringOnly if paymentIntentId is not given3-letter ISO code.
customerIdstringYesThe customer being charged.
paymentMethodIdstringYesThe saved payment method to charge.
descriptionstringNoDescription on the PaymentIntent.
metadataarray<string,string>NoMerged with source: "stripekit_saved_method".
returnUrlstringNoOnly used when confirming an existing paymentIntentId.

Example request#

Example response#

If additional authentication is required, status is 'requires_action' and requiresAction is true, in which case you'll need to bring the customer back to complete verification using clientSecret.

Errors#

ExceptionWhen
ConfigurationErrorNeither paymentIntentId nor both amount and currency were provided.
ValidationErroramount is below the 50 minor unit minimum, or currency is invalid.
StripeOperationErrorThe card is declined, or Stripe otherwise rejects the charge.

Notes#

Always sets off_session: true and confirm: true under the hood, since the entire point of this method is charging without the customer present.
When creating a new PaymentIntent (no paymentIntentId given), redirect-based payment methods are disabled (allow_redirects: 'never'), since there is no customer present to redirect.
The result is persisted via savePayment() when a storage adapter is configured.
Previous
Overview
Next
Create
Built with