class Stripe::PaymentIntent

Overview

A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through multiple statuses throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: Payment Intents API

Included Modules

Defined in:

stripe/models/payment_intent.cr

Constant Summary

ERROR_MESSAGE_FOR_CANCELLATION_REASON = "invalid value for \"cancellation_reason\", must be one of [abandoned, automatic, duplicate, failed_invoice, fraudulent, requested_by_customer, void_invoice]."
ERROR_MESSAGE_FOR_CAPTURE_METHOD = "invalid value for \"capture_method\", must be one of [automatic, automatic_async, manual]."
ERROR_MESSAGE_FOR_CONFIRMATION_METHOD = "invalid value for \"confirmation_method\", must be one of [automatic, manual]."
ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [payment_intent]."
ERROR_MESSAGE_FOR_SETUP_FUTURE_USAGE = "invalid value for \"setup_future_usage\", must be one of [off_session, on_session]."
ERROR_MESSAGE_FOR_STATUS = "invalid value for \"status\", must be one of [canceled, processing, requires_action, requires_capture, requires_confirmation, requires_payment_method, succeeded]."
MAX_LENGTH_FOR_CLIENT_SECRET = 5000
MAX_LENGTH_FOR_DESCRIPTION = 5000
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_RECEIPT_EMAIL = 5000
MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR = 5000
MAX_LENGTH_FOR_STATEMENT_DESCRIPTOR_SUFFIX = 5000
MAX_LENGTH_FOR_TRANSFER_GROUP = 5000
VALID_VALUES_FOR_CANCELLATION_REASON = String.static_array("abandoned", "automatic", "duplicate", "failed_invoice", "fraudulent", "requested_by_customer", "void_invoice")
VALID_VALUES_FOR_CAPTURE_METHOD = String.static_array("automatic", "automatic_async", "manual")
VALID_VALUES_FOR_CONFIRMATION_METHOD = String.static_array("automatic", "manual")
VALID_VALUES_FOR_OBJECT = String.static_array("payment_intent")
VALID_VALUES_FOR_SETUP_FUTURE_USAGE = String.static_array("off_session", "on_session")
VALID_VALUES_FOR_STATUS = String.static_array("canceled", "processing", "requires_action", "requires_capture", "requires_confirmation", "requires_payment_method", "succeeded")

Constructors

Instance Method Summary

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

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(*, amount : Int64 | Nil = nil, amount_capturable : Int64 | Nil = nil, amount_received : Int64 | Nil = nil, application : Stripe::PaymentIntentApplication | Nil = nil, application_fee_amount : Int64 | Nil = nil, automatic_payment_methods : Stripe::PaymentIntentAutomaticPaymentMethods | Nil = nil, canceled_at : Int64 | Nil = nil, cancellation_reason : String | Nil = nil, capture_method : String | Nil = nil, client_secret : String | Nil = nil, confirmation_method : String | Nil = nil, created : Int64 | Nil = nil, currency : String | Nil = nil, customer : Stripe::PaymentIntentCustomer | Nil = nil, description : String | Nil = nil, id : String | Nil = nil, invoice : Stripe::PaymentIntentInvoice | Nil = nil, last_payment_error : Stripe::PaymentIntentLastPaymentError | Nil = nil, latest_charge : Stripe::PaymentIntentLatestCharge | Nil = nil, livemode : Bool | Nil = nil, metadata : Hash(String, String) | Nil = nil, next_action : Stripe::PaymentIntentNextAction1 | Nil = nil, object : String | Nil = nil, on_behalf_of : Stripe::PaymentIntentOnBehalfOf | Nil = nil, payment_method : Stripe::PaymentIntentPaymentMethod | Nil = nil, payment_method_configuration_details : Stripe::PaymentIntentPaymentMethodConfigurationDetails | Nil = nil, payment_method_options : Stripe::PaymentIntentPaymentMethodOptions1 | Nil = nil, payment_method_types : Array(String) | Nil = nil, processing : Stripe::PaymentIntentProcessing1 | Nil = nil, receipt_email : String | Nil = nil, review : Stripe::PaymentIntentReview | Nil = nil, setup_future_usage : String | Nil = nil, shipping : Stripe::PaymentIntentShipping | Nil = nil, source : Stripe::PaymentIntentSource | Nil = nil, statement_descriptor : String | Nil = nil, statement_descriptor_suffix : String | Nil = nil, status : String | Nil = nil, transfer_data : Stripe::PaymentIntentTransferData | Nil = nil, transfer_group : String | Nil = nil, amount_details : Stripe::PaymentFlowsAmountDetails | Nil = nil) #

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


[View source]

Instance Method Detail

def ==(other : self) #

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


def amount : Int64 | Nil #

[View source]
def amount=(new_value : Int64 | Nil) #

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


[View source]
def amount_capturable : Int64 | Nil #

[View source]
def amount_capturable=(new_value : Int64 | Nil) #

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


[View source]
def amount_details : Stripe::PaymentFlowsAmountDetails | Nil #

[View source]
def amount_details=(new_value : Stripe::PaymentFlowsAmountDetails | Nil) #

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


[View source]
def amount_received : Int64 | Nil #

[View source]
def amount_received=(new_value : Int64 | Nil) #

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


[View source]
def application : Stripe::PaymentIntentApplication | Nil #

[View source]
def application=(new_value : Stripe::PaymentIntentApplication | Nil) #

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


[View source]
def application_fee_amount : Int64 | Nil #

