Repository navigation
API Payment
Caligrafy Quill 2.32.0. Generated from the source by
php qa/build-api-reference.php; the guides explain how to use these classes, this reference says exactly what each public method takes and returns. Back to the API reference.
Part of Payments.
namespace Caligrafy;
class Payment extends \stdClassSource: framework/core/Payment.php:19
The Payment handles all payment transactions
->__construct()->createTransaction()->createPaymentIntent()->retrieveIntent()->createCheckout()->retrieveCheckout()->createAccount()->createAccountLink()->createLoginLink()->updateAccount()->retrieve()->createTransfer()->retrieveTransfer()->reverseTransfer()->getPublicKey()
public function __construct()Constructs the Payment Controller to initiate the Stripe api
Source: framework/core/Payment.php:48
public function createTransaction(
$amount,
$currency,
$card,
$receipt_email = null,
$metadata = null,
$description = '',
$transfer = array(),
$save = false
)Creates a new payment transaction
Parameters
-
$amountInteger: defines the amount of the transaction in cents -
$currencystring: defines the currecy of the transaction -
$cardObject: takes the card object submitted -
$receipt_emailstring, defaultnull: takes the customer email -
$metadatastring, defaultnull: defines the metadata information that can be passed on to the transaction -
$descriptionstring, default'': defines the description that can be passed on to the transaction -
$transfer, defaultarray() -
$saveboolean, defaultfalse: defines whether the transaction should be saved or not for a particular customer
Returns $result: to report on the result of the creation
Source: framework/core/Payment.php:78
public function createPaymentIntent(
$amount,
$currency,
$metadata = array(),
$receipt_email = null,
$description = '',
$transfer = array()
)Creates a new payment transaction that might require a customer authentication flow (3DSecure for example)
Parameters
-
$amountInteger: defines the amount of the transaction in cents -
$currencystring: defines the currecy of the transaction -
$metadatastring, defaultarray(): defines the metadata information that can be passed on to the transaction -
$receipt_emailstring, defaultnull: defines the email address where the receipt should be sent -
$descriptionstring, default'': defines a description of the product beind sold -
$transferarray, defaultarray(): defines the transfer data to vendors if they exist. keys possible: 'destination' for connected stripe account. 'amount' to define the amount the vendor will receive
Returns $result: to report on the result of the creation
Source: framework/core/Payment.php:124
public function retrieveIntent($intentId)Retrieve Payment Intent
Parameters
-
$intentIdstring
Returns $result: to report on the result of the creation
Source: framework/core/Payment.php:158
public function createCheckout(
$amount = 1000,
$currency = 'usd',
$quantity = 1,
$productData = array(),
$successUrl = '',
$cancelUrl = '',
$customerEmail = null,
$locale = null,
$paymentType = null,
$payment_intent_data = array(),
$vendor = array()
)Creates a new integrated checkout session
Parameters
-
$amountInteger, default1000: defines the amount of the transaction in cents -
$currencystring, default'usd': defines the currency of the transaction -
$quantitystring, default1: defines the quantity of products -
$productDatastring, defaultarray(): defines the product information that can be passed on to the transaction -
$successUrlstring, default'': defines the url that it will redirect to when successful payment -
$cancelUrlstring, default'': defines the url that it will redirect to when the payment fails -
$customerEmail, defaultnull -
$locale, defaultnull -
$paymentTypearray, defaultnull: defines the different payment methods to be supported by checkout -
$payment_intent_dataarray, defaultarray(): . Potential attributes: 'application_fee_amount' for charging vendors -
$vendorarray, defaultarray(): . Potential array keys: 'stripe_account' for the vendor account
Returns $result: to report on the result of the creation
Source: framework/core/Payment.php:193
public function retrieveCheckout($sessionId)Retrieve Checkout Session
Parameters
-
$sessionIdstring
Returns $result: to report on the result of the creation
Source: framework/core/Payment.php:256
public function createAccount(
$email = null,
$country = null,
$type = 'express',
$capabilities = array(),
$accountInformation = array()
)No doc comment.
Parameters
-
$email, defaultnull -
$country, defaultnull -
$type, default'express' -
$capabilities, defaultarray() -
$accountInformation, defaultarray()
Source: framework/core/Payment.php:283
public function createAccountLink($accountId, $refreshUrl, $returnUrl, $type = 'account_onboarding')No doc comment.
Parameters
$accountId$refreshUrl$returnUrl-
$type, default'account_onboarding'
Source: framework/core/Payment.php:314
public function createLoginLink($accountId)No doc comment.
Parameters
$accountId
Source: framework/core/Payment.php:333
public function updateAccount($accountId, $updates)No doc comment.
Parameters
$accountId$updates
Source: framework/core/Payment.php:350
public function retrieve($accountId)No doc comment.
Parameters
$accountId
Source: framework/core/Payment.php:365
public function createTransfer(
$amount,
$currency,
$destination,
$metadata = array(),
$transferGroup = null,
$description = null,
$idempotencyKey = null
)Sends money from the platform's Stripe balance to a connected account (Stripe Connect transfer) The platform's available balance must cover the amount, and the connected account needs the 'transfers' capability (createAccount requests it by default)
Parameters
-
$amountinteger: the amount in the smallest currency unit (cents for usd: 1250 is $12.50), like createPaymentIntent and createCheckout -
$currencystring: the currency of the transfer ('usd') -
$destinationstring: the id of the connected account that receives the money ('acct_...') -
$metadataarray, defaultarray(): key-value pairs kept on the transfer (an ambassador id, a month) -
$transferGroupstring, defaultnull: a string that groups the transfer with related charges or transfers -
$descriptionstring, defaultnull: a description of the transfer -
$idempotencyKeystring, defaultnull: sent as Stripe's Idempotency-Key: a retry with the same key returns the first transfer instead of sending the money twice (a monthly run can be run again safely)
Returns array: array('action_success' => true, 'data' => the Stripe Transfer) or array('action_success' => false, 'error' => the message)
Source: framework/core/Payment.php:390
public function retrieveTransfer($transferId)Retrieves a transfer to a connected account
Parameters
-
$transferIdstring: the id of the transfer ('tr_...')
Returns array: array('action_success' => true, 'data' => the Stripe Transfer) or array('action_success' => false, 'error' => the message)
Source: framework/core/Payment.php:412
public function reverseTransfer($transferId, $amount = null)Reverses a transfer: the money comes back from the connected account to the platform's balance (the connected account's balance must still hold it)
Parameters
-
$transferIdstring: the id of the transfer ('tr_...') -
$amountinteger, defaultnull: the amount to reverse in the smallest currency unit; null reverses the whole transfer
Returns array: array('action_success' => true, 'data' => the Stripe TransferReversal) or array('action_success' => false, 'error' => the message)
Source: framework/core/Payment.php:431
public function getPublicKey()Accessor that returns the public key
Source: framework/core/Payment.php:453
Caligrafy: Describe it. Approve it. Ship it. Your idea turned into a complete app: every feature built once, for web pages, Vue apps, a REST API and AI agents, and online.
Why Caligrafy: the benefits, the measurements, and what it is not yet
-
Quickstart with Claude: describe it, approve it, ship it
or the Quickstart: the same three steps by hand, in 5 minutes
- How Caligrafy works: the ideas in 5 minutes
- Your first capability: build a feature, page included
-
Capabilities in depth
-
#[Capability]: every option - Scheduled jobs: capabilities on a timer
- Notifications: web push and email
- Background jobs: capabilities run later
- Migrations: database changes, in order
- The cache
-
Testing your app
- Dependency injection
- Validation rules
-
Web pages
- Views and page components
- Design styles: another look, one setting
- Declarative routes: every request, in one line
-
Route::page·Route::form·Route::auth·Route::webhook·Route::download·Route::redirect·Route::action·Route::snap· capability routes - How to export a list as CSV
- Controllers: moving one to a declared route · how to, step by step
- Forms and helpers
-
Vue apps
-
Mobile and tablet
-
REST API
-
AI agents
-
Snap Cards and the assistant
- Payments: Stripe and crypto
- Face detection and face login
- OpenAI: chat and images · Assistants
- Open models: Llama, Mistral...
- Chatbots with Watson
- Machine learning in the browser
- Phone and tablet apps: iOS and Android
- Languages: translations, right to left
- Metadata and social cards · search and analytics
-
Putting it online: the production image, the database at every start
-
API reference: every class and method
-
Routing ·
Route·AuthRoutes· pages ·Controller· capabilities -
Data ·
Model·Query· sign-in · jobs ·Notify· payments · AI -
Interfaces · Snap ·
Snap\Cards·Snap\Conversation· testing · tooling · helper functions
-
Routing ·
-
Caligrafer: every command
- Project · build · data · agents · jobs and tests · maintenance · deploy
- Installation, configuration and Caligrafer
- Routing · Request · Controllers · Views
- Vue: flow of information · routes · validations
- Security and upgrading
- Release notes: 2.32 · 2.31 · 2.30 · 2.29 · 2.28 · 2.27 · 2.26 · 2.25 · 2.24 · 2.23 · 2.22 · 2.21 · 2.20 · 2.19 · 2.18 · 2.17 · 2.16 · 2.15 · 2.14 · 2.13 · 2.12 · 2.11 · 2.10 · 2.9 · 2.8 · 2.7 · 2.6 · 2.5 · 2.4 · 2.3 · 2.1 · October 2026 · changelog
- Testing Caligrafy (contributors)