Payment Model

The Charge_PaymentModel is a record of a specific payment against a ChargeModel.

Each Payment model relates to a single payment event. If the original Charge was a one-time payment, there will only be a single payment model related to a Charge. If the Charge was recurring, each time the plan recurs a new payment model record will be created.

Make sure your web hooks are configured Recurring records of payments requires web hook callbacks from Charge. Without it, Charge can't see later payments made on recurring charges.

You'd access a payment via the parent charge, not directly. Payments for a charge are all available via the charge's payments and payment attributes.

Attributes #

id Number
The id for the payment.
stripeId String
The stripe id for the payment.
customerId Number
The id of the Charge Customer for this payment.
chargeId Number
The id of the parent Charge model for this payment.
userId Number
The id of the craft user for this payment.
mode String, live or test
The mode this payment was made under.
amount Number
The numeric amount for this payment. Will return similar to '5' for a $5 payment.
amountInCents Number
The integer value for the payment in pence/cents. Will return similar to '500' for a $5 payment.
amountFormatted String
A nicely formatted version of the payment amount, including the currency. Will return similar to '$5.00' for a $5 payment.
cardFormatted String
A nicely formatted version of the payment card details, as best they are available. This combines the card last 4 digits, card type, and intelligently includes spacing characters. Will return similar to ···· ···· ···· 4242.
cardType String
The payment card type. ie. Visa.
cardExpMonth String
The payment card expiry month, i.e. 7.
cardExpYear String
The payment card expiry year. ie. 2020.
cardName String
The supplied cardholder name. This is optional and might be blank.
Card address details. All are optional and might be blank. Don't rely on these for shipping address information. These specifically relate to the card billing address, and if supplied are used for fraud detection, not shipping address collection.
currency String
The currency code for the payment. ie. usd.
refunded Bool
A bool that indicates the state of a refund on a charge. Only returns true if the payment is fully refunded. If only partially refunded, it will still return false.
amountRefunded Number
The amount that has been refunded on a payment.
invoiceId String
The stripe invoice id that was used during the creation of this payment.
status String
The status of a payment. Can be succeeded, pending or failed. For the moment, this will always be succeeded in Charge.
receiptEmail String
The email that any receipt for the payment was sent to.
stripeLink String
Returns a ready to use url for linking directly to a specific stripe payment in the Stripe dashboard. This is useful for admin areas, or admin emails. Will return a url similar to :