Class: Lithic::Resources::Payments
- Inherits:
-
Object
- Object
- Lithic::Resources::Payments
- Defined in:
- lib/lithic/resources/payments.rb,
sig/lithic/resources/payments.rbs
Instance Method Summary collapse
-
#create(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, hold: nil, memo: nil, user_defined_id: nil, request_options: {}) ⇒ Lithic::Models::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::PaymentCreateParams for more details.
-
#create_stablecoin(amount:, blockchain_recipient_token:, financial_account_token:, type:, token: nil, hold: nil, memo: nil, request_options: {}) ⇒ Lithic::Models::PaymentCreateStablecoinResponse
Some parameter documentations has been truncated, see Models::PaymentCreateStablecoinParams for more details.
-
#initialize(client:) ⇒ Payments
constructor
private
A new instance of Payments.
-
#list(account_token: nil, 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::Payment>
Some parameter documentations has been truncated, see Models::PaymentListParams for more details.
-
#retrieve(payment_token, request_options: {}) ⇒ Lithic::Models::Payment
Get the payment by token.
-
#retry_(payment_token, method_: nil, request_options: {}) ⇒ Lithic::Models::PaymentRetryResponse
Some parameter documentations has been truncated, see Models::PaymentRetryParams for more details.
-
#return_(payment_token, financial_account_token:, return_reason_code:, addenda: nil, date_of_death: nil, memo: nil, request_options: {}) ⇒ Lithic::Models::Payment
Some parameter documentations has been truncated, see Models::PaymentReturnParams for more details.
-
#simulate_action(payment_token, event_type:, date_of_death: nil, decline_reason: nil, return_addenda: nil, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateActionResponse
Simulate payment lifecycle event.
-
#simulate_receipt(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReceiptResponse
Some parameter documentations has been truncated, see Models::PaymentSimulateReceiptParams for more details.
-
#simulate_release(payment_token:, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReleaseResponse
Simulates a release of a Payment.
-
#simulate_return(payment_token:, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReturnResponse
Simulates a return of a Payment.
Constructor Details
#initialize(client:) ⇒ Payments
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 Payments.
364 365 366 |
# File 'lib/lithic/resources/payments.rb', line 364 def initialize(client:) @client = client end |
Instance Method Details
#create(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, hold: nil, memo: nil, user_defined_id: nil, request_options: {}) ⇒ Lithic::Models::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::PaymentCreateParams for more details.
Initiates an ACH payment between a financial account and an external bank account.
This endpoint originates on the ACH rail only. To send a stablecoin payout, use the Create stablecoin payment endpoint. Payments on every rail are read back through List payments.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/lithic/resources/payments.rb', line 45 def create(params) parsed, = Lithic::PaymentCreateParams.dump_request(params) @client.request( method: :post, path: "v1/payments", body: parsed, model: Lithic::Models::PaymentCreateResponse, options: ) end |
#create_stablecoin(amount:, blockchain_recipient_token:, financial_account_token:, type:, token: nil, hold: nil, memo: nil, request_options: {}) ⇒ Lithic::Models::PaymentCreateStablecoinResponse
Some parameter documentations has been truncated, see Models::PaymentCreateStablecoinParams for more details.
Initiates a stablecoin payout from a financial account to a registered blockchain recipient.
The recipient must have been registered with
Create blockchain recipient
and have completed address screening — only a recipient in the ENABLED
verification state can receive a payout. The destination address and chain come
from the recipient, so they are not supplied here.
Only payouts are initiated through this endpoint. Stablecoin pay-ins are credited from on-chain deposits to a financial account's deposit address and are not created through the API. Funds are placed on hold when the payout is initiated, and a payout that fails on chain reverses that hold. A payout cannot be cancelled once it has been submitted on chain.
This endpoint is only available to stablecoin-enabled programs. Contact your customer success manager to learn more.
164 165 166 167 168 169 170 171 172 173 |
# File 'lib/lithic/resources/payments.rb', line 164 def create_stablecoin(params) parsed, = Lithic::PaymentCreateStablecoinParams.dump_request(params) @client.request( method: :post, path: "v1/payments/stablecoin", body: parsed, model: Lithic::Models::PaymentCreateStablecoinResponse, options: ) end |
#list(account_token: nil, 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::Payment>
Some parameter documentations has been truncated, see Models::PaymentListParams for more details.
List all the payments for the provided search criteria.
109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/lithic/resources/payments.rb', line 109 def list(params = {}) parsed, = Lithic::PaymentListParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/payments", query: query.transform_keys(begin_: "begin", end_: "end"), page: Lithic::Internal::CursorPage, model: Lithic::Payment, options: ) end |
#retrieve(payment_token, request_options: {}) ⇒ Lithic::Models::Payment
Get the payment by token.
66 67 68 69 70 71 72 73 |
# File 'lib/lithic/resources/payments.rb', line 66 def retrieve(payment_token, params = {}) @client.request( method: :get, path: ["v1/payments/%1$s", payment_token], model: Lithic::Payment, options: params[:request_options] ) end |
#retry_(payment_token, method_: nil, request_options: {}) ⇒ Lithic::Models::PaymentRetryResponse
Some parameter documentations has been truncated, see Models::PaymentRetryParams for more details.
Retry an origination which has been returned.
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/lithic/resources/payments.rb', line 191 def retry_(payment_token, params = {}) parsed, = Lithic::PaymentRetryParams.dump_request(params) @client.request( method: :post, path: ["v1/payments/%1$s/retry", payment_token], body: parsed, model: Lithic::Models::PaymentRetryResponse, options: ) end |
#return_(payment_token, financial_account_token:, return_reason_code:, addenda: nil, date_of_death: nil, memo: nil, request_options: {}) ⇒ Lithic::Models::Payment
Some parameter documentations has been truncated, see Models::PaymentReturnParams for more details.
Return an ACH payment with a specified return reason code. Returns must be initiated within the time window specified by NACHA rules for each return code (typically 2 banking days for most codes, 60 calendar days for unauthorized debits). For a complete list of return codes and their meanings, see the ACH Return Reasons documentation.
Note:
- This endpoint does not modify the state of the financial account associated with the payment. If you would like to change the account state, use the Update financial account status endpoint.
- By default this endpoint is not enabled for your account. Please contact your implementations manager to enable this feature.
239 240 241 242 243 244 245 246 247 248 |
# File 'lib/lithic/resources/payments.rb', line 239 def return_(payment_token, params) parsed, = Lithic::PaymentReturnParams.dump_request(params) @client.request( method: :post, path: ["v1/payments/%1$s/return", payment_token], body: parsed, model: Lithic::Payment, options: ) end |
#simulate_action(payment_token, event_type:, date_of_death: nil, decline_reason: nil, return_addenda: nil, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateActionResponse
Simulate payment lifecycle event
271 272 273 274 275 276 277 278 279 280 |
# File 'lib/lithic/resources/payments.rb', line 271 def simulate_action(payment_token, params) parsed, = Lithic::PaymentSimulateActionParams.dump_request(params) @client.request( method: :post, path: ["v1/simulate/payments/%1$s/action", payment_token], body: parsed, model: Lithic::Models::PaymentSimulateActionResponse, options: ) end |
#simulate_receipt(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReceiptResponse
Some parameter documentations has been truncated, see Models::PaymentSimulateReceiptParams for more details.
Simulates a receipt of a Payment.
304 305 306 307 308 309 310 311 312 313 |
# File 'lib/lithic/resources/payments.rb', line 304 def simulate_receipt(params) parsed, = Lithic::PaymentSimulateReceiptParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/payments/receipt", body: parsed, model: Lithic::Models::PaymentSimulateReceiptResponse, options: ) end |
#simulate_release(payment_token:, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReleaseResponse
Simulates a release of a Payment.
326 327 328 329 330 331 332 333 334 335 |
# File 'lib/lithic/resources/payments.rb', line 326 def simulate_release(params) parsed, = Lithic::PaymentSimulateReleaseParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/payments/release", body: parsed, model: Lithic::Models::PaymentSimulateReleaseResponse, options: ) end |
#simulate_return(payment_token:, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReturnResponse
Simulates a return of a Payment.
350 351 352 353 354 355 356 357 358 359 |
# File 'lib/lithic/resources/payments.rb', line 350 def simulate_return(params) parsed, = Lithic::PaymentSimulateReturnParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/payments/return", body: parsed, model: Lithic::Models::PaymentSimulateReturnResponse, options: ) end |