Class: WhopSDK::Models::Payment

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

Defined Under Namespace

Classes: BillingAddress, Company, Member, Membership, Plan, Product, PromoCode, User

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_off: , base_currency: , code: , number_of_intervals: , promo_type: ) ⇒ Object

The promo code used for this payment.

Parameters:

  • id (String) (defaults to: )

    The ID of the promo.

  • amount_off (Float) (defaults to: )

    The amount off (% or flat amount) for the promo.

  • base_currency (Symbol, WhopSDK::Models::Currency) (defaults to: )

    The monetary currency of the promo code.

  • code (String, nil) (defaults to: )

    The specific code used to apply the promo at checkout.

  • number_of_intervals (Integer, nil) (defaults to: )

    The number of months the promo is applied for.

  • promo_type (Symbol, WhopSDK::Models::PromoType) (defaults to: )

    The type (% or flat amount) of the promo.



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

Instance Attribute Details

#amount_after_feesFloat

How much the payment is for after fees

Returns:

  • (Float)


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

required :amount_after_fees, Float

#auto_refundedBoolean

Whether this payment was auto refunded or not

Returns:

  • (Boolean)


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

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

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

The address of the user who made the payment.



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

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

#billing_reasonSymbol, ...

The reason why a specific payment was billed

Returns:



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

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

#card_brandSymbol, ...

Possible card brands that a payment token can have

Returns:



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

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

#card_last4String?

The last 4 digits of the card used to make the payment.

Returns:

  • (String, nil)


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

required :card_last4, String, nil?: true

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

The company for the payment.



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

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

#created_atTime

The datetime the payment was created

Returns:

  • (Time)


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

required :created_at, Time

#currencySymbol, ...

The available currencies on the platform

Returns:



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

required :currency, enum: -> { WhopSDK::Currency }, nil?: true

#dispute_alerted_atTime?

When an alert came in that this transaction will be disputed

Returns:

  • (Time, nil)


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

required :dispute_alerted_at, Time, nil?: true

#failure_messageString?

If the payment failed, the reason for the failure.

Returns:

  • (String, nil)


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

required :failure_message, String, nil?: true

#idString

The payment ID

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.

Returns:

  • (Time, nil)


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

required :last_payment_attempt, Time, nil?: true

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

The member attached to this payment.



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

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

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

The membership attached to this payment.



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

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

The datetime the payment was paid

Returns:

  • (Time, nil)


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

required :paid_at, Time, nil?: true

#payment_method_typeSymbol, ...

The different types of payment methods that can be used.

Returns:



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

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

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

The plan attached to this payment.



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

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

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

The access pass attached to this payment.



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

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

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

The promo code used for this payment.



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

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.

Returns:

  • (Boolean)


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

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

#refunded_amountFloat?

The payment refund amount(if applicable).

Returns:

  • (Float, nil)


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

required :refunded_amount, Float, nil?: true

#refunded_atTime?

When the payment was refunded (if applicable).

Returns:

  • (Time, nil)


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

required :refunded_at, Time, 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.

Returns:

  • (Boolean)


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

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

#statusSymbol, ...

The status of a receipt

Returns:



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

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

#substatusSymbol, WhopSDK::Models::FriendlyReceiptStatus

The friendly status of the payment.



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

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

#subtotalFloat?

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

Returns:

  • (Float, nil)


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

required :subtotal, Float, nil?: true

#totalFloat?

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

Returns:

  • (Float, nil)


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

required :total, Float, nil?: true

#usd_totalFloat?

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

Returns:

  • (Float, nil)


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

required :usd_total, Float, nil?: true

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

The user that made this payment.



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

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.

Returns:

  • (Boolean)


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

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