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

Overview

$kit->payments handles one-off charges (Stripe PaymentIntents), respecting the mode configured on StripeKit::init(). See Choosing a mode if you haven't already.

Methods#

MethodDescription
create()Start a new one-off payment.
retrieve()Fetch a payment by ID.
confirm()Confirm a PaymentIntent server-side.
cancel()Cancel a PaymentIntent that hasn't succeeded yet.
payWithSavedMethod()Charge a card the customer already saved, with no customer interaction.
sync()Re-pull a payment from Stripe and persist it via your storage adapter.

Two different response shapes#

This is the part of the payments module that trips people up: create() and payWithSavedMethod() return a flow-oriented shape (PaymentResult, focused on hostedUrl / clientSecret), while retrieve(), confirm(), cancel() and sync() return a record-oriented shape (KitPaymentRecord, focused on the full normalized payment details). Each method's own page shows exactly which shape it returns.
PaymentResult (from create() and payWithSavedMethod()):
array{
    id: string,
    mode: 'api'|'elements',
    status: string,
    amount: int,
    currency: string,
    clientSecret: string|null,
    hostedUrl: string|null,
    requiresAction: bool,
}
KitPaymentRecord (from retrieve(), confirm(), cancel(), sync()):
array{
    id: string,
    userId: string|int|null,
    customerId: string|null,
    invoiceId: string|null,
    amount: int,
    currency: string,
    status: string,
    description: string|null,
    paymentMethodType: string|null,
    paymentMethodBrand: string|null,
    paymentMethodLast4: string|null,
    receiptEmail: string|null,
    metadata: array<string, string>,
    createdAtUtc: string|null,
}
Previous
Sync
Next
Pay With Saved Method
Built with