Class: Straddle::Models::Charge

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/straddle/models/charge.rb,
sig/straddle/models/charge.rbs

Constant Summary collapse

Straddle =

Returns:

  • (:CustomerDetails)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, amount:, config:, consent_type:, created_at:, currency:, description:, device:, external_id:, funding_ids:, has_refund:, has_resubmit:, is_resubmit:, paykey:, payment_date:, status:, status_details:, status_history:, trace_ids:, updated_at:, customer_details: nil, documents: nil, effective_at: nil, metadata: nil, paykey_details: nil, payment_rail: nil, processed_at: nil, related_payments: nil) ⇒ Object

Some parameter documentations has been truncated, see Straddle::Models::Charge for more details.

Parameters:

  • id (String) —

    Unique identifier for this charge.

  • amount (Integer) —

    Amount in cents.

  • config (Straddle::Models::ChargeConfiguration) —

    Configuration options for the charge.

  • consent_type (Symbol, Straddle::Models::ConsentType) —

    How the customer authorized the charge. internet covers online and mobile auth

  • created_at (Time, nil) —

    Timestamp when this charge was created.

  • currency (String) —

    Currency code. Only USD is supported.

  • description (String, nil) —

    A human-readable description of the charge.

  • device (Straddle::Models::MaskedPaymentDevice) —

    Device used when the customer authorized the charge.

  • external_id (String) —

    Your unique identifier for this charge, used to correlate with your internal rec

  • funding_ids (Array<String>) —

    IDs of the funding events that included this charge.

  • has_refund (Boolean) —

    Whether an associated payout has refunded this charge.

  • has_resubmit (Boolean) —

    Whether this charge has been resubmitted.

  • is_resubmit (Boolean) —

    Whether this charge resubmits an original charge.

  • paykey (String) —

    The masked paykey token used for this charge.

  • payment_date (Date) —

    Date when Straddle submits the charge for processing.

  • status (Symbol, Straddle::Models::PaymentStatus) —

    The current status of the charge.

  • status_details (Straddle::Models::PaymentStatusDetails) —

    Reason, source, and message for the most recent charge status change.

  • status_history (Array<Straddle::Models::PaymentStatusHistory>) —

    Complete ordered history of all status changes for this charge.

  • trace_ids (Hash{Symbol=>String}) —

    Trace identifiers from the payment network. Keys depend on the payment rail.

  • updated_at (Time, nil) —

    Timestamp when this charge was last updated.

  • customer_details (Straddle::Models::CustomerDetails) (defaults to: nil) —

    Information about the customer associated with the charge.

  • documents (Array<Straddle::Models::PaymentAuthorizationProof>, nil) (defaults to: nil) —

    Authorization documents for this charge, ordered by upload time.

  • effective_at (Time, nil) (defaults to: nil) —

    Timestamp when funds were settled. Null until settlement is confirmed.

  • metadata (Hash{Symbol=>String}, nil) (defaults to: nil) —

    Key-value metadata stored with this charge.

  • paykey_details (Straddle::Models::PaykeyDetails) (defaults to: nil) —

    Information about the paykey used for the charge.

  • payment_rail (Symbol, Straddle::Models::PaymentRail) (defaults to: nil) —

    Payment rail used to process the charge.

  • processed_at (Time, nil) (defaults to: nil) —

    Timestamp when this charge was submitted to the payment network. Null until proc

  • related_payments (Array<Straddle::Models::RelatedPayment>, nil) (defaults to: nil) —

    Related payments and their relationship to this charge.



# File 'lib/straddle/models/charge.rb', line 181

Instance Attribute Details

#amount ⇒ Integer

Amount in cents.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


16
# File 'lib/straddle/models/charge.rb', line 16

required :amount, Integer

#config ⇒ Straddle::Models::ChargeConfiguration

Configuration options for the charge.



22
# File 'lib/straddle/models/charge.rb', line 22

required :config, -> { Straddle::ChargeConfiguration }

How the customer authorized the charge. internet covers online and mobile authorization. signed covers written or PDF-signed agreements.

Parameters:

  • value (Straddle::Models::consent_type)

Returns:



29
# File 'lib/straddle/models/charge.rb', line 29

required :consent_type, enum: -> { Straddle::ConsentType }

#created_at ⇒ Time?

Timestamp when this charge was created.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


35
# File 'lib/straddle/models/charge.rb', line 35

required :created_at, Time, nil?: true

#currency ⇒ String

Currency code. Only USD is supported.

Parameters:

  • value (String)

Returns:

  • (String)


41
# File 'lib/straddle/models/charge.rb', line 41

required :currency, String

#customer_details ⇒ Straddle::Models::CustomerDetails?

Information about the customer associated with the charge.



132
# File 'lib/straddle/models/charge.rb', line 132

optional :customer_details, -> { Straddle::CustomerDetails }

#description ⇒ String?

A human-readable description of the charge.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


47
# File 'lib/straddle/models/charge.rb', line 47

required :description, String, nil?: true

#device ⇒ Straddle::Models::MaskedPaymentDevice

Device used when the customer authorized the charge.



