1. Payment Methods
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. Payment Methods

Overview

$kit->paymentMethods manages the cards and bank accounts saved against a Stripe customer: listing them, attaching or detaching them, marking one as default, and setting up new ones for future use.

Methods#

MethodDescription
list()List a customer's saved payment methods.
attach()Attach an existing payment method to a customer.
detach()Remove a payment method from a customer.
setDefault()Mark a payment method as the customer's default.
createSetupIntent()Start a Stripe Elements flow to save a new card without charging it.
sync()Re-pull a customer's payment methods and persist them via your storage adapter.

The KitPaymentMethodRecord shape#

array{
    id: string,
    userId: string|int|null,
    customerId: string|null,
    type: string,
    brand: string|null,
    last4: string|null,
    expMonth: int|null,
    expYear: int|null,
    isDefault: bool,
    createdAtUtc: string|null,
}
brand, last4, expMonth and expYear are populated for card payment methods. For sepa_debit, only last4 is populated. For any other payment method type, all four fields are null.
Previous
Delete
Next
Create Setup Intent
Built with