Charge
class Charge extends Resource implements ChargeInterface
To charge a credit or a debit card, you create a Charge object. You can retrieve and refund individual charges as well as list all charges. Charges are identified by a unique, random ID.
Traits
Properties
string | $id | A unique identifier for the resource. | from Resource |
protected mixed | $response | A response from Stripe. | from Resource |
Methods
Charge a Customer. A Customer must have some sort of payment source. Usually they payment source is a card, and it is added via a token that is created using JavaScript on the front end. This helps keep your application PCI compliant.
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.
Call the Stripe API.
Details
in Resource at line 29
string
getId()
Returns the unique identifier for this resource.
in Resource at line 39
mixed
getResponse()
Returns the raw Stripe response.
in Resource at line 47
protected void
setProperties()
Set the response data as properties on the class.
in ListAll at line 21
ListAll
listAll(array $arguments = [])
List all the resources.
This will list all of the resources from which this trait belongs to. It will then return itself, so you can method chain it, or reuse the same instantiation.
at line 39
ChargeInterface
create(CustomerInterface $customer, int $amount, array $arguments = [], string $key = null, string $currency = 'usd')
Charge a Customer. A Customer must have some sort of payment source. Usually they payment source is a card, and it is added via a token that is created using JavaScript on the front end. This helps keep your application PCI compliant.
at line 60
ChargeInterface
capture(string $id)
Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.
at line 75
protected void
stripe(string $method, mixed $arguments, string $idempotencyKey = null)
Call the Stripe API.