Class: WhopSDK::Models::Payment

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

Defined Under Namespace

Classes: ApplicationFee, BillingAddress, Company, Dispute, FinancingTransaction, Member, Membership, PaymentMethod, Plan, Product, PromoCode, Refund, Resolution, ShippingAddress, User

Instance Attribute Summary collapse

Class Method 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(city:, country:, line1:, line2:, name:, postal_code:, state:) ⇒ Object

The shipping address provided by the customer for physical goods. Null if no shipping address was collected.

Parameters:

  • city (String, nil)

    The city of the address.

  • country (String, nil)

    The country of the address.

  • line1 (String, nil)

    The line 1 of the address.

  • line2 (String, nil)

    The line 2 of the address.

  • name (String, nil)

    The name of the customer.

  • postal_code (String, nil)

    The postal code of the address.

  • state (String, nil)

    The state of the address.



# File 'lib/whop_sdk/models/payment.rb', line 347

Instance Attribute Details

#amount_after_feesFloat

How much the payment is for after fees

Parameters:

  • value (Float)

Returns:

  • (Float)


16
# File 'lib/whop_sdk/models/payment.rb', line 16

required :amount_after_fees, Float

#application_feeWhopSDK::Models::Payment::ApplicationFee?

The application fee charged on this payment.

Parameters:

  • value (WhopSDK::Payment::ApplicationFee, nil)

Returns:



22
# File 'lib/whop_sdk/models/payment.rb', line 22

required :application_fee, -> { WhopSDK::Payment::ApplicationFee }, nil?: true

#auto_refundedBoolean

Whether this payment was auto refunded or not

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


28
# File 'lib/whop_sdk/models/payment.rb', line 28

required :auto_refunded, WhopSDK::Internal::Type::Boolean

#billing_addressWhopSDK::Models::Payment::BillingAddress?

The address of the user who made the payment.

Parameters:

  • value (WhopSDK::Payment::BillingAddress, nil)

Returns:



34
# File 'lib/whop_sdk/models/payment.rb', line 34

required :billing_address, -> { WhopSDK::Payment::BillingAddress }, nil?: true

#billing_reasonSymbol, ...

The reason why a specific payment was billed

Parameters:

  • value (WhopSDK::Models::billing_reasons, nil)

Returns:



40
# File 'lib/whop_sdk/models/payment.rb', line 40

required :billing_reason, enum: -> { WhopSDK::BillingReasons }, nil?: true

#card_brandSymbol, ...

Possible card brands that a payment token can have

Parameters:

  • value (WhopSDK::Models::card_brands, nil)

Returns:



46
# File 'lib/whop_sdk/models/payment.rb', line 46

required :card_brand, enum: -> { WhopSDK::CardBrands }, nil?: true

#card_last4String?

The last four digits of the card used to make this payment. Null if the payment was not made with a card.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


53
# File 'lib/whop_sdk/models/payment.rb', line 53

required :card_last4, String, nil?: true

#checkout_configuration_idString?

The ID of the checkout session/configuration that produced this payment, if any. Use this to map payments back to the checkout configuration that created them.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


60
# File 'lib/whop_sdk/models/payment.rb', line 60

required :checkout_configuration_id, String, nil?: true

#companyWhopSDK::Models::Payment::Company?

The company for the payment.

Parameters:

  • value (WhopSDK::Payment::Company, nil)

Returns:



66
# File 'lib/whop_sdk/models/payment.rb', line 66

required :company, -> { WhopSDK::Payment::Company }, nil?: true

#created_atTime

The datetime the payment was created.

Parameters:

  • value (Time)

Returns:

  • (Time)


72
# File 'lib/whop_sdk/models/payment.rb', line 72

required :created_at, Time

#currencySymbol, WhopSDK::Models::Currency

The three-letter ISO currency code for this payment (e.g., 'usd', 'eur').

Parameters:

  • value (WhopSDK::Models::currency)

Returns:



78
# File 'lib/whop_sdk/models/payment.rb', line 78

required :currency, enum: -> { WhopSDK::Currency }

#dispute_alerted_atTime?

When an alert came in that this transaction will be disputed

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


84
# File 'lib/whop_sdk/models/payment.rb', line 84

required :dispute_alerted_at, Time, nil?: true

#disputesArray<WhopSDK::Models::Payment::Dispute>?

The disputes attached to this payment. Null if the actor in context does not have the payment:dispute:read permission.

Parameters:

  • value (::Array[WhopSDK::Payment::Dispute], nil)

Returns:



91
# File 'lib/whop_sdk/models/payment.rb', line 91

required :disputes, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Dispute] }, nil?: true

#failure_messageString?

If the payment failed, the reason for the failure.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


97
# File 'lib/whop_sdk/models/payment.rb', line 97

required :failure_message, String, nil?: true

#financing_installments_countInteger?

The number of financing installments for the payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.).

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


104
# File 'lib/whop_sdk/models/payment.rb', line 104

required :financing_installments_count, Integer, nil?: true

#financing_transactionsArray<WhopSDK::Models::Payment::FinancingTransaction>

The financing transactions attached to this payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.).

