class Stripe::Charge
- Stripe::Charge
- Reference
- Object
Overview
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.
Included Modules
- JSON::Serializable
- JSON::Serializable::Unmapped
- OpenApi::Json
- OpenApi::Validatable
Defined in:
stripe/models/charge.crConstant Summary
-
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 : JSON::PullParser)
-
.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
Instance Method Summary
-
#==(other : self)
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes.
- #amount : Int64 | Nil
-
#amount=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #amount_captured : Int64 | Nil
-
#amount_captured=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #amount_refunded : Int64 | Nil
-
#amount_refunded=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #application : Stripe::ChargeApplication | Nil
-
#application=(new_value : Stripe::ChargeApplication | Nil)
Custom attribute writer method checking allowed values (enum).
- #application_fee : Stripe::ChargeApplicationFee | Nil
-
#application_fee=(new_value : Stripe::ChargeApplicationFee | Nil)
Custom attribute writer method checking allowed values (enum).
- #application_fee_amount : Int64 | Nil
-
#application_fee_amount=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #authorization_code : String | Nil
-
#authorization_code=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #balance_transaction : Stripe::ChargeBalanceTransaction | Nil
-
#balance_transaction=(new_value : Stripe::ChargeBalanceTransaction | Nil)
Custom attribute writer method checking allowed values (enum).
- #billing_details : Stripe::BillingDetails | Nil
-
#billing_details=(new_value : Stripe::BillingDetails | Nil)
Custom attribute writer method checking allowed values (enum).
- #calculated_statement_descriptor : String | Nil
-
#calculated_statement_descriptor=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #captured : Bool | Nil
-
#captured=(new_value : Bool | Nil)
Custom attribute writer method checking allowed values (enum).
- #created : Int64 | Nil
-
#created=(new_value : Int64 | Nil)
Custom attribute writer method checking allowed values (enum).
- #currency : String | Nil
-
#currency=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #customer : Stripe::ChargeCustomer | Nil
-
#customer=(new_value : Stripe::ChargeCustomer | Nil)
Custom attribute writer method checking allowed values (enum).
- #description : String | Nil
-
#description=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #disputed : Bool | Nil
-
#disputed=(new_value : Bool | Nil)
Custom attribute writer method checking allowed values (enum).
- #failure_balance_transaction : Stripe::ChargeFailureBalanceTransaction | Nil
-
#failure_balance_transaction=(new_value : Stripe::ChargeFailureBalanceTransaction | Nil)
Custom attribute writer method checking allowed values (enum).
- #failure_code : String | Nil
-
#failure_code=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #failure_message : String | Nil
-
#failure_message=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #fraud_details : Stripe::ChargeFraudDetails1 | Nil
-
#fraud_details=(new_value : Stripe::ChargeFraudDetails1 | Nil)
Custom attribute writer method checking allowed values (enum).
-
#hash(hasher)
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes.
- #id : String | Nil
-
#id=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #invoice : Stripe::ChargeInvoice | Nil
-
#invoice=(new_value : Stripe::ChargeInvoice | Nil)
Custom attribute writer method checking allowed values (enum).
- #level3 : Stripe::Level3 | Nil
-
#level3=(new_value : Stripe::Level3 | Nil)
Custom attribute writer method checking allowed values (enum).
-
#list_invalid_properties : Array(String)
Show invalid properties with the reasons.
- #livemode : Bool | Nil
-
#livemode=(new_value : Bool | Nil)
Custom attribute writer method checking allowed values (enum).
- #metadata : Hash(String, String) | Nil
-
#metadata=(new_value : Hash(String, String) | Nil)
Custom attribute writer method checking allowed values (enum).
- #object : String | Nil
-
#object=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #on_behalf_of : Stripe::ChargeOnBehalfOf | Nil
-
#on_behalf_of=(new_value : Stripe::ChargeOnBehalfOf | Nil)
Custom attribute writer method checking allowed values (enum).
- #outcome : Stripe::ChargeOutcome1 | Nil
-
#outcome=(new_value : Stripe::ChargeOutcome1 | Nil)
Custom attribute writer method checking allowed values (enum).
- #paid : Bool | Nil
-
#paid=(new_value : Bool | Nil)
Custom attribute writer method checking allowed values (enum).
- #payment_intent : Stripe::ChargePaymentIntent | Nil
-
#payment_intent=(new_value : Stripe::ChargePaymentIntent | Nil)
Custom attribute writer method checking allowed values (enum).
- #payment_method : String | Nil
-
#payment_method=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #payment_method_details : Stripe::ChargePaymentMethodDetails | Nil
-
#payment_method_details=(new_value : Stripe::ChargePaymentMethodDetails | Nil)
Custom attribute writer method checking allowed values (enum).
- #radar_options : Stripe::RadarRadarOptions | Nil
-
#radar_options=(new_value : Stripe::RadarRadarOptions | Nil)
Custom attribute writer method checking allowed values (enum).
- #receipt_email : String | Nil
-
#receipt_email=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #receipt_number : String | Nil
-
#receipt_number=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #receipt_url : String | Nil
-
#receipt_url=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #refunded : Bool | Nil
-
#refunded=(new_value : Bool | Nil)
Custom attribute writer method checking allowed values (enum).
- #refunds : Stripe::RefundList | Nil
-
#refunds=(new_value : Stripe::RefundList | Nil)
Custom attribute writer method checking allowed values (enum).
- #refunds_present=(refunds_present : Bool)
- #refunds_present? : Bool
- #review : Stripe::ChargeReview | Nil
-
#review=(new_value : Stripe::ChargeReview | Nil)
Custom attribute writer method checking allowed values (enum).
- #shipping : Stripe::ChargeShipping | Nil
-
#shipping=(new_value : Stripe::ChargeShipping | Nil)
Custom attribute writer method checking allowed values (enum).
- #source : Stripe::ChargeSource | Nil
-
#source=(new_value : Stripe::ChargeSource | Nil)
Custom attribute writer method checking allowed values (enum).
- #source_transfer : Stripe::ChargeSourceTransfer | Nil
-
#source_transfer=(new_value : Stripe::ChargeSourceTransfer | Nil)
Custom attribute writer method checking allowed values (enum).
- #statement_descriptor : String | Nil
-
#statement_descriptor=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #statement_descriptor_suffix : String | Nil
-
#statement_descriptor_suffix=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #status : String | Nil
-
#status=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
- #transfer : Stripe::ChargeTransfer | Nil
-
#transfer=(new_value : Stripe::ChargeTransfer | Nil)
Custom attribute writer method checking allowed values (enum).
- #transfer_data : Stripe::ChargeTransferData1 | Nil
-
#transfer_data=(new_value : Stripe::ChargeTransferData1 | Nil)
Custom attribute writer method checking allowed values (enum).
- #transfer_group : String | Nil
-
#transfer_group=(new_value : String | Nil)
Custom attribute writer method checking allowed values (enum).
-
#valid? : Bool
Check to see if the all the properties in the model are valid @return true if the model is valid
Instance methods inherited from module OpenApi::Json
after_initialize
after_initialize,
clone
clone,
eql?(o : self)
eql?,
to_hash : Hash(String, JSON::Any)
to_hash,
to_json_any : JSON::Any
to_json_any
Class methods inherited from module OpenApi::Json
build_from_hash(hash : Hash)
build_from_hash,
build_from_json_any(json_any : JSON::Any)
build_from_json_any
Instance methods inherited from module OpenApi::Validatable
list_invalid_properties : Array(String)
list_invalid_properties,
list_invalid_properties_for(key : String) : Array(String)
list_invalid_properties_for,
valid? : Bool
valid?,
validate : Nil
validate
Constructor Detail
Initializes the object @param [Hash] attributes Model attributes in the form of hash
Instance Method Detail
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code
Custom attribute writer method checking allowed values (enum). @param [Object] amount Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] amount_captured Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] amount_refunded Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] application Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] application_fee Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] application_fee_amount Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] authorization_code Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] balance_transaction Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] billing_details Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] calculated_statement_descriptor Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] captured Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] customer Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] description Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] disputed Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] failure_balance_transaction Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] failure_code Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] failure_message Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] fraud_details Object to be assigned
Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code
Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] invoice Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] level3 Object to be assigned
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] on_behalf_of Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] outcome Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] paid Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] payment_intent Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] payment_method Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] payment_method_details Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] radar_options Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] receipt_email Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] receipt_number Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] receipt_url Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] refunded Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] refunds Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] review Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] shipping Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] source Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] source_transfer Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] statement_descriptor Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] statement_descriptor_suffix Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] transfer Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] transfer_data Object to be assigned
Custom attribute writer method checking allowed values (enum). @param [Object] transfer_group Object to be assigned
Check to see if the all the properties in the model are valid @return true if the model is valid