53
# File 'lib/straddle/models/charge.rb', line 53

required :device, -> { Straddle::MaskedPaymentDevice }

#documents ⇒ Array<Straddle::Models::PaymentAuthorizationProof>?

Authorization documents for this charge, ordered by upload time.

Parameters:

Returns:



138
139
140
# File 'lib/straddle/models/charge.rb', line 138

optional :documents,
-> { Straddle::Internal::Type::ArrayOf[Straddle::PaymentAuthorizationProof] },
nil?: true

#effective_at ⇒ Time?

Timestamp when funds were settled. Null until settlement is confirmed.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


146
# File 'lib/straddle/models/charge.rb', line 146

optional :effective_at, Time, nil?: true

#external_id ⇒ String

Your unique identifier for this charge, used to correlate with your internal records.

Parameters:

  • value (String)

Returns:

  • (String)


60
# File 'lib/straddle/models/charge.rb', line 60

required :external_id, String

#funding_ids ⇒ Array<String>

IDs of the funding events that included this charge.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


66
# File 'lib/straddle/models/charge.rb', line 66

required :funding_ids, Straddle::Internal::Type::ArrayOf[String]

#has_refund ⇒ Boolean

Whether an associated payout has refunded this charge.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


72
# File 'lib/straddle/models/charge.rb', line 72

required :has_refund, Straddle::Internal::Type::Boolean

#has_resubmit ⇒ Boolean

Whether this charge has been resubmitted.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


78
# File 'lib/straddle/models/charge.rb', line 78

required :has_resubmit, Straddle::Internal::Type::Boolean

#id ⇒ String

Unique identifier for this charge.

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/straddle/models/charge.rb', line 10

required :id, String

#is_resubmit ⇒ Boolean

Whether this charge resubmits an original charge.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


84
# File 'lib/straddle/models/charge.rb', line 84

required :is_resubmit, Straddle::Internal::Type::Boolean

#metadata ⇒ Hash{Symbol=>String}?

Key-value metadata stored with this charge.

Parameters:

  • value (::Hash[Symbol, String], nil)

Returns:

  • (Hash{Symbol=>String}, nil)


152
# File 'lib/straddle/models/charge.rb', line 152

optional :metadata, Straddle::Internal::Type::HashOf[String], nil?: true

#paykey ⇒ String

The masked paykey token used for this charge.

Parameters:

  • value (String)

Returns:

  • (String)


90
# File 'lib/straddle/models/charge.rb', line 90

required :paykey, String

#paykey_details ⇒ Straddle::Models::PaykeyDetails?

Information about the paykey used for the charge.



158
# File 'lib/straddle/models/charge.rb', line 158

optional :paykey_details, -> { Straddle::PaykeyDetails }

#payment_date ⇒ Date

Date when Straddle submits the charge for processing.

Parameters:

  • value (Date)

Returns:

  • (Date)


96
# File 'lib/straddle/models/charge.rb', line 96

required :payment_date, Date

#payment_rail ⇒ Symbol, ...

Payment rail used to process the charge.

Returns:



164
# File 'lib/straddle/models/charge.rb', line 164

optional :payment_rail, enum: -> { Straddle::PaymentRail }

#processed_at ⇒ Time?

Timestamp when this charge was submitted to the payment network. Null until processed.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


171
# File 'lib/straddle/models/charge.rb', line 171

optional :processed_at, Time, nil?: true

Related payments and their relationship to this charge.

Parameters:

Returns:



177
178
179
# File 'lib/straddle/models/charge.rb', line 177

optional :related_payments,
-> { Straddle::Internal::Type::ArrayOf[Straddle::RelatedPayment] },
nil?: true

#status ⇒ Symbol, Straddle::Models::PaymentStatus

The current status of the charge.

Parameters:

  • value (Straddle::Models::payment_status)

Returns:



102
# File 'lib/straddle/models/charge.rb', line 102

required :status, enum: -> { Straddle::PaymentStatus }

#status_details ⇒ Straddle::Models::PaymentStatusDetails

Reason, source, and message for the most recent charge status change.



108
# File 'lib/straddle/models/charge.rb', line 108

required :status_details, -> { Straddle::PaymentStatusDetails }

#status_history ⇒ Array<Straddle::Models::PaymentStatusHistory>

Complete ordered history of all status changes for this charge.

Parameters:

Returns:



114
# File 'lib/straddle/models/charge.rb', line 114

required :status_history, -> { Straddle::Internal::Type::ArrayOf[Straddle::PaymentStatusHistory] }

#trace_ids ⇒ Hash{Symbol=>String}

Trace identifiers from the payment network. Keys depend on the payment rail.

Parameters:

  • value (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String})


120
# File 'lib/straddle/models/charge.rb', line 120

required :trace_ids, Straddle::Internal::Type::HashOf[String]

#updated_at ⇒ Time?

Timestamp when this charge was last updated.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


126
# File 'lib/straddle/models/charge.rb', line 126

required :updated_at, Time, nil?: true

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


133
# File 'sig/straddle/models/charge.rbs', line 133

def to_hash: -> {