class

Stripe::Charge

Inherits OpenApi::Json < OpenApi::Validatable < JSON::Serializable::Unmapped < JSON::Serializable < Reference < Object

The Charge object represents a single attempt to move money into your Stripe account. PaymentIntent confirmation is the most common way to create Charges, but transferring money to a different Stripe account through Connect also creates Charges. Some legacy payment flows create Charges directly, which is not recommended for new integrations.

Constants

ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [charge]."
ERROR_MESSAGE_FOR_STATUS = "invalid value for \"status\", must be one of [failed, pending, succeeded]."
MAX_LENGTH_FOR_AUTHORIZATION_CODE = 5000
MAX_LENGTH_FOR_CALCULATED_STATEMENT_DESCRIPTOR = 5000
MAX_LENGTH_FOR_DESCRIPTION = 40000
MAX_LENGTH_FOR_FAILURE_CODE = 5000
MAX_LENGTH_FOR_FAILURE_MESSAGE = 5000
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_PAYMENT_METHOD = 5000
MAX_LENGTH_FOR_RECEIPT_EMAIL = 5000
MAX_LENGTH_FOR_RECEIPT_NUMBER = 5000
MAX_LENGTH_FOR_RECEIPT_URL = 5000
MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR = 5000
MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR_SUFFIX = 5000
MAX_LENGTH_FOR_TRANSFER_GROUP = 5000
VALID_VALUES_FOR_OBJECT = String.static_array("charge")
VALID_VALUES_FOR_STATUS = String.static_array("failed", "pending", "succeeded")

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
new(*, amount : Int64 | Nil = nil, amount_captured : Int64 | Nil = nil, amount_refunded : Int64 | Nil = nil, application : Stripe::ChargeApplication | Nil = nil, application_fee : Stripe::ChargeApplicationFee | Nil = nil, application_fee_amount : Int64 | Nil = nil, balance_transaction : Stripe::ChargeBalanceTransaction | Nil = nil, billing_details : Stripe::BillingDetails | Nil = nil, calculated_statement_descriptor : String | Nil = nil, captured : Bool | Nil = nil, created : Int64 | Nil = nil, currency : String | Nil = nil, customer : Stripe::ChargeCustomer | Nil = nil, description : String | Nil = nil, disputed : Bool | Nil = nil, failure_balance_transaction : Stripe::ChargeFailureBalanceTransaction | Nil = nil, failure_code : String | Nil = nil, failure_message : String | Nil = nil, fraud_details : Stripe::ChargeFraudDetails1 | Nil = nil, id : String | Nil = nil, invoice : Stripe::ChargeInvoice | Nil = nil, livemode : Bool | Nil = nil, metadata : Hash(String, String) | Nil = nil, object : String | Nil = nil, on_behalf_of : Stripe::ChargeOnBehalfOf | Nil = nil, outcome : Stripe::ChargeOutcome1 | Nil = nil, paid : Bool | Nil = nil, payment_intent : Stripe::ChargePaymentIntent | Nil = nil, payment_method : String | Nil = nil, payment_method_details : Stripe::ChargePaymentMethodDetails | Nil = nil, receipt_email : String | Nil = nil, receipt_number : String | Nil = nil, receipt_url : String | Nil = nil, refunded : Bool | Nil = nil, review : Stripe::ChargeReview | Nil = nil, shipping : Stripe::ChargeShipping | Nil = nil, source : Stripe::ChargeSource | Nil = nil, source_transfer : Stripe::ChargeSourceTransfer | Nil = nil, statement_descriptor : String | Nil = nil, statement_descriptor_suffix : String | Nil = nil, status : String | Nil = nil, transfer_data : Stripe::ChargeTransferData1 | Nil = nil, transfer_group : String | Nil = nil, authorization_code : String | Nil = nil, level3 : Stripe::Level3 | Nil = nil, radar_options : Stripe::RadarRadarOptions | Nil = nil, refunds : Stripe::RefundList | Nil = nil, transfer : Stripe::ChargeTransfer | Nil = nil)

Initializes the object @param [Hash] attributes Model attributes in the form of hash

Source

Instance methods

==(other : self)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

amount

Amount intended to be collected by this payment. 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).

Source
amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount Object to be assigned

Source
amount_captured

Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made).

Source
amount_captured=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_captured Object to be assigned

Source
amount_refunded

Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued).

Source
amount_refunded=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_refunded Object to be assigned

Source
application
Source
application=(new_value : Stripe::ChargeApplication | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] application Object to be assigned

Source
application_fee
Source
application_fee=(new_value : Stripe::ChargeApplicationFee | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] application_fee Object to be assigned

Source
application_fee_amount

The amount of the application fee (if any) requested for the charge. See the Connect documentation for details.

Source
application_fee_amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] application_fee_amount Object to be assigned

Source
authorization_code

Authorization code on the charge.

Source
authorization_code=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] authorization_code Object to be assigned