[View source]
def application_fee_amount=(new_value : Int64 | Nil) #

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


[View source]
def automatic_payment_methods : Stripe::PaymentIntentAutomaticPaymentMethods | Nil #

[View source]
def automatic_payment_methods=(new_value : Stripe::PaymentIntentAutomaticPaymentMethods | Nil) #

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


[View source]
def canceled_at : Int64 | Nil #

[View source]
def canceled_at=(new_value : Int64 | Nil) #

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


[View source]
def cancellation_reason : String | Nil #

[View source]
def cancellation_reason=(new_value : String | Nil) #

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


[View source]
def capture_method : String | Nil #

[View source]
def capture_method=(new_value : String | Nil) #

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


[View source]
def client_secret : String | Nil #

[View source]
def client_secret=(new_value : String | Nil) #

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


[View source]
def confirmation_method : String | Nil #

[View source]
def confirmation_method=(new_value : String | Nil) #

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


[View source]
def created : Int64 | Nil #

[View source]
def created=(new_value : Int64 | Nil) #

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


[View source]
def currency : String | Nil #

[View source]
def currency=(new_value : String | Nil) #

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


[View source]
def customer : Stripe::PaymentIntentCustomer | Nil #

[View source]
def customer=(new_value : Stripe::PaymentIntentCustomer | Nil) #

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


[View source]
def description : String | Nil #

[View source]
def description=(new_value : String | Nil) #

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


[View source]
def hash(hasher) #

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


def id : String | Nil #

[View source]
def id=(new_value : String | Nil) #

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


[View source]
def invoice : Stripe::PaymentIntentInvoice | Nil #

[View source]
def invoice=(new_value : Stripe::PaymentIntentInvoice | Nil) #

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


[View source]
def last_payment_error : Stripe::PaymentIntentLastPaymentError | Nil #

[View source]
def last_payment_error=(new_value : Stripe::PaymentIntentLastPaymentError | Nil) #

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


[View source]
def latest_charge : Stripe::PaymentIntentLatestCharge | Nil #

[View source]
def latest_charge=(new_value : Stripe::PaymentIntentLatestCharge | Nil) #

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


[View source]
def list_invalid_properties : Array(String) #

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


[View source]
def livemode : Bool | Nil #

[View source]
def livemode=(new_value : Bool | Nil) #

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


[View source]
def metadata : Hash(String, String) | Nil #

[View source]
def metadata=(new_value : Hash(String, String) | Nil) #

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


[View source]
def next_action : Stripe::PaymentIntentNextAction1 | Nil #

[View source]
def next_action=(new_value : Stripe::PaymentIntentNextAction1 | Nil) #

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


[View source]
def object : String | Nil #

[View source]
def object=(new_value : String | Nil) #

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


[View source]
def on_behalf_of : Stripe::PaymentIntentOnBehalfOf | Nil #

[View source]
def on_behalf_of=(new_value : Stripe::PaymentIntentOnBehalfOf | Nil) #

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


[View source]
def payment_method : Stripe::PaymentIntentPaymentMethod | Nil #

[View source]
def payment_method=(new_value : Stripe::PaymentIntentPaymentMethod | Nil) #

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


[View source]
def payment_method_configuration_details : Stripe::PaymentIntentPaymentMethodConfigurationDetails | Nil #

[View source]
def payment_method_configuration_details=(new_value : Stripe::PaymentIntentPaymentMethodConfigurationDetails | Nil) #

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


[View source]
def payment_method_options : Stripe::PaymentIntentPaymentMethodOptions1 | Nil #

[View source]
def payment_method_options=(new_value : Stripe::PaymentIntentPaymentMethodOptions1 | Nil) #

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


[View source]
def payment_method_types : Array(String) | Nil #

[View source]
def payment_method_types=(new_value : Array(String) | Nil) #

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


[View source]
def processing : Stripe::PaymentIntentProcessing1 | Nil #

[View source]
def processing=(new_value : Stripe::PaymentIntentProcessing1 | Nil) #

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


[View source]
def receipt_email : String | Nil #

[View source]
def receipt_email=(new_value : String | Nil) #

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


[View source]
def review : Stripe::PaymentIntentReview | Nil #

[View source]
def review=(new_value : Stripe::PaymentIntentReview | Nil) #

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


[View source]
def setup_future_usage : String | Nil #

[View source]
def setup_future_usage=(new_value : String | Nil) #

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


[View source]
def shipping : Stripe::PaymentIntentShipping | Nil #

[View source]
def shipping=(new_value : Stripe::PaymentIntentShipping | Nil) #

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


[View source]
def source : Stripe::PaymentIntentSource | Nil #

[View source]
def source=(new_value : Stripe::PaymentIntentSource | Nil) #

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


[View source]
def statement_descriptor : String | Nil #

[View source]
def statement_descriptor=(new_value : String | Nil) #

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


[View source]
def statement_descriptor_suffix : String | Nil #

[View source]
def statement_descriptor_suffix=(new_value : String | Nil) #

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


[View source]
def status : String | Nil #

[View source]
def status=(new_value : String | Nil) #

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


[View source]
def transfer_data : Stripe::PaymentIntentTransferData | Nil #

[View source]
def transfer_data=(new_value : Stripe::PaymentIntentTransferData | Nil) #

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


[View source]
def transfer_group : String | Nil #

[View source]
def transfer_group=(new_value : String | Nil) #

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


[View source]
def valid? : Bool #

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


[View source]