Class: Telnyx::Resources::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/payment.rb,
lib/telnyx/resources/payment/auto_recharge_prefs.rb

Overview

Operations for managing stored payment transactions.

Defined Under Namespace

Classes: AutoRechargePrefs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Payment

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Payment.

Parameters:



36
37
38
39
# File 'lib/telnyx/resources/payment.rb', line 36

def initialize(client:)
  @client = client
  @auto_recharge_prefs = Telnyx::Resources::Payment::AutoRechargePrefs.new(client: client)
end

Instance Attribute Details

#auto_recharge_prefsTelnyx::Resources::Payment::AutoRechargePrefs (readonly)

V2 Auto Recharge Preferences API



9
10
11
# File 'lib/telnyx/resources/payment.rb', line 9

def auto_recharge_prefs
  @auto_recharge_prefs
end

Instance Method Details

#create_stored_payment_transaction(amount:, request_options: {}) ⇒ Telnyx::Models::PaymentCreateStoredPaymentTransactionResponse

Create a stored payment transaction

Parameters:

  • amount (String)

    Amount in dollars and cents, e.g. “120.00”

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/telnyx/resources/payment.rb', line 22

def create_stored_payment_transaction(params)
  parsed, options = Telnyx::PaymentCreateStoredPaymentTransactionParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/payment/stored_payment_transactions",
    body: parsed,
    model: Telnyx::Models::PaymentCreateStoredPaymentTransactionResponse,
    options: options
  )
end