Class: Lithic::Resources::ExternalPayments

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/external_payments.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ExternalPayments

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 ExternalPayments.

Parameters:



221
222
223
# File 'lib/lithic/resources/external_payments.rb', line 221

def initialize(client:)
  @client = client
end

Instance Method Details

#cancel(external_payment_token, effective_date:, memo: nil, request_options: {}) ⇒ Lithic::Models::ExternalPayment

Cancel external payment

Parameters:

  • external_payment_token (String)

    Globally unique identifier for the external payment

  • effective_date (Date)
  • memo (String)
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



127
128
129
130
131
132
133
134
135
136
# File 'lib/lithic/resources/external_payments.rb', line 127

def cancel(external_payment_token, params)
  parsed, options = Lithic::ExternalPaymentCancelParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/external_payments/%1$s/cancel", external_payment_token],
    body: parsed,
    model: Lithic::ExternalPayment,
    options: options
  )
end

#create(amount:, category:, effective_date:, financial_account_token:, payment_type:, token: nil, memo: nil, progress_to: nil, user_defined_id: nil, request_options: {}) ⇒ Lithic::Models::ExternalPayment

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

Create external payment

Parameters:

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
# File 'lib/lithic/resources/external_payments.rb', line 36

def create(params)
  parsed, options = Lithic::ExternalPaymentCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/external_payments",
    body: parsed,
    model: Lithic::ExternalPayment,
    options: options
  )
end

#list(begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::ExternalPayment>

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

List external payments

Parameters:

  • begin_ (Time)

    Date string in RFC 3339 format. Only entries created after the specified time wi

  • business_account_token (String)
  • category (Symbol, Lithic::Models::ExternalPaymentListParams::Category)

    External Payment category to be returned.

  • end_ (Time)

    Date string in RFC 3339 format. Only entries created before the specified time w

  • ending_before (String)

    A cursor representing an item’s token before which a page of results should end.

  • financial_account_token (String)

    Globally unique identifier for the financial account or card that will send the

  • page_size (Integer)

    Page size (for pagination).

  • result (Symbol, Lithic::Models::ExternalPaymentListParams::Result)

    External Payment result to be returned.

  • starting_after (String)

    A cursor representing an item’s token after which a page of results should begin

  • status (Symbol, Lithic::Models::ExternalPaymentListParams::Status)

    Book transfer status to be returned.

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

Returns:

See Also:



99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/lithic/resources/external_payments.rb', line 99

def list(params = {})
  parsed, options = Lithic::ExternalPaymentListParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/external_payments",
    query: query.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::ExternalPayment,
    options: options
  )
end

#release(external_payment_token, effective_date:, memo: nil, request_options: {}) ⇒ Lithic::Models::ExternalPayment

Release external payment

Parameters:

  • external_payment_token (String)

    Globally unique identifier for the external payment

  • effective_date (Date)
  • memo (String)
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



153
154
155
156
157
158
159
160
161
162
# File 'lib/lithic/resources/external_payments.rb', line 153

def release(external_payment_token, params)
  parsed, options = Lithic::ExternalPaymentReleaseParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/external_payments/%1$s/release", external_payment_token],
    body: parsed,
    model: Lithic::ExternalPayment,
    options: options
  )
end

#retrieve(external_payment_token, request_options: {}) ⇒ Lithic::Models::ExternalPayment

Get external payment

Parameters:

  • external_payment_token (String)

    Globally unique identifier for the external payment

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

Returns:

See Also:



58
59
60
61
62
63
64
65
# File 'lib/lithic/resources/external_payments.rb', line 58

def retrieve(external_payment_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/external_payments/%1$s", external_payment_token],
    model: Lithic::ExternalPayment,
    options: params[:request_options]
  )
end

#reverse(external_payment_token, effective_date:, memo: nil, request_options: {}) ⇒ Lithic::Models::ExternalPayment

Reverse external payment

Parameters:

  • external_payment_token (String)

    Globally unique identifier for the external payment

  • effective_date (Date)
  • memo (String)
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



179
180
181
182
183
184
185
186
187
188
# File 'lib/lithic/resources/external_payments.rb', line 179

def reverse(external_payment_token, params)
  parsed, options = Lithic::ExternalPaymentReverseParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/external_payments/%1$s/reverse", external_payment_token],
    body: parsed,
    model: Lithic::ExternalPayment,
    options: options
  )
end

#settle(external_payment_token, effective_date:, memo: nil, progress_to: nil, request_options: {}) ⇒ Lithic::Models::ExternalPayment

Settle external payment

Parameters:

Returns:

See Also:



207
208
209
210
211
212
213
214
215
216
# File 'lib/lithic/resources/external_payments.rb', line 207

def settle(external_payment_token, params)
  parsed, options = Lithic::ExternalPaymentSettleParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/external_payments/%1$s/settle", external_payment_token],
    body: parsed,
    model: Lithic::ExternalPayment,
    options: options
  )
end