NAME
Net::API::Stripe::Charge - The Charge object of Stripe API
SYNOPSIS
VERSION
0.1
DESCRIPTION
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.
CONSTRUCTOR
- new( %ARG )
-
Creates a new
Net::API::Stripe
objects. It may also take an hash like arguments, that also are method of the same name.- verbose
-
Toggles verbose mode on/off
- debug
-
Toggles debug mode on/off
METHODS
- id string
-
Unique identifier for the object.
- object string, value is "charge"
-
String representing the object’s type. Objects of the same type share the same value.
- amount positive integer or zero
-
A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
- amount_refunded positive integer or zero
-
Amount in JPY refunded (can be less than the amount attribute on the charge if a partial refund was issued).
- application string expandable "application"
-
ID of the Connect application that created the charge. This represents a
Net::API::Stripe::Connect::Account
object - application_fee string (expandable)
-
The application fee (if any) for the charge. See the Connect documentation for details. This is a
Net::API::Stripe::Connect::ApplicationFee
object. - application_fee_amount integer
-
The amount of the application fee (if any) for the charge. See the Connect documentation for details.
- balance_transaction string (expandable)
-
ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).
This is an
Net::API::Stripe::Balance::Transaction
object. - billing_details hash
-
Billing information associated with the payment method at the time of the transaction. This is a
Net::API::Stripe::Billing::Details
object.Show child attributes
- captured boolean
-
If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.
- card
-
This is a
Net::API::Stripe::Payment::Card
object. It seems it is no documented, but from experience, Stripe has replied with data containing this property. - created timestamp
-
Time at which the object was created. Measured in seconds since the Unix epoch.
- currency currency
-
Three-letter ISO currency code, in lowercase. Must be a supported currency.
- customer string (expandable)
-
ID of the customer this charge is for if one exists.
This is a
Net::API::Stripe::Customer
object. - description string
-
An arbitrary string attached to the object. Often useful for displaying to users.
- destination
-
This is a
Net::API::Stripe::Connect::Account
object. But, as of 2019-10-16, it seems absent from Stripe API documentation, so maybe it was removed? - dispute string (expandable)
-
Details about the dispute if the charge has been disputed.
When expanded, this is a
Net::API::Stripe::Dispute
object. - failure_code string
-
Error code explaining reason for charge failure if available (see the errors section for a list of codes).
- failure_message string
-
Message to user further explaining reason for charge failure if available.
- fraud_details hash
-
Information on fraud assessments for the charge.
- invoice string (expandable)
-
ID of the invoice this charge is for if one exists.
When expanded, this is a
Net::API::Stripe::Billing::Invoice
object. - livemode boolean
-
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
- metadata hash
-
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- on_behalf_of string (expandable)
-
The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details.
When expanded, this is a
Net::API::Stripe::Connect::Account
object - order string (expandable)
-
ID of the order this charge is for if one exists.
When expanded, this is a
Net::API::Stripe::Order
object. - outcome hash
-
Details about whether the payment was accepted, and why. See understanding declines for details.
This is a
Net::API::Stripe::Charge::Outcome
object. - paid boolean
-
true if the charge succeeded, or was successfully authorized for later capture.
- payment_intent string
-
ID of the PaymentIntent associated with this charge, if one exists.
This is a <Net::API::Stripe::Payment::Intent> object if any.
- payment_method string
-
ID of the payment method used in this charge.
- payment_method_details hash
-
Details about the payment method at the time of the transaction. Show child attributes
- receipt_email string
-
This is the email address that the receipt for this charge was sent to.
- receipt_number string
-
This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent.
- receipt_url string
-
This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt.
- refunded boolean
-
Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.
- refunds list
-
A list of refunds that have been applied to the charge.
This is a
Net::API::Stripe::Charge::Refunds
object. - review string (expandable)
-
ID of the review associated with this charge if one exists.
When expanded, this is a
Net::API::Stripe::Fraud::Review
object. - shipping hash
-
Shipping information for the charge. This is a
Net::API::Stripe::Shipping
object. - source
-
This represents a
Net::API::Stripe::Payment::Card
object.It was present before, or at least used in Stripe response, but it is not anymore on the API documentation as of 2019-10-16.
- source_transfer string (expandable)
-
The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details here: https://stripe.com/docs/connect/destination-charges
When expanded, this is a
Net::API::Stripe::Connect::Transfer
object. - statement_descriptor string
-
For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
- statement_description
-
This is an alternative found in data returned by Stripe. Probably an old property deprecated?
- statement_descriptor_suffix string
-
Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
- status string
-
The status of the payment is either succeeded, pending, or failed.
- transfer string (expandable)
-
ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter).
When expanded, this is a
Net::API::Stripe::Connect::Transfer
object. - transfer_data hash
-
An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details.
This is a
Net::API::Stripe::Connect::Transfer
object, although in the documentation only the following 2 properties are used:- amount integer
-
The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account.
- destination string (expandable)
-
ID of an existing, connected Stripe account to transfer funds to if transfer_data was specified in the charge request.
If expanded, this is a
Net::API::Stripe::Connect::Account
object.
- transfer_group string
-
A string that identifies this transaction as part of a group. See the Connect documentation for details.
API SAMPLE
{
"id": "ch_1FTxyCCeyNCl6fY2aYoHTBBF",
"object": "charge",
"amount": 100,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_1FTlZvCeyNCl6fY2qIteNrPe",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"captured": false,
"created": 1571176460,
"currency": "jpy",
"customer": null,
"description": "My First Test Charge (created for API docs)",
"dispute": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"order": null,
"outcome": null,
"paid": true,
"payment_intent": null,
"payment_method": "card_1DSiVdCeyNCl6fY2xvLI809J",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": null
},
"country": "US",
"exp_month": 4,
"exp_year": 2024,
"fingerprint": "x18XyLUPM6hub5xz",
"funding": "credit",
"installments": null,
"last4": "4242",
"network": "visa",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/acct_19eGgRCeyNCl6fY2/ch_1FTxyCCeyNCl6fY2aYoHTBBF/rcpt_FzxuG1UR6Pj9Er68sVPgHRNMLeKZomf",
"refunded": false,
"refunds": {
"object": "list",
"data": [],
"has_more": false,
"url": "/v1/charges/ch_1FTxyCCeyNCl6fY2aYoHTBBF/refunds"
},
"review": null,
"shipping": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
HISTORY
v0.1
Initial version
AUTHOR
Jacques Deguest <jack@deguest.jp>
SEE ALSO
Stripe API documentation:
https://stripe.com/docs/api/charges, https://stripe.com/docs/charges
COPYRIGHT & LICENSE
Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 159:
You forgot a '=back' before '=head1'