Parameters:

  • value (::Array[WhopSDK::Payment::FinancingTransaction])

Returns:



111
112
# File 'lib/whop_sdk/models/payment.rb', line 111

required :financing_transactions,
-> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::FinancingTransaction] }

#idString

The unique identifier for the payment.

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/whop_sdk/models/payment.rb', line 10

required :id, String

#last_payment_attemptTime?

The time of the last payment attempt.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


118
# File 'lib/whop_sdk/models/payment.rb', line 118

required :last_payment_attempt, Time, nil?: true

#memberWhopSDK::Models::Payment::Member?

The member attached to this payment.

Parameters:

  • value (WhopSDK::Payment::Member, nil)

Returns:



124
# File 'lib/whop_sdk/models/payment.rb', line 124

required :member, -> { WhopSDK::Payment::Member }, nil?: true

#membershipWhopSDK::Models::Payment::Membership?

The membership attached to this payment.

Parameters:

  • value (WhopSDK::Payment::Membership, nil)

Returns:



130
# File 'lib/whop_sdk/models/payment.rb', line 130

required :membership, -> { WhopSDK::Payment::Membership }, nil?: true

#metadataHash{Symbol=>Object}?

The custom metadata stored on this payment. This will be copied over to the checkout configuration for which this payment was made

Parameters:

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

Returns:

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


137
# File 'lib/whop_sdk/models/payment.rb', line 137

required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true

#next_payment_attemptTime?

The time of the next schedule payment retry.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


143
# File 'lib/whop_sdk/models/payment.rb', line 143

required :next_payment_attempt, Time, nil?: true

The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


150
# File 'lib/whop_sdk/models/payment.rb', line 150

required :paid_at, Time, nil?: true

#payment_methodWhopSDK::Models::Payment::PaymentMethod?

The tokenized payment method reference used for this payment. Null if no token was used.

Parameters:

  • value (WhopSDK::Payment::PaymentMethod, nil)

Returns:



157
# File 'lib/whop_sdk/models/payment.rb', line 157

required :payment_method, -> { WhopSDK::Payment::PaymentMethod }, nil?: true

#payment_method_typeSymbol, ...

The different types of payment methods that can be used.

Parameters:

  • value (WhopSDK::Models::payment_method_types, nil)

Returns:



163
# File 'lib/whop_sdk/models/payment.rb', line 163

required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }, nil?: true

#payments_failedInteger?

The number of failed payment attempts for the payment.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


169
# File 'lib/whop_sdk/models/payment.rb', line 169

required :payments_failed, Integer, nil?: true

#planWhopSDK::Models::Payment::Plan?

The plan attached to this payment.

Parameters:

  • value (WhopSDK::Payment::Plan, nil)

Returns:



175
# File 'lib/whop_sdk/models/payment.rb', line 175

required :plan, -> { WhopSDK::Payment::Plan }, nil?: true

#productWhopSDK::Models::Payment::Product?

The product this payment was made for

Parameters:

  • value (WhopSDK::Payment::Product, nil)

Returns:



181
# File 'lib/whop_sdk/models/payment.rb', line 181

required :product, -> { WhopSDK::Payment::Product }, nil?: true

#promo_codeWhopSDK::Models::Payment::PromoCode?

The promo code used for this payment.

Parameters:

  • value (WhopSDK::Payment::PromoCode, nil)

Returns:



187
# File 'lib/whop_sdk/models/payment.rb', line 187

required :promo_code, -> { WhopSDK::Payment::PromoCode }, nil?: true

#refundableBoolean

True only for payments that are paid, have not been fully refunded, and were processed by a payment processor that allows refunds.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


194
# File 'lib/whop_sdk/models/payment.rb', line 194

required :refundable, WhopSDK::Internal::Type::Boolean

#refunded_amountFloat?

The payment refund amount(if applicable).

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


200
# File 'lib/whop_sdk/models/payment.rb', line 200

required :refunded_amount, Float, nil?: true

#refunded_atTime?

When the payment was refunded (if applicable).

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


206
# File 'lib/whop_sdk/models/payment.rb', line 206

required :refunded_at, Time, nil?: true

#refundsArray<WhopSDK::Models::Payment::Refund>

The refunds issued against this payment, newest first, including failed and canceled refund attempts. Limited to the 100 most recent.

Parameters:

  • value (::Array[WhopSDK::Payment::Refund])

Returns:



213
# File 'lib/whop_sdk/models/payment.rb', line 213

required :refunds, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Refund] }

#resolutionsArray<WhopSDK::Models::Payment::Resolution>?

The resolution center cases opened by the customer on this payment. Null if the actor in context does not have the payment:resolution_center_case:read permission.

Parameters:

  • value (::Array[WhopSDK::Payment::Resolution], nil)

Returns:



221
# File 'lib/whop_sdk/models/payment.rb', line 221

required :resolutions, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Payment::Resolution] }, nil?: true

#retryableBoolean

True when the payment status is open and its membership is in one of the retry-eligible states (active, trialing, completed, or past_due); otherwise false. Used to decide if Whop can attempt the charge again.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


229
# File 'lib/whop_sdk/models/payment.rb', line 229