Source
balance_transaction
Source
balance_transaction=(new_value : Stripe::ChargeBalanceTransaction | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] balance_transaction Object to be assigned

Source
billing_details
Source
billing_details=(new_value : Stripe::BillingDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] billing_details Object to be assigned

Source
calculated_statement_descriptor

The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments.

Source
calculated_statement_descriptor=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] calculated_statement_descriptor Object to be assigned

Source
captured

If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.

Source
captured=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] captured Object to be assigned

Source
created

Time at which the object was created. Measured in seconds since the Unix epoch.

Source
created=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned

Source
currency

Three-letter ISO currency code, in lowercase. Must be a supported currency.

Source
currency=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned

Source
customer
Source
customer=(new_value : Stripe::ChargeCustomer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer Object to be assigned

Source
description

An arbitrary string attached to the object. Often useful for displaying to users.

Source
description=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] description Object to be assigned

Source
disputed

Whether the charge has been disputed.

Source
disputed=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] disputed Object to be assigned

Source
failure_balance_transaction
Source
failure_balance_transaction=(new_value : Stripe::ChargeFailureBalanceTransaction | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] failure_balance_transaction Object to be assigned

Source
failure_code

Error code explaining reason for charge failure if available (see the errors section for a list of codes).

Source
failure_code=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] failure_code Object to be assigned

Source
failure_message

Message to user further explaining reason for charge failure if available.

Source
failure_message=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] failure_message Object to be assigned

Source
fraud_details
Source
fraud_details=(new_value : Stripe::ChargeFraudDetails1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] fraud_details Object to be assigned

Source
hash(hasher)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

id

Unique identifier for the object.

Source
id=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned

Source
invoice
Source
invoice=(new_value : Stripe::ChargeInvoice | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice Object to be assigned

Source
level3
Source
level3=(new_value : Stripe::Level3 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] level3 Object to be assigned

Source
list_invalid_properties

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

Source
livemode

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Source
livemode=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned

Source
metadata
Source
metadata=(new_value : Hash(String, String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned

Source
object

String representing the object's type. Objects of the same type share the same value.

Source
object=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned

Source
on_behalf_of
Source
on_behalf_of=(new_value : Stripe::ChargeOnBehalfOf | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] on_behalf_of Object to be assigned

Source
outcome
Source
outcome=(new_value : Stripe::ChargeOutcome1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] outcome Object to be assigned

Source
payment_intent
Source
payment_intent=(new_value : Stripe::ChargePaymentIntent | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_intent Object to be assigned

Source
payment_method

ID of the payment method used in this charge.

Source
payment_method=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method Object to be assigned

Source
payment_method_details
Source
payment_method_details=(new_value : Stripe::ChargePaymentMethodDetails | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_details Object to be assigned

Source
radar_options
Source
radar_options=(new_value : Stripe::RadarRadarOptions | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] radar_options Object to be assigned

Source
receipt_email

This is the email address that the receipt for this charge was sent to.

Source
receipt_email=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] receipt_email Object to be assigned

Source
receipt_number

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.

Source
receipt_number=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] receipt_number Object to be assigned

Source
receipt_url

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.

Source
receipt_url=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] receipt_url Object to be assigned

Source
refunded

Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.

Source
refunded=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] refunded Object to be assigned

Source
refunds
Source
refunds=(new_value : Stripe::RefundList | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] refunds Object to be assigned

Source
refunds_present=(refunds_present : Bool)
Source
refunds_present?
Source
review
Source
review=(new_value : Stripe::ChargeReview | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] review Object to be assigned

Source
shipping
Source
shipping=(new_value : Stripe::ChargeShipping | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping Object to be assigned

Source
source
Source
source=(new_value : Stripe::ChargeSource | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] source Object to be assigned

Source
source_transfer
Source
source_transfer=(new_value : Stripe::ChargeSourceTransfer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] source_transfer Object to be assigned

Source
statement_descriptor

For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see the Statement Descriptor docs. For a card charge, this value is ignored unless you don't specify a statement_descriptor_suffix, in which case this value is used as the suffix.

Source
statement_descriptor=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] statement_descriptor Object to be assigned

Source
statement_descriptor_suffix

Provides information about a card charge. Concatenated to the account's statement descriptor prefix to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor.

Source
statement_descriptor_suffix=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] statement_descriptor_suffix Object to be assigned

Source
status

The status of the payment is either succeeded, pending, or failed.

Source
status=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned

Source
transfer
Source
transfer=(new_value : Stripe::ChargeTransfer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] transfer Object to be assigned

Source
transfer_data
Source
transfer_data=(new_value : Stripe::ChargeTransferData1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] transfer_data Object to be assigned

Source
transfer_group

A string that identifies this transaction as part of a group. See the Connect documentation for details.

Source
transfer_group=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] transfer_group Object to be assigned

Source
valid?

Check to see if the all the properties in the model are valid @return true if the model is valid

Source