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:



208
209
210
# File 'lib/lithic/resources/external_payments.rb', line 208

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:



114
115
116
117
118
119
120
121
122
123
# File 'lib/lithic/resources/external_payments.rb', line 114

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

Create external payment

Parameters:

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/lithic/resources/external_payments.rb', line 24

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:



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/lithic/resources/external_payments.rb', line 87

def list(params = {})
  parsed, options = Lithic::ExternalPaymentListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/external_payments",
    query: parsed.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:



140
141
142
143
144
145
146
147
148
149
# File 'lib/lithic/resources/external_payments.rb', line 140

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:



46
47
48
49
50
51
52
53
# File 'lib/lithic/resources/external_payments.rb', line 46

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:



166
167
168
169
170
171
172
173
174
175
# File 'lib/lithic/resources/external_payments.rb', line 166

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:



194
195
196
197
198
199
200
201
202
203
# File 'lib/lithic/resources/external_payments.rb', line 194

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