required :retryable, WhopSDK::Internal::Type::Boolean

#risk_scoreInteger?

Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 (highest risk). Null when the payment has not been scored or scoring has not yet completed.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


237
# File 'lib/whop_sdk/models/payment.rb', line 237

required :risk_score, Integer, nil?: true

#risk_signalsHash{Symbol=>Object}?

A curated set of factors behind the risk score, grouped by category (business transaction history, buyer, device). Each entry has a key, human-readable label, category, and value. Null when there is no risk assessment for this payment.

Parameters:

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

Returns:

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


245
# File 'lib/whop_sdk/models/payment.rb', line 245

required :risk_signals, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true

#settlement_amountFloat

The total amount charged to the customer for this payment, including taxes and after any discounts. In the currency specified by the currency field.

Parameters:

  • value (Float)

Returns:

  • (Float)


252
# File 'lib/whop_sdk/models/payment.rb', line 252

required :settlement_amount, Float

#settlement_currencySymbol, WhopSDK::Models::Currency

The three-letter ISO currency code for this payment (e.g., 'usd', 'eur').

Parameters:

  • value (WhopSDK::Models::currency)

Returns:



258
# File 'lib/whop_sdk/models/payment.rb', line 258

required :settlement_currency, enum: -> { WhopSDK::Currency }

#settlement_exchange_rateFloat?

Deprecated. Always returns null.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


264
# File 'lib/whop_sdk/models/payment.rb', line 264

required :settlement_exchange_rate, Float, nil?: true

#shipping_addressWhopSDK::Models::Payment::ShippingAddress?

The shipping address provided by the customer for physical goods. Null if no shipping address was collected.

Parameters:

  • value (WhopSDK::Payment::ShippingAddress, nil)

Returns:



271
# File 'lib/whop_sdk/models/payment.rb', line 271

required :shipping_address, -> { WhopSDK::Payment::ShippingAddress }, nil?: true

#statusSymbol, ...

The status of a receipt

Parameters:

  • value (WhopSDK::Models::receipt_status, nil)

Returns:



277
# File 'lib/whop_sdk/models/payment.rb', line 277

required :status, enum: -> { WhopSDK::ReceiptStatus }, nil?: true

#substatusSymbol, WhopSDK::Models::FriendlyReceiptStatus

The friendly status of the payment.

Parameters:

  • value (WhopSDK::Models::friendly_receipt_status)

Returns:



283
# File 'lib/whop_sdk/models/payment.rb', line 283

required :substatus, enum: -> { WhopSDK::FriendlyReceiptStatus }

#subtotalFloat?

The subtotal to show to the creator (excluding buyer fees).

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


289
# File 'lib/whop_sdk/models/payment.rb', line 289

required :subtotal, Float, nil?: true

#tax_amountFloat?

The calculated amount of the sales/VAT tax (if applicable).

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


295
# File 'lib/whop_sdk/models/payment.rb', line 295

required :tax_amount, Float, nil?: true

#tax_behaviorSymbol, ...

The type of tax inclusivity applied to the receipt, for determining whether the tax is included in the final price, or paid on top.

Parameters:

  • value (WhopSDK::Models::receipt_tax_behavior, nil)

Returns:



302
# File 'lib/whop_sdk/models/payment.rb', line 302

required :tax_behavior, enum: -> { WhopSDK::ReceiptTaxBehavior }, nil?: true

#tax_refunded_amountFloat?

The amount of tax that has been refunded (if applicable).

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


308
# File 'lib/whop_sdk/models/payment.rb', line 308

required :tax_refunded_amount, Float, nil?: true

#three_ds_verifiedBoolean

Whether 3D Secure authentication was completed for this payment.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


314
# File 'lib/whop_sdk/models/payment.rb', line 314

required :three_ds_verified, WhopSDK::Internal::Type::Boolean

#totalFloat?

The total to show to the creator (excluding buyer fees).

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


320
# File 'lib/whop_sdk/models/payment.rb', line 320

required :total, Float, nil?: true

#updated_atTime

The datetime the payment was last updated.

Parameters:

  • value (Time)

Returns:

  • (Time)


326
# File 'lib/whop_sdk/models/payment.rb', line 326

required :updated_at, Time

#usd_totalFloat?

The total in USD to show to the creator (excluding buyer fees).

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


332
# File 'lib/whop_sdk/models/payment.rb', line 332

required :usd_total, Float, nil?: true

#userWhopSDK::Models::Payment::User?

The user that made this payment.

Parameters:

  • value (WhopSDK::Payment::User, nil)

Returns:



338
# File 'lib/whop_sdk/models/payment.rb', line 338

required :user, -> { WhopSDK::Payment::User }, nil?: true

#voidableBoolean

True when the payment is tied to a membership in past_due, the payment status is open, and the processor allows voiding payments; otherwise false.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


345
# File 'lib/whop_sdk/models/payment.rb', line 345

required :voidable, WhopSDK::Internal::Type::Boolean

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/whop_sdk/models/payment.rb', line 767

Instance Method Details

#to_hash{

Returns:

  • ({)


223
# File 'sig/whop_sdk/models/payment.rbs', line 223

def to_hash: -> {