From c40835b8afae6973e80baccab4017a99d15b4ac4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:32:28 +0000 Subject: [PATCH 1/2] feat(api): add webhook schemas to SDKs - add parse and parse_unsafe chore: replace custom webhook signature verification with standardwebhooks --- .stats.yml | 2 +- Gemfile | 1 + Gemfile.lock | 8 + README.md | 35 + lib/lithic.rb | 91 +- lib/lithic/client.rb | 4 + lib/lithic/errors.rb | 15 + lib/lithic/models.rb | 120 + .../account_holder_created_webhook_event.rb | 75 + ...t_holder_document_updated_webhook_event.rb | 191 ++ .../account_holder_updated_webhook_event.rb | 702 ++++++ ...count_holder_verification_webhook_event.rb | 69 + .../models/asa_request_webhook_event.rb | 1010 ++++++++ ...s_backtest_report_created_webhook_event.rb | 16 + .../models/balance_updated_webhook_event.rb | 23 + ...nsfer_transaction_created_webhook_event.rb | 18 + ...nsfer_transaction_updated_webhook_event.rb | 18 + .../models/card_converted_webhook_event.rb | 24 + .../models/card_created_webhook_event.rb | 32 + .../models/card_reissued_webhook_event.rb | 24 + .../models/card_renewed_webhook_event.rb | 56 + .../models/card_shipped_webhook_event.rb | 70 + ...ion_enhanced_data_created_webhook_event.rb | 16 + ...ion_enhanced_data_updated_webhook_event.rb | 16 + .../card_transaction_updated_webhook_event.rb | 16 + ...nization_approval_request_webhook_event.rb | 253 ++ ...allet_tokenization_result_webhook_event.rb | 145 ++ ..._authentication_code_sent_webhook_event.rb | 100 + ...actor_authentication_code_webhook_event.rb | 108 + ...llet_tokenization_updated_webhook_event.rb | 47 + ...te_evidence_upload_failed_webhook_event.rb | 18 + ...spute_transaction_created_webhook_event.rb | 18 + ...spute_transaction_updated_webhook_event.rb | 18 + .../models/dispute_updated_webhook_event.rb | 18 + ...rnal_bank_account_created_webhook_event.rb | 16 + ...rnal_bank_account_updated_webhook_event.rb | 16 + .../external_payment_created_webhook_event.rb | 16 + .../external_payment_updated_webhook_event.rb | 16 + ...financial_account_created_webhook_event.rb | 16 + ...financial_account_updated_webhook_event.rb | 16 + .../funding_event_created_webhook_event.rb | 16 + ...ernal_transaction_created_webhook_event.rb | 16 + ...ernal_transaction_updated_webhook_event.rb | 16 + .../models/loan_tape_created_webhook_event.rb | 16 + .../models/loan_tape_updated_webhook_event.rb | 16 + ...agement_operation_created_webhook_event.rb | 16 + ...agement_operation_updated_webhook_event.rb | 16 + .../network_total_created_webhook_event.rb | 16 + .../network_total_updated_webhook_event.rb | 16 + lib/lithic/models/parsed_webhook_event.rb | 818 ++++++ ...yment_transaction_created_webhook_event.rb | 18 + ...yment_transaction_updated_webhook_event.rb | 18 + ...settlement_report_updated_webhook_event.rb | 16 + .../statements_created_webhook_event.rb | 16 + ..._authentication_challenge_webhook_event.rb | 89 + ...ds_authentication_created_webhook_event.rb | 18 + ...ds_authentication_updated_webhook_event.rb | 18 + ...nization_approval_request_webhook_event.rb | 249 ++ ...ation_decisioning_request_webhook_event.rb | 159 ++ .../tokenization_result_webhook_event.rb | 141 ++ ..._authentication_code_sent_webhook_event.rb | 100 + ...actor_authentication_code_webhook_event.rb | 108 + .../tokenization_updated_webhook_event.rb | 47 + lib/lithic/models/webhook_parsed_params.rb | 14 + lib/lithic/resources/webhooks.rb | 87 + rbi/lithic/client.rbi | 3 + rbi/lithic/models.rbi | 155 ++ .../account_holder_created_webhook_event.rbi | 149 ++ ..._holder_document_updated_webhook_event.rbi | 479 ++++ .../account_holder_updated_webhook_event.rbi | 1274 ++++++++++ ...ount_holder_verification_webhook_event.rbi | 143 ++ .../models/asa_request_webhook_event.rbi | 2229 +++++++++++++++++ ..._backtest_report_created_webhook_event.rbi | 30 + .../models/balance_updated_webhook_event.rbi | 43 + ...sfer_transaction_created_webhook_event.rbi | 31 + ...sfer_transaction_updated_webhook_event.rbi | 31 + .../models/card_converted_webhook_event.rbi | 35 + .../models/card_created_webhook_event.rbi | 53 + .../models/card_reissued_webhook_event.rbi | 38 + .../models/card_renewed_webhook_event.rbi | 92 + .../models/card_shipped_webhook_event.rbi | 150 ++ ...on_enhanced_data_created_webhook_event.rbi | 30 + ...on_enhanced_data_updated_webhook_event.rbi | 30 + ...card_transaction_updated_webhook_event.rbi | 30 + .../models/digital_wallet_token_metadata.rbi | 4 +- ...ization_approval_request_webhook_event.rbi | 548 ++++ ...llet_tokenization_result_webhook_event.rbi | 295 +++ ...authentication_code_sent_webhook_event.rbi | 186 ++ ...ctor_authentication_code_webhook_event.rbi | 194 ++ ...let_tokenization_updated_webhook_event.rbi | 73 + ...e_evidence_upload_failed_webhook_event.rbi | 31 + ...pute_transaction_created_webhook_event.rbi | 31 + ...pute_transaction_updated_webhook_event.rbi | 31 + .../models/dispute_updated_webhook_event.rbi | 28 + ...nal_bank_account_created_webhook_event.rbi | 30 + ...nal_bank_account_updated_webhook_event.rbi | 30 + ...external_payment_created_webhook_event.rbi | 30 + ...external_payment_updated_webhook_event.rbi | 30 + ...inancial_account_created_webhook_event.rbi | 30 + ...inancial_account_updated_webhook_event.rbi | 30 + .../funding_event_created_webhook_event.rbi | 30 + rbi/lithic/models/internal_transaction.rbi | 25 +- ...rnal_transaction_created_webhook_event.rbi | 30 + ...rnal_transaction_updated_webhook_event.rbi | 30 + .../loan_tape_created_webhook_event.rbi | 27 + .../loan_tape_updated_webhook_event.rbi | 27 + ...gement_operation_created_webhook_event.rbi | 30 + ...gement_operation_updated_webhook_event.rbi | 30 + .../network_total_created_webhook_event.rbi | 30 + .../network_total_updated_webhook_event.rbi | 30 + rbi/lithic/models/parsed_webhook_event.rbi | 1310 ++++++++++ ...ment_transaction_created_webhook_event.rbi | 31 + ...ment_transaction_updated_webhook_event.rbi | 31 + ...ettlement_report_updated_webhook_event.rbi | 30 + .../statements_created_webhook_event.rbi | 30 + ...authentication_challenge_webhook_event.rbi | 175 ++ ...s_authentication_created_webhook_event.rbi | 31 + ...s_authentication_updated_webhook_event.rbi | 31 + ...ization_approval_request_webhook_event.rbi | 548 ++++ ...tion_decisioning_request_webhook_event.rbi | 333 +++ .../tokenization_result_webhook_event.rbi | 295 +++ ...authentication_code_sent_webhook_event.rbi | 186 ++ ...ctor_authentication_code_webhook_event.rbi | 194 ++ .../tokenization_updated_webhook_event.rbi | 73 + rbi/lithic/models/webhook_parsed_params.rbi | 27 + rbi/lithic/resources/webhooks.rbi | 158 ++ sig/lithic/client.rbs | 2 + sig/lithic/models.rbs | 112 + .../account_holder_created_webhook_event.rbs | 77 + ..._holder_document_updated_webhook_event.rbs | 219 ++ .../account_holder_updated_webhook_event.rbs | 587 +++++ ...ount_holder_verification_webhook_event.rbs | 69 + .../models/asa_request_webhook_event.rbs | 881 +++++++ ..._backtest_report_created_webhook_event.rbs | 20 + .../models/balance_updated_webhook_event.rbs | 25 + ...sfer_transaction_created_webhook_event.rbs | 20 + ...sfer_transaction_updated_webhook_event.rbs | 20 + .../models/card_converted_webhook_event.rbs | 19 + .../models/card_created_webhook_event.rbs | 30 + .../models/card_reissued_webhook_event.rbs | 21 + .../models/card_renewed_webhook_event.rbs | 55 + .../models/card_shipped_webhook_event.rbs | 71 + ...on_enhanced_data_created_webhook_event.rbs | 20 + ...on_enhanced_data_updated_webhook_event.rbs | 20 + ...card_transaction_updated_webhook_event.rbs | 18 + ...ization_approval_request_webhook_event.rbs | 223 ++ ...llet_tokenization_result_webhook_event.rbs | 133 + ...authentication_code_sent_webhook_event.rbs | 78 + ...ctor_authentication_code_webhook_event.rbs | 83 + ...let_tokenization_updated_webhook_event.rbs | 40 + ...e_evidence_upload_failed_webhook_event.rbs | 18 + ...pute_transaction_created_webhook_event.rbs | 18 + ...pute_transaction_updated_webhook_event.rbs | 18 + .../models/dispute_updated_webhook_event.rbs | 15 + ...nal_bank_account_created_webhook_event.rbs | 18 + ...nal_bank_account_updated_webhook_event.rbs | 18 + ...external_payment_created_webhook_event.rbs | 18 + ...external_payment_updated_webhook_event.rbs | 18 + ...inancial_account_created_webhook_event.rbs | 18 + ...inancial_account_updated_webhook_event.rbs | 18 + .../funding_event_created_webhook_event.rbs | 16 + ...rnal_transaction_created_webhook_event.rbs | 18 + ...rnal_transaction_updated_webhook_event.rbs | 18 + .../loan_tape_created_webhook_event.rbs | 15 + .../loan_tape_updated_webhook_event.rbs | 15 + ...gement_operation_created_webhook_event.rbs | 18 + ...gement_operation_updated_webhook_event.rbs | 18 + .../network_total_created_webhook_event.rbs | 16 + .../network_total_updated_webhook_event.rbs | 16 + sig/lithic/models/parsed_webhook_event.rbs | 641 +++++ ...ment_transaction_created_webhook_event.rbs | 18 + ...ment_transaction_updated_webhook_event.rbs | 18 + ...ettlement_report_updated_webhook_event.rbs | 18 + .../statements_created_webhook_event.rbs | 16 + ...authentication_challenge_webhook_event.rbs | 72 + ...s_authentication_created_webhook_event.rbs | 18 + ...s_authentication_updated_webhook_event.rbs | 18 + ...ization_approval_request_webhook_event.rbs | 223 ++ ...tion_decisioning_request_webhook_event.rbs | 134 + .../tokenization_result_webhook_event.rbs | 133 + ...authentication_code_sent_webhook_event.rbs | 78 + ...ctor_authentication_code_webhook_event.rbs | 83 + .../tokenization_updated_webhook_event.rbs | 40 + sig/lithic/models/webhook_parsed_params.rbs | 15 + sig/lithic/resources/webhooks.rbs | 135 + test/lithic/resources/webhooks_test.rb | 197 ++ 186 files changed, 20928 insertions(+), 30 deletions(-) create mode 100644 lib/lithic/models/account_holder_created_webhook_event.rb create mode 100644 lib/lithic/models/account_holder_document_updated_webhook_event.rb create mode 100644 lib/lithic/models/account_holder_updated_webhook_event.rb create mode 100644 lib/lithic/models/account_holder_verification_webhook_event.rb create mode 100644 lib/lithic/models/asa_request_webhook_event.rb create mode 100644 lib/lithic/models/auth_rules_backtest_report_created_webhook_event.rb create mode 100644 lib/lithic/models/balance_updated_webhook_event.rb create mode 100644 lib/lithic/models/book_transfer_transaction_created_webhook_event.rb create mode 100644 lib/lithic/models/book_transfer_transaction_updated_webhook_event.rb create mode 100644 lib/lithic/models/card_converted_webhook_event.rb create mode 100644 lib/lithic/models/card_created_webhook_event.rb create mode 100644 lib/lithic/models/card_reissued_webhook_event.rb create mode 100644 lib/lithic/models/card_renewed_webhook_event.rb create mode 100644 lib/lithic/models/card_shipped_webhook_event.rb create mode 100644 lib/lithic/models/card_transaction_enhanced_data_created_webhook_event.rb create mode 100644 lib/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rb create mode 100644 lib/lithic/models/card_transaction_updated_webhook_event.rb create mode 100644 lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb create mode 100644 lib/lithic/models/digital_wallet_tokenization_result_webhook_event.rb create mode 100644 lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rb create mode 100644 lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rb create mode 100644 lib/lithic/models/digital_wallet_tokenization_updated_webhook_event.rb create mode 100644 lib/lithic/models/dispute_evidence_upload_failed_webhook_event.rb create mode 100644 lib/lithic/models/dispute_transaction_created_webhook_event.rb create mode 100644 lib/lithic/models/dispute_transaction_updated_webhook_event.rb create mode 100644 lib/lithic/models/dispute_updated_webhook_event.rb create mode 100644 lib/lithic/models/external_bank_account_created_webhook_event.rb create mode 100644 lib/lithic/models/external_bank_account_updated_webhook_event.rb create mode 100644 lib/lithic/models/external_payment_created_webhook_event.rb create mode 100644 lib/lithic/models/external_payment_updated_webhook_event.rb create mode 100644 lib/lithic/models/financial_account_created_webhook_event.rb create mode 100644 lib/lithic/models/financial_account_updated_webhook_event.rb create mode 100644 lib/lithic/models/funding_event_created_webhook_event.rb create mode 100644 lib/lithic/models/internal_transaction_created_webhook_event.rb create mode 100644 lib/lithic/models/internal_transaction_updated_webhook_event.rb create mode 100644 lib/lithic/models/loan_tape_created_webhook_event.rb create mode 100644 lib/lithic/models/loan_tape_updated_webhook_event.rb create mode 100644 lib/lithic/models/management_operation_created_webhook_event.rb create mode 100644 lib/lithic/models/management_operation_updated_webhook_event.rb create mode 100644 lib/lithic/models/network_total_created_webhook_event.rb create mode 100644 lib/lithic/models/network_total_updated_webhook_event.rb create mode 100644 lib/lithic/models/parsed_webhook_event.rb create mode 100644 lib/lithic/models/payment_transaction_created_webhook_event.rb create mode 100644 lib/lithic/models/payment_transaction_updated_webhook_event.rb create mode 100644 lib/lithic/models/settlement_report_updated_webhook_event.rb create mode 100644 lib/lithic/models/statements_created_webhook_event.rb create mode 100644 lib/lithic/models/three_ds_authentication_challenge_webhook_event.rb create mode 100644 lib/lithic/models/three_ds_authentication_created_webhook_event.rb create mode 100644 lib/lithic/models/three_ds_authentication_updated_webhook_event.rb create mode 100644 lib/lithic/models/tokenization_approval_request_webhook_event.rb create mode 100644 lib/lithic/models/tokenization_decisioning_request_webhook_event.rb create mode 100644 lib/lithic/models/tokenization_result_webhook_event.rb create mode 100644 lib/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rb create mode 100644 lib/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rb create mode 100644 lib/lithic/models/tokenization_updated_webhook_event.rb create mode 100644 lib/lithic/models/webhook_parsed_params.rb create mode 100644 lib/lithic/resources/webhooks.rb create mode 100644 rbi/lithic/models/account_holder_created_webhook_event.rbi create mode 100644 rbi/lithic/models/account_holder_document_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/account_holder_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/account_holder_verification_webhook_event.rbi create mode 100644 rbi/lithic/models/asa_request_webhook_event.rbi create mode 100644 rbi/lithic/models/auth_rules_backtest_report_created_webhook_event.rbi create mode 100644 rbi/lithic/models/balance_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/book_transfer_transaction_created_webhook_event.rbi create mode 100644 rbi/lithic/models/book_transfer_transaction_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/card_converted_webhook_event.rbi create mode 100644 rbi/lithic/models/card_created_webhook_event.rbi create mode 100644 rbi/lithic/models/card_reissued_webhook_event.rbi create mode 100644 rbi/lithic/models/card_renewed_webhook_event.rbi create mode 100644 rbi/lithic/models/card_shipped_webhook_event.rbi create mode 100644 rbi/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbi create mode 100644 rbi/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/card_transaction_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi create mode 100644 rbi/lithic/models/digital_wallet_tokenization_result_webhook_event.rbi create mode 100644 rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbi create mode 100644 rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbi create mode 100644 rbi/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/dispute_evidence_upload_failed_webhook_event.rbi create mode 100644 rbi/lithic/models/dispute_transaction_created_webhook_event.rbi create mode 100644 rbi/lithic/models/dispute_transaction_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/dispute_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/external_bank_account_created_webhook_event.rbi create mode 100644 rbi/lithic/models/external_bank_account_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/external_payment_created_webhook_event.rbi create mode 100644 rbi/lithic/models/external_payment_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/financial_account_created_webhook_event.rbi create mode 100644 rbi/lithic/models/financial_account_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/funding_event_created_webhook_event.rbi create mode 100644 rbi/lithic/models/internal_transaction_created_webhook_event.rbi create mode 100644 rbi/lithic/models/internal_transaction_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/loan_tape_created_webhook_event.rbi create mode 100644 rbi/lithic/models/loan_tape_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/management_operation_created_webhook_event.rbi create mode 100644 rbi/lithic/models/management_operation_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/network_total_created_webhook_event.rbi create mode 100644 rbi/lithic/models/network_total_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/parsed_webhook_event.rbi create mode 100644 rbi/lithic/models/payment_transaction_created_webhook_event.rbi create mode 100644 rbi/lithic/models/payment_transaction_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/settlement_report_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/statements_created_webhook_event.rbi create mode 100644 rbi/lithic/models/three_ds_authentication_challenge_webhook_event.rbi create mode 100644 rbi/lithic/models/three_ds_authentication_created_webhook_event.rbi create mode 100644 rbi/lithic/models/three_ds_authentication_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/tokenization_approval_request_webhook_event.rbi create mode 100644 rbi/lithic/models/tokenization_decisioning_request_webhook_event.rbi create mode 100644 rbi/lithic/models/tokenization_result_webhook_event.rbi create mode 100644 rbi/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbi create mode 100644 rbi/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbi create mode 100644 rbi/lithic/models/tokenization_updated_webhook_event.rbi create mode 100644 rbi/lithic/models/webhook_parsed_params.rbi create mode 100644 rbi/lithic/resources/webhooks.rbi create mode 100644 sig/lithic/models/account_holder_created_webhook_event.rbs create mode 100644 sig/lithic/models/account_holder_document_updated_webhook_event.rbs create mode 100644 sig/lithic/models/account_holder_updated_webhook_event.rbs create mode 100644 sig/lithic/models/account_holder_verification_webhook_event.rbs create mode 100644 sig/lithic/models/asa_request_webhook_event.rbs create mode 100644 sig/lithic/models/auth_rules_backtest_report_created_webhook_event.rbs create mode 100644 sig/lithic/models/balance_updated_webhook_event.rbs create mode 100644 sig/lithic/models/book_transfer_transaction_created_webhook_event.rbs create mode 100644 sig/lithic/models/book_transfer_transaction_updated_webhook_event.rbs create mode 100644 sig/lithic/models/card_converted_webhook_event.rbs create mode 100644 sig/lithic/models/card_created_webhook_event.rbs create mode 100644 sig/lithic/models/card_reissued_webhook_event.rbs create mode 100644 sig/lithic/models/card_renewed_webhook_event.rbs create mode 100644 sig/lithic/models/card_shipped_webhook_event.rbs create mode 100644 sig/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbs create mode 100644 sig/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbs create mode 100644 sig/lithic/models/card_transaction_updated_webhook_event.rbs create mode 100644 sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs create mode 100644 sig/lithic/models/digital_wallet_tokenization_result_webhook_event.rbs create mode 100644 sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbs create mode 100644 sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbs create mode 100644 sig/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbs create mode 100644 sig/lithic/models/dispute_evidence_upload_failed_webhook_event.rbs create mode 100644 sig/lithic/models/dispute_transaction_created_webhook_event.rbs create mode 100644 sig/lithic/models/dispute_transaction_updated_webhook_event.rbs create mode 100644 sig/lithic/models/dispute_updated_webhook_event.rbs create mode 100644 sig/lithic/models/external_bank_account_created_webhook_event.rbs create mode 100644 sig/lithic/models/external_bank_account_updated_webhook_event.rbs create mode 100644 sig/lithic/models/external_payment_created_webhook_event.rbs create mode 100644 sig/lithic/models/external_payment_updated_webhook_event.rbs create mode 100644 sig/lithic/models/financial_account_created_webhook_event.rbs create mode 100644 sig/lithic/models/financial_account_updated_webhook_event.rbs create mode 100644 sig/lithic/models/funding_event_created_webhook_event.rbs create mode 100644 sig/lithic/models/internal_transaction_created_webhook_event.rbs create mode 100644 sig/lithic/models/internal_transaction_updated_webhook_event.rbs create mode 100644 sig/lithic/models/loan_tape_created_webhook_event.rbs create mode 100644 sig/lithic/models/loan_tape_updated_webhook_event.rbs create mode 100644 sig/lithic/models/management_operation_created_webhook_event.rbs create mode 100644 sig/lithic/models/management_operation_updated_webhook_event.rbs create mode 100644 sig/lithic/models/network_total_created_webhook_event.rbs create mode 100644 sig/lithic/models/network_total_updated_webhook_event.rbs create mode 100644 sig/lithic/models/parsed_webhook_event.rbs create mode 100644 sig/lithic/models/payment_transaction_created_webhook_event.rbs create mode 100644 sig/lithic/models/payment_transaction_updated_webhook_event.rbs create mode 100644 sig/lithic/models/settlement_report_updated_webhook_event.rbs create mode 100644 sig/lithic/models/statements_created_webhook_event.rbs create mode 100644 sig/lithic/models/three_ds_authentication_challenge_webhook_event.rbs create mode 100644 sig/lithic/models/three_ds_authentication_created_webhook_event.rbs create mode 100644 sig/lithic/models/three_ds_authentication_updated_webhook_event.rbs create mode 100644 sig/lithic/models/tokenization_approval_request_webhook_event.rbs create mode 100644 sig/lithic/models/tokenization_decisioning_request_webhook_event.rbs create mode 100644 sig/lithic/models/tokenization_result_webhook_event.rbs create mode 100644 sig/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbs create mode 100644 sig/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbs create mode 100644 sig/lithic/models/tokenization_updated_webhook_event.rbs create mode 100644 sig/lithic/models/webhook_parsed_params.rbs create mode 100644 sig/lithic/resources/webhooks.rbs create mode 100644 test/lithic/resources/webhooks_test.rb diff --git a/.stats.yml b/.stats.yml index 3f808b06..315b0f37 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f -config_hash: 739714a3fead0b26ee3a3b7bc51081f6 +config_hash: 2b2786c821f62db49cc630ba45329336 diff --git a/Gemfile b/Gemfile index 1be178cb..2cf558a8 100644 --- a/Gemfile +++ b/Gemfile @@ -22,6 +22,7 @@ group :development, :test do gem "minitest-hooks" gem "minitest-proveit" gem "minitest-rg" + gem "standardwebhooks", "~> 1.0", github: "standard-webhooks/standard-webhooks", glob: "libraries/ruby/*.gemspec" gem "webmock" end diff --git a/Gemfile.lock b/Gemfile.lock index e52cafce..aa37a26e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,6 +8,13 @@ GIT rbs syntax_tree (>= 2.0.1) +GIT + remote: https://github.com/standard-webhooks/standard-webhooks.git + revision: a173a6c0125ca2b9245bf5ea3f1c61384ccc10a2 + glob: libraries/ruby/*.gemspec + specs: + standardwebhooks (1.0.0) + PATH remote: . specs: @@ -214,6 +221,7 @@ DEPENDENCIES redcarpet rubocop sorbet + standardwebhooks (~> 1.0)! steep syntax_tree syntax_tree-rbs! diff --git a/README.md b/README.md index 38d09b59..9231a939 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,41 @@ if page.next_page? end ``` +### Webhooks + +Lithic uses webhooks to notify your application when events happen. The library provides signature verification via the optional `standardwebhooks` gem. + +#### Parsing and verifying webhooks + +```ruby +# Verifies signature and returns typed event +event = lithic.webhooks.parse( + request.body.read, + headers: request.headers, + secret: ENV["LITHIC_WEBHOOK_SECRET"] # optional, reads from env by default +) + +case event +when Lithic::Models::CardCreatedWebhookEvent + puts("Card created: #{event.data.token}") +end +``` + +#### Parsing without verification + +```ruby +# Parse only - skips signature verification (not recommended for production) +event = lithic.webhooks.parse_unsafe(request.body.read) +``` + +#### Installing standardwebhooks (optional) + +To use signature verification, install from GitHub: + +```ruby +gem "standardwebhooks", "~> 1.0", github: "standard-webhooks/standard-webhooks", glob: "libraries/ruby/*.gemspec" +``` + ### Handling errors When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Lithic::Errors::APIError` will be thrown: diff --git a/lib/lithic.rb b/lib/lithic.rb index 4fd5b807..9ef65dd5 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -55,9 +55,26 @@ require_relative "lithic/internal/cursor_page" require_relative "lithic/internal/single_page" require_relative "lithic/models/transaction" +require_relative "lithic/models/auth_rules/v2/backtest_results" +require_relative "lithic/models/book_transfer_response" require_relative "lithic/models/non_pci_card" +require_relative "lithic/models/transactions/events/enhanced_data" +require_relative "lithic/models/dispute_evidence" +require_relative "lithic/models/dispute_v2" +require_relative "lithic/models/dispute" +require_relative "lithic/models/external_bank_account" +require_relative "lithic/models/external_payment" +require_relative "lithic/models/financial_account" +require_relative "lithic/models/funding_event" +require_relative "lithic/models/internal_transaction" +require_relative "lithic/models/financial_accounts/loan_tape" +require_relative "lithic/models/management_operation_transaction" +require_relative "lithic/models/network_total" require_relative "lithic/models/payment" +require_relative "lithic/models/settlement_report" +require_relative "lithic/models/financial_accounts/statement" require_relative "lithic/models/three_ds/challenge_response" +require_relative "lithic/models/three_ds_authentication" require_relative "lithic/models/account" require_relative "lithic/models/account_activity_list_params" require_relative "lithic/models/account_activity_list_response" @@ -65,8 +82,10 @@ require_relative "lithic/models/account_activity_retrieve_transaction_response" require_relative "lithic/models/account_financial_account_type" require_relative "lithic/models/account_holder" +require_relative "lithic/models/account_holder_created_webhook_event" require_relative "lithic/models/account_holder_create_params" require_relative "lithic/models/account_holder_create_response" +require_relative "lithic/models/account_holder_document_updated_webhook_event" require_relative "lithic/models/account_holder_list_documents_params" require_relative "lithic/models/account_holder_list_documents_response" require_relative "lithic/models/account_holder_list_params" @@ -75,9 +94,11 @@ require_relative "lithic/models/account_holder_simulate_enrollment_document_review_params" require_relative "lithic/models/account_holder_simulate_enrollment_review_params" require_relative "lithic/models/account_holder_simulate_enrollment_review_response" +require_relative "lithic/models/account_holder_updated_webhook_event" require_relative "lithic/models/account_holder_update_params" require_relative "lithic/models/account_holder_update_response" require_relative "lithic/models/account_holder_upload_document_params" +require_relative "lithic/models/account_holder_verification_webhook_event" require_relative "lithic/models/account_list_params" require_relative "lithic/models/account_retrieve_params" require_relative "lithic/models/account_retrieve_spend_limits_params" @@ -88,6 +109,7 @@ require_relative "lithic/models/aggregate_balance" require_relative "lithic/models/aggregate_balance_list_params" require_relative "lithic/models/api_status" +require_relative "lithic/models/asa_request_webhook_event" require_relative "lithic/models/auth_rules/auth_rule" require_relative "lithic/models/auth_rules/auth_rule_condition" require_relative "lithic/models/auth_rules/conditional_3ds_action_parameters" @@ -103,7 +125,6 @@ require_relative "lithic/models/auth_rules/rule_stats" require_relative "lithic/models/auth_rules/v2/backtest_create_params" require_relative "lithic/models/auth_rules/v2/backtest_create_response" -require_relative "lithic/models/auth_rules/v2/backtest_results" require_relative "lithic/models/auth_rules/v2/backtest_retrieve_params" require_relative "lithic/models/auth_rules/v2_create_params" require_relative "lithic/models/auth_rules/v2_delete_params" @@ -118,23 +139,28 @@ require_relative "lithic/models/auth_rules/v2_update_params" require_relative "lithic/models/auth_rules/velocity_limit_params" require_relative "lithic/models/auth_rules/velocity_limit_period" +require_relative "lithic/models/auth_rules_backtest_report_created_webhook_event" require_relative "lithic/models/auth_stream_enrollment_retrieve_secret_params" require_relative "lithic/models/auth_stream_enrollment_rotate_secret_params" require_relative "lithic/models/auth_stream_secret" require_relative "lithic/models/balance" require_relative "lithic/models/balance_list_params" +require_relative "lithic/models/balance_updated_webhook_event" require_relative "lithic/models/book_transfer_create_params" require_relative "lithic/models/book_transfer_list_params" -require_relative "lithic/models/book_transfer_response" require_relative "lithic/models/book_transfer_retrieve_params" require_relative "lithic/models/book_transfer_reverse_params" +require_relative "lithic/models/book_transfer_transaction_created_webhook_event" +require_relative "lithic/models/book_transfer_transaction_updated_webhook_event" require_relative "lithic/models/card" require_relative "lithic/models/card_bulk_order" require_relative "lithic/models/card_bulk_order_create_params" require_relative "lithic/models/card_bulk_order_list_params" require_relative "lithic/models/card_bulk_order_retrieve_params" require_relative "lithic/models/card_bulk_order_update_params" +require_relative "lithic/models/card_converted_webhook_event" require_relative "lithic/models/card_convert_physical_params" +require_relative "lithic/models/card_created_webhook_event" require_relative "lithic/models/card_create_params" require_relative "lithic/models/card_embed_params" require_relative "lithic/models/card_embed_response" @@ -145,7 +171,9 @@ require_relative "lithic/models/card_program_retrieve_params" require_relative "lithic/models/card_provision_params" require_relative "lithic/models/card_provision_response" +require_relative "lithic/models/card_reissued_webhook_event" require_relative "lithic/models/card_reissue_params" +require_relative "lithic/models/card_renewed_webhook_event" require_relative "lithic/models/card_renew_params" require_relative "lithic/models/card_retrieve_params" require_relative "lithic/models/card_retrieve_spend_limits_params" @@ -155,7 +183,11 @@ require_relative "lithic/models/cards/financial_transaction_list_params" require_relative "lithic/models/cards/financial_transaction_retrieve_params" require_relative "lithic/models/card_search_by_pan_params" +require_relative "lithic/models/card_shipped_webhook_event" require_relative "lithic/models/card_spend_limits" +require_relative "lithic/models/card_transaction_enhanced_data_created_webhook_event" +require_relative "lithic/models/card_transaction_enhanced_data_updated_webhook_event" +require_relative "lithic/models/card_transaction_updated_webhook_event" require_relative "lithic/models/card_update_params" require_relative "lithic/models/card_web_provision_params" require_relative "lithic/models/card_web_provision_response" @@ -172,12 +204,16 @@ require_relative "lithic/models/digital_card_art" require_relative "lithic/models/digital_card_art_list_params" require_relative "lithic/models/digital_card_art_retrieve_params" +require_relative "lithic/models/digital_wallet_tokenization_approval_request_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_result_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_updated_webhook_event" require_relative "lithic/models/digital_wallet_token_metadata" -require_relative "lithic/models/dispute" require_relative "lithic/models/dispute_create_params" require_relative "lithic/models/dispute_delete_evidence_params" require_relative "lithic/models/dispute_delete_params" -require_relative "lithic/models/dispute_evidence" +require_relative "lithic/models/dispute_evidence_upload_failed_webhook_event" require_relative "lithic/models/dispute_initiate_evidence_upload_params" require_relative "lithic/models/dispute_list_evidences_params" require_relative "lithic/models/dispute_list_params" @@ -185,8 +221,10 @@ require_relative "lithic/models/dispute_retrieve_params" require_relative "lithic/models/disputes_v2_list_params" require_relative "lithic/models/disputes_v2_retrieve_params" +require_relative "lithic/models/dispute_transaction_created_webhook_event" +require_relative "lithic/models/dispute_transaction_updated_webhook_event" +require_relative "lithic/models/dispute_updated_webhook_event" require_relative "lithic/models/dispute_update_params" -require_relative "lithic/models/dispute_v2" require_relative "lithic/models/document" require_relative "lithic/models/event" require_relative "lithic/models/event_list_attempts_params" @@ -206,8 +244,8 @@ require_relative "lithic/models/events/subscription_send_simulated_example_params" require_relative "lithic/models/events/subscription_update_params" require_relative "lithic/models/event_subscription" -require_relative "lithic/models/external_bank_account" require_relative "lithic/models/external_bank_account_address" +require_relative "lithic/models/external_bank_account_created_webhook_event" require_relative "lithic/models/external_bank_account_create_params" require_relative "lithic/models/external_bank_account_create_response" require_relative "lithic/models/external_bank_account_list_params" @@ -220,20 +258,22 @@ require_relative "lithic/models/external_bank_accounts/micro_deposit_create_params" require_relative "lithic/models/external_bank_accounts/micro_deposit_create_response" require_relative "lithic/models/external_bank_account_unpause_params" +require_relative "lithic/models/external_bank_account_updated_webhook_event" require_relative "lithic/models/external_bank_account_update_params" require_relative "lithic/models/external_bank_account_update_response" -require_relative "lithic/models/external_payment" require_relative "lithic/models/external_payment_cancel_params" +require_relative "lithic/models/external_payment_created_webhook_event" require_relative "lithic/models/external_payment_create_params" require_relative "lithic/models/external_payment_list_params" require_relative "lithic/models/external_payment_release_params" require_relative "lithic/models/external_payment_retrieve_params" require_relative "lithic/models/external_payment_reverse_params" require_relative "lithic/models/external_payment_settle_params" +require_relative "lithic/models/external_payment_updated_webhook_event" require_relative "lithic/models/external_resource" require_relative "lithic/models/external_resource_type" -require_relative "lithic/models/financial_account" require_relative "lithic/models/financial_account_balance" +require_relative "lithic/models/financial_account_created_webhook_event" require_relative "lithic/models/financial_account_create_params" require_relative "lithic/models/financial_account_list_params" require_relative "lithic/models/financial_account_register_account_number_params" @@ -246,14 +286,13 @@ require_relative "lithic/models/financial_accounts/statements" require_relative "lithic/models/financial_accounts/financial_transaction_list_params" require_relative "lithic/models/financial_accounts/financial_transaction_retrieve_params" -require_relative "lithic/models/financial_accounts/loan_tape" require_relative "lithic/models/financial_accounts/loan_tape_list_params" require_relative "lithic/models/financial_accounts/loan_tape_retrieve_params" -require_relative "lithic/models/financial_accounts/statement" require_relative "lithic/models/financial_accounts/statement_list_params" require_relative "lithic/models/financial_accounts/statement_retrieve_params" require_relative "lithic/models/financial_accounts/statements/line_item_list_params" require_relative "lithic/models/financial_accounts/statements/statement_line_items" +require_relative "lithic/models/financial_account_updated_webhook_event" require_relative "lithic/models/financial_account_update_params" require_relative "lithic/models/financial_account_update_status_params" require_relative "lithic/models/financial_event" @@ -262,29 +301,35 @@ require_relative "lithic/models/fraud/transaction_report_response" require_relative "lithic/models/fraud/transaction_retrieve_params" require_relative "lithic/models/fraud/transaction_retrieve_response" -require_relative "lithic/models/funding_event" +require_relative "lithic/models/funding_event_created_webhook_event" require_relative "lithic/models/funding_event_list_params" require_relative "lithic/models/funding_event_retrieve_details_params" require_relative "lithic/models/funding_event_retrieve_details_response" require_relative "lithic/models/funding_event_retrieve_params" require_relative "lithic/models/instance_financial_account_type" -require_relative "lithic/models/internal_transaction" +require_relative "lithic/models/internal_transaction_created_webhook_event" +require_relative "lithic/models/internal_transaction_updated_webhook_event" require_relative "lithic/models/kyb" require_relative "lithic/models/kyb_business_entity" require_relative "lithic/models/kyc" require_relative "lithic/models/kyc_exempt" +require_relative "lithic/models/loan_tape_created_webhook_event" +require_relative "lithic/models/loan_tape_updated_webhook_event" +require_relative "lithic/models/management_operation_created_webhook_event" require_relative "lithic/models/management_operation_create_params" require_relative "lithic/models/management_operation_list_params" require_relative "lithic/models/management_operation_retrieve_params" require_relative "lithic/models/management_operation_reverse_params" -require_relative "lithic/models/management_operation_transaction" +require_relative "lithic/models/management_operation_updated_webhook_event" require_relative "lithic/models/merchant" require_relative "lithic/models/message_attempt" require_relative "lithic/models/network_program" require_relative "lithic/models/network_program_list_params" require_relative "lithic/models/network_program_retrieve_params" -require_relative "lithic/models/network_total" +require_relative "lithic/models/network_total_created_webhook_event" +require_relative "lithic/models/network_total_updated_webhook_event" require_relative "lithic/models/owner_type" +require_relative "lithic/models/parsed_webhook_event" require_relative "lithic/models/payment_create_params" require_relative "lithic/models/payment_create_response" require_relative "lithic/models/payment_list_params" @@ -300,6 +345,8 @@ require_relative "lithic/models/payment_simulate_release_response" require_relative "lithic/models/payment_simulate_return_params" require_relative "lithic/models/payment_simulate_return_response" +require_relative "lithic/models/payment_transaction_created_webhook_event" +require_relative "lithic/models/payment_transaction_updated_webhook_event" require_relative "lithic/models/provision_response" require_relative "lithic/models/reports/settlement/network_total_list_params" require_relative "lithic/models/reports/settlement/network_total_retrieve_params" @@ -312,10 +359,11 @@ require_relative "lithic/models/responder_endpoint_delete_params" require_relative "lithic/models/responder_endpoint_status" require_relative "lithic/models/settlement_detail" -require_relative "lithic/models/settlement_report" +require_relative "lithic/models/settlement_report_updated_webhook_event" require_relative "lithic/models/settlement_summary_details" require_relative "lithic/models/shipping_address" require_relative "lithic/models/spend_limit_duration" +require_relative "lithic/models/statements_created_webhook_event" require_relative "lithic/models/statement_totals" require_relative "lithic/models/three_ds/authentication_retrieve_params" require_relative "lithic/models/three_ds/authentication_simulate_otp_entry_params" @@ -326,11 +374,15 @@ require_relative "lithic/models/three_ds/decisioning_retrieve_secret_params" require_relative "lithic/models/three_ds/decisioning_retrieve_secret_response" require_relative "lithic/models/three_ds/decisioning_rotate_secret_params" -require_relative "lithic/models/three_ds_authentication" +require_relative "lithic/models/three_ds_authentication_challenge_webhook_event" +require_relative "lithic/models/three_ds_authentication_created_webhook_event" +require_relative "lithic/models/three_ds_authentication_updated_webhook_event" require_relative "lithic/models/token_info" require_relative "lithic/models/tokenization" require_relative "lithic/models/tokenization_activate_params" +require_relative "lithic/models/tokenization_approval_request_webhook_event" require_relative "lithic/models/tokenization_deactivate_params" +require_relative "lithic/models/tokenization_decisioning_request_webhook_event" require_relative "lithic/models/tokenization_decisioning_retrieve_secret_params" require_relative "lithic/models/tokenization_decisioning_rotate_secret_params" require_relative "lithic/models/tokenization_decisioning_rotate_secret_response" @@ -338,20 +390,23 @@ require_relative "lithic/models/tokenization_list_params" require_relative "lithic/models/tokenization_pause_params" require_relative "lithic/models/tokenization_resend_activation_code_params" +require_relative "lithic/models/tokenization_result_webhook_event" require_relative "lithic/models/tokenization_retrieve_params" require_relative "lithic/models/tokenization_rule_result" require_relative "lithic/models/tokenization_secret" require_relative "lithic/models/tokenization_simulate_params" require_relative "lithic/models/tokenization_tfa_reason" +require_relative "lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event" +require_relative "lithic/models/tokenization_two_factor_authentication_code_webhook_event" require_relative "lithic/models/tokenization_unpause_params" require_relative "lithic/models/tokenization_update_digital_card_art_params" +require_relative "lithic/models/tokenization_updated_webhook_event" require_relative "lithic/models/transaction_expire_authorization_params" require_relative "lithic/models/transaction_list_params" require_relative "lithic/models/transaction_retrieve_params" require_relative "lithic/models/transactions/enhanced_commercial_data_retrieve_params" require_relative "lithic/models/transactions/enhanced_commercial_data_retrieve_response" require_relative "lithic/models/transactions/events/enhanced_commercial_data_retrieve_params" -require_relative "lithic/models/transactions/events/enhanced_data" require_relative "lithic/models/transaction_simulate_authorization_advice_params" require_relative "lithic/models/transaction_simulate_authorization_advice_response" require_relative "lithic/models/transaction_simulate_authorization_params" @@ -370,6 +425,7 @@ require_relative "lithic/models/transfer_create_params" require_relative "lithic/models/verification_method" require_relative "lithic/models/wallet_decisioning_info" +require_relative "lithic/models/webhook_parsed_params" require_relative "lithic/models/wire_party_details" require_relative "lithic/models" require_relative "lithic/resources/account_activity" @@ -428,3 +484,4 @@ require_relative "lithic/resources/transactions/events" require_relative "lithic/resources/transactions/events/enhanced_commercial_data" require_relative "lithic/resources/transfers" +require_relative "lithic/resources/webhooks" diff --git a/lib/lithic/client.rb b/lib/lithic/client.rb index f032abd5..b39ba831 100644 --- a/lib/lithic/client.rb +++ b/lib/lithic/client.rb @@ -119,6 +119,9 @@ class Client < Lithic::Internal::Transport::BaseClient # @return [Lithic::Resources::AccountActivity] attr_reader :account_activity + # @return [Lithic::Resources::Webhooks] + attr_reader :webhooks + # Status of api # # @overload api_status(request_options: {}) @@ -225,6 +228,7 @@ def initialize( @fraud = Lithic::Resources::Fraud.new(client: self) @network_programs = Lithic::Resources::NetworkPrograms.new(client: self) @account_activity = Lithic::Resources::AccountActivity.new(client: self) + @webhooks = Lithic::Resources::Webhooks.new(client: self) end end end diff --git a/lib/lithic/errors.rb b/lib/lithic/errors.rb index 011358a5..1509769a 100644 --- a/lib/lithic/errors.rb +++ b/lib/lithic/errors.rb @@ -224,5 +224,20 @@ class RateLimitError < Lithic::Errors::APIStatusError class InternalServerError < Lithic::Errors::APIStatusError HTTP_STATUS = (500..) end + + class MissingDependencyError < Lithic::Errors::Error + # @api private + # + # @param gem_name [String] + # @param feature [String] + def initialize(gem_name:, feature:) + message = [ + "The '#{gem_name}' gem is required to use #{feature}.", + "Install it with: gem install #{gem_name}", + "Or add it to your Gemfile: gem '#{gem_name}'" + ].join("\n") + super(message) + end + end end end diff --git a/lib/lithic/models.rb b/lib/lithic/models.rb index e6e89d15..fa2f704a 100644 --- a/lib/lithic/models.rb +++ b/lib/lithic/models.rb @@ -49,8 +49,12 @@ module Lithic AccountHolder = Lithic::Models::AccountHolder + AccountHolderCreatedWebhookEvent = Lithic::Models::AccountHolderCreatedWebhookEvent + AccountHolderCreateParams = Lithic::Models::AccountHolderCreateParams + AccountHolderDocumentUpdatedWebhookEvent = Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent + AccountHolderListDocumentsParams = Lithic::Models::AccountHolderListDocumentsParams AccountHolderListParams = Lithic::Models::AccountHolderListParams @@ -64,10 +68,14 @@ module Lithic AccountHolderSimulateEnrollmentReviewParams = Lithic::Models::AccountHolderSimulateEnrollmentReviewParams + AccountHolderUpdatedWebhookEvent = Lithic::Models::AccountHolderUpdatedWebhookEvent + AccountHolderUpdateParams = Lithic::Models::AccountHolderUpdateParams AccountHolderUploadDocumentParams = Lithic::Models::AccountHolderUploadDocumentParams + AccountHolderVerificationWebhookEvent = Lithic::Models::AccountHolderVerificationWebhookEvent + AccountListParams = Lithic::Models::AccountListParams AccountRetrieveParams = Lithic::Models::AccountRetrieveParams @@ -88,8 +96,12 @@ module Lithic APIStatus = Lithic::Models::APIStatus + AsaRequestWebhookEvent = Lithic::Models::AsaRequestWebhookEvent + AuthRules = Lithic::Models::AuthRules + AuthRulesBacktestReportCreatedWebhookEvent = Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent + AuthStreamEnrollmentRetrieveSecretParams = Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams AuthStreamEnrollmentRotateSecretParams = Lithic::Models::AuthStreamEnrollmentRotateSecretParams @@ -100,6 +112,8 @@ module Lithic BalanceListParams = Lithic::Models::BalanceListParams + BalanceUpdatedWebhookEvent = Lithic::Models::BalanceUpdatedWebhookEvent + BookTransferCreateParams = Lithic::Models::BookTransferCreateParams BookTransferListParams = Lithic::Models::BookTransferListParams @@ -110,6 +124,10 @@ module Lithic BookTransferReverseParams = Lithic::Models::BookTransferReverseParams + BookTransferTransactionCreatedWebhookEvent = Lithic::Models::BookTransferTransactionCreatedWebhookEvent + + BookTransferTransactionUpdatedWebhookEvent = Lithic::Models::BookTransferTransactionUpdatedWebhookEvent + Card = Lithic::Models::Card CardBulkOrder = Lithic::Models::CardBulkOrder @@ -122,8 +140,12 @@ module Lithic CardBulkOrderUpdateParams = Lithic::Models::CardBulkOrderUpdateParams + CardConvertedWebhookEvent = Lithic::Models::CardConvertedWebhookEvent + CardConvertPhysicalParams = Lithic::Models::CardConvertPhysicalParams + CardCreatedWebhookEvent = Lithic::Models::CardCreatedWebhookEvent + CardCreateParams = Lithic::Models::CardCreateParams CardEmbedParams = Lithic::Models::CardEmbedParams @@ -140,8 +162,12 @@ module Lithic CardProvisionParams = Lithic::Models::CardProvisionParams + CardReissuedWebhookEvent = Lithic::Models::CardReissuedWebhookEvent + CardReissueParams = Lithic::Models::CardReissueParams + CardRenewedWebhookEvent = Lithic::Models::CardRenewedWebhookEvent + CardRenewParams = Lithic::Models::CardRenewParams CardRetrieveParams = Lithic::Models::CardRetrieveParams @@ -152,8 +178,18 @@ module Lithic CardSearchByPanParams = Lithic::Models::CardSearchByPanParams + CardShippedWebhookEvent = Lithic::Models::CardShippedWebhookEvent + CardSpendLimits = Lithic::Models::CardSpendLimits + CardTransactionEnhancedDataCreatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent + + CardTransactionEnhancedDataUpdatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent + + CardTransactionUpdatedWebhookEvent = Lithic::Models::CardTransactionUpdatedWebhookEvent + CardUpdateParams = Lithic::Models::CardUpdateParams CardWebProvisionParams = Lithic::Models::CardWebProvisionParams @@ -176,6 +212,20 @@ module Lithic DigitalCardArtRetrieveParams = Lithic::Models::DigitalCardArtRetrieveParams + DigitalWalletTokenizationApprovalRequestWebhookEvent = + Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent + + DigitalWalletTokenizationResultWebhookEvent = Lithic::Models::DigitalWalletTokenizationResultWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + + DigitalWalletTokenizationUpdatedWebhookEvent = + Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent + DigitalWalletTokenMetadata = Lithic::Models::DigitalWalletTokenMetadata Dispute = Lithic::Models::Dispute @@ -188,6 +238,8 @@ module Lithic DisputeEvidence = Lithic::Models::DisputeEvidence + DisputeEvidenceUploadFailedWebhookEvent = Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent + DisputeInitiateEvidenceUploadParams = Lithic::Models::DisputeInitiateEvidenceUploadParams DisputeListEvidencesParams = Lithic::Models::DisputeListEvidencesParams @@ -202,6 +254,12 @@ module Lithic DisputesV2RetrieveParams = Lithic::Models::DisputesV2RetrieveParams + DisputeTransactionCreatedWebhookEvent = Lithic::Models::DisputeTransactionCreatedWebhookEvent + + DisputeTransactionUpdatedWebhookEvent = Lithic::Models::DisputeTransactionUpdatedWebhookEvent + + DisputeUpdatedWebhookEvent = Lithic::Models::DisputeUpdatedWebhookEvent + DisputeUpdateParams = Lithic::Models::DisputeUpdateParams DisputeV2 = Lithic::Models::DisputeV2 @@ -224,6 +282,8 @@ module Lithic ExternalBankAccountAddress = Lithic::Models::ExternalBankAccountAddress + ExternalBankAccountCreatedWebhookEvent = Lithic::Models::ExternalBankAccountCreatedWebhookEvent + ExternalBankAccountCreateParams = Lithic::Models::ExternalBankAccountCreateParams ExternalBankAccountListParams = Lithic::Models::ExternalBankAccountListParams @@ -238,12 +298,16 @@ module Lithic ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams + ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent + ExternalBankAccountUpdateParams = Lithic::Models::ExternalBankAccountUpdateParams ExternalPayment = Lithic::Models::ExternalPayment ExternalPaymentCancelParams = Lithic::Models::ExternalPaymentCancelParams + ExternalPaymentCreatedWebhookEvent = Lithic::Models::ExternalPaymentCreatedWebhookEvent + ExternalPaymentCreateParams = Lithic::Models::ExternalPaymentCreateParams ExternalPaymentListParams = Lithic::Models::ExternalPaymentListParams @@ -256,6 +320,8 @@ module Lithic ExternalPaymentSettleParams = Lithic::Models::ExternalPaymentSettleParams + ExternalPaymentUpdatedWebhookEvent = Lithic::Models::ExternalPaymentUpdatedWebhookEvent + ExternalResource = Lithic::Models::ExternalResource ExternalResourceType = Lithic::Models::ExternalResourceType @@ -264,6 +330,8 @@ module Lithic FinancialAccountBalance = Lithic::Models::FinancialAccountBalance + FinancialAccountCreatedWebhookEvent = Lithic::Models::FinancialAccountCreatedWebhookEvent + FinancialAccountCreateParams = Lithic::Models::FinancialAccountCreateParams FinancialAccountListParams = Lithic::Models::FinancialAccountListParams @@ -274,6 +342,8 @@ module Lithic FinancialAccounts = Lithic::Models::FinancialAccounts + FinancialAccountUpdatedWebhookEvent = Lithic::Models::FinancialAccountUpdatedWebhookEvent + FinancialAccountUpdateParams = Lithic::Models::FinancialAccountUpdateParams FinancialAccountUpdateStatusParams = Lithic::Models::FinancialAccountUpdateStatusParams @@ -286,6 +356,8 @@ module Lithic FundingEvent = Lithic::Models::FundingEvent + FundingEventCreatedWebhookEvent = Lithic::Models::FundingEventCreatedWebhookEvent + FundingEventListParams = Lithic::Models::FundingEventListParams FundingEventRetrieveDetailsParams = Lithic::Models::FundingEventRetrieveDetailsParams @@ -296,6 +368,10 @@ module Lithic InternalTransactionAPI = Lithic::Models::InternalTransactionAPI + InternalTransactionCreatedWebhookEvent = Lithic::Models::InternalTransactionCreatedWebhookEvent + + InternalTransactionUpdatedWebhookEvent = Lithic::Models::InternalTransactionUpdatedWebhookEvent + KYB = Lithic::Models::KYB KYBBusinessEntity = Lithic::Models::KYBBusinessEntity @@ -304,6 +380,12 @@ module Lithic KYCExempt = Lithic::Models::KYCExempt + LoanTapeCreatedWebhookEvent = Lithic::Models::LoanTapeCreatedWebhookEvent + + LoanTapeUpdatedWebhookEvent = Lithic::Models::LoanTapeUpdatedWebhookEvent + + ManagementOperationCreatedWebhookEvent = Lithic::Models::ManagementOperationCreatedWebhookEvent + ManagementOperationCreateParams = Lithic::Models::ManagementOperationCreateParams ManagementOperationListParams = Lithic::Models::ManagementOperationListParams @@ -314,6 +396,8 @@ module Lithic ManagementOperationTransaction = Lithic::Models::ManagementOperationTransaction + ManagementOperationUpdatedWebhookEvent = Lithic::Models::ManagementOperationUpdatedWebhookEvent + Merchant = Lithic::Models::Merchant MessageAttempt = Lithic::Models::MessageAttempt @@ -326,10 +410,16 @@ module Lithic NetworkTotal = Lithic::Models::NetworkTotal + NetworkTotalCreatedWebhookEvent = Lithic::Models::NetworkTotalCreatedWebhookEvent + + NetworkTotalUpdatedWebhookEvent = Lithic::Models::NetworkTotalUpdatedWebhookEvent + NonPCICard = Lithic::Models::NonPCICard OwnerType = Lithic::Models::OwnerType + ParsedWebhookEvent = Lithic::Models::ParsedWebhookEvent + Payment = Lithic::Models::Payment PaymentCreateParams = Lithic::Models::PaymentCreateParams @@ -350,6 +440,10 @@ module Lithic PaymentSimulateReturnParams = Lithic::Models::PaymentSimulateReturnParams + PaymentTransactionCreatedWebhookEvent = Lithic::Models::PaymentTransactionCreatedWebhookEvent + + PaymentTransactionUpdatedWebhookEvent = Lithic::Models::PaymentTransactionUpdatedWebhookEvent + ProvisionResponse = Lithic::Models::ProvisionResponse Reports = Lithic::Models::Reports @@ -368,26 +462,40 @@ module Lithic SettlementReport = Lithic::Models::SettlementReport + SettlementReportUpdatedWebhookEvent = Lithic::Models::SettlementReportUpdatedWebhookEvent + SettlementSummaryDetails = Lithic::Models::SettlementSummaryDetails ShippingAddress = Lithic::Models::ShippingAddress SpendLimitDuration = Lithic::Models::SpendLimitDuration + StatementsCreatedWebhookEvent = Lithic::Models::StatementsCreatedWebhookEvent + StatementTotals = Lithic::Models::StatementTotals ThreeDS = Lithic::Models::ThreeDS ThreeDSAuthentication = Lithic::Models::ThreeDSAuthentication + ThreeDSAuthenticationChallengeWebhookEvent = Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent + + ThreeDSAuthenticationCreatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent + + ThreeDSAuthenticationUpdatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent + TokenInfo = Lithic::Models::TokenInfo Tokenization = Lithic::Models::Tokenization TokenizationActivateParams = Lithic::Models::TokenizationActivateParams + TokenizationApprovalRequestWebhookEvent = Lithic::Models::TokenizationApprovalRequestWebhookEvent + TokenizationDeactivateParams = Lithic::Models::TokenizationDeactivateParams + TokenizationDecisioningRequestWebhookEvent = Lithic::Models::TokenizationDecisioningRequestWebhookEvent + TokenizationDecisioningRetrieveSecretParams = Lithic::Models::TokenizationDecisioningRetrieveSecretParams TokenizationDecisioningRotateSecretParams = Lithic::Models::TokenizationDecisioningRotateSecretParams @@ -400,6 +508,8 @@ module Lithic TokenizationResendActivationCodeParams = Lithic::Models::TokenizationResendActivationCodeParams + TokenizationResultWebhookEvent = Lithic::Models::TokenizationResultWebhookEvent + TokenizationRetrieveParams = Lithic::Models::TokenizationRetrieveParams TokenizationRuleResult = Lithic::Models::TokenizationRuleResult @@ -410,10 +520,18 @@ module Lithic TokenizationTfaReason = Lithic::Models::TokenizationTfaReason + TokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + TokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent + TokenizationUnpauseParams = Lithic::Models::TokenizationUnpauseParams TokenizationUpdateDigitalCardArtParams = Lithic::Models::TokenizationUpdateDigitalCardArtParams + TokenizationUpdatedWebhookEvent = Lithic::Models::TokenizationUpdatedWebhookEvent + Transaction = Lithic::Models::Transaction TransactionExpireAuthorizationParams = Lithic::Models::TransactionExpireAuthorizationParams @@ -448,5 +566,7 @@ module Lithic WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo + WebhookParsedParams = Lithic::Models::WebhookParsedParams + WirePartyDetails = Lithic::Models::WirePartyDetails end diff --git a/lib/lithic/models/account_holder_created_webhook_event.rb b/lib/lithic/models/account_holder_created_webhook_event.rb new file mode 100644 index 00000000..1c673e4b --- /dev/null +++ b/lib/lithic/models/account_holder_created_webhook_event.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"account_holder.created"] + required :event_type, const: :"account_holder.created" + + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String, nil] + optional :token, String + + # @!attribute account_token + # The token of the account that was created. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute created + # When the account_holder was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute required_documents + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument] } + + # @!attribute status + # The status of the account_holder that was created. + # + # @return [Symbol, Lithic::Models::AccountHolderCreatedWebhookEvent::Status, nil] + optional :status, enum: -> { Lithic::AccountHolderCreatedWebhookEvent::Status } + + # @!attribute status_reason + # + # @return [Array, nil] + optional :status_reason, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(token: nil, account_token: nil, created: nil, required_documents: nil, status: nil, status_reason: nil, event_type: :"account_holder.created") + # @param token [String] The token of the account_holder that was created. + # + # @param account_token [String] The token of the account that was created. + # + # @param created [Time] When the account_holder was created + # + # @param required_documents [Array] + # + # @param status [Symbol, Lithic::Models::AccountHolderCreatedWebhookEvent::Status] The status of the account_holder that was created. + # + # @param status_reason [Array] + # + # @param event_type [Symbol, :"account_holder.created"] The type of event that occurred. + + # The status of the account_holder that was created. + # + # @see Lithic::Models::AccountHolderCreatedWebhookEvent#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_holder_document_updated_webhook_event.rb b/lib/lithic/models/account_holder_document_updated_webhook_event.rb new file mode 100644 index 00000000..f61be2dc --- /dev/null +++ b/lib/lithic/models/account_holder_document_updated_webhook_event.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderDocumentUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"account_holder_document.updated"] + required :event_type, const: :"account_holder_document.updated" + + # @!attribute token + # The token of the account holder document + # + # @return [String, nil] + optional :token, String + + # @!attribute account_holder_token + # The token of the account_holder that the document belongs to + # + # @return [String, nil] + optional :account_holder_token, String + + # @!attribute created + # When the account_holder was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute document_type + # Type of documentation to be submitted for verification of an account holder + # + # @return [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::DocumentType, nil] + optional :document_type, enum: -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType } + + # @!attribute entity_token + # The token of the entity that the document belongs to + # + # @return [String, nil] + optional :entity_token, String + + # @!attribute required_document_uploads + # + # @return [Array, nil] + optional :required_document_uploads, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] } + + # @!method initialize(token: nil, account_holder_token: nil, created: nil, document_type: nil, entity_token: nil, required_document_uploads: nil, event_type: :"account_holder_document.updated") + # @param token [String] The token of the account holder document + # + # @param account_holder_token [String] The token of the account_holder that the document belongs to + # + # @param created [Time] When the account_holder was created + # + # @param document_type [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::DocumentType] Type of documentation to be submitted for verification of an account holder + # + # @param entity_token [String] The token of the entity that the document belongs to + # + # @param required_document_uploads [Array] + # + # @param event_type [Symbol, :"account_holder_document.updated"] The type of event that occurred. + + # Type of documentation to be submitted for verification of an account holder + # + # @see Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent#document_type + module DocumentType + extend Lithic::Internal::Type::Enum + + DRIVERS_LICENSE = :DRIVERS_LICENSE + PASSPORT = :PASSPORT + PASSPORT_CARD = :PASSPORT_CARD + EIN_LETTER = :EIN_LETTER + TAX_RETURN = :TAX_RETURN + OPERATING_AGREEMENT = :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION = :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING = :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION = :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION = :ARTICLES_OF_ORGANIZATION + BYLAWS = :BYLAWS + GOVERNMENT_BUSINESS_LICENSE = :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT = :PARTNERSHIP_AGREEMENT + SS4_FORM = :SS4_FORM + BANK_STATEMENT = :BANK_STATEMENT + UTILITY_BILL_STATEMENT = :UTILITY_BILL_STATEMENT + SSN_CARD = :SSN_CARD + ITIN_LETTER = :ITIN_LETTER + FINCEN_BOI_REPORT = :FINCEN_BOI_REPORT + + # @!method self.values + # @return [Array] + end + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the document upload + # + # @return [String, nil] + optional :token, String + + # @!attribute accepted_entity_status_reasons + # + # @return [Array, nil] + optional :accepted_entity_status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute created + # When the document upload was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute image_type + # The type of image that was uploaded + # + # @return [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType, nil] + optional :image_type, + enum: -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType } + + # @!attribute rejected_entity_status_reasons + # + # @return [Array, nil] + optional :rejected_entity_status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute status + # The status of the document upload + # + # @return [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status, nil] + optional :status, + enum: -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status } + + # @!attribute status_reasons + # + # @return [Array, nil] + optional :status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute updated + # When the document upload was last updated + # + # @return [Time, nil] + optional :updated, Time + + # @!method initialize(token: nil, accepted_entity_status_reasons: nil, created: nil, image_type: nil, rejected_entity_status_reasons: nil, status: nil, status_reasons: nil, updated: nil) + # A document upload that belongs to the overall account holder document + # + # @param token [String] The token of the document upload + # + # @param accepted_entity_status_reasons [Array] + # + # @param created [Time] When the document upload was created + # + # @param image_type [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType] The type of image that was uploaded + # + # @param rejected_entity_status_reasons [Array] + # + # @param status [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status] The status of the document upload + # + # @param status_reasons [Array] + # + # @param updated [Time] When the document upload was last updated + + # The type of image that was uploaded + # + # @see Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload#image_type + module ImageType + extend Lithic::Internal::Type::Enum + + FRONT = :FRONT + BACK = :BACK + + # @!method self.values + # @return [Array] + end + + # The status of the document upload + # + # @see Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + PENDING_UPLOAD = :PENDING_UPLOAD + UPLOADED = :UPLOADED + PARTIAL_APPROVAL = :PARTIAL_APPROVAL + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/account_holder_updated_webhook_event.rb b/lib/lithic/models/account_holder_updated_webhook_event.rb new file mode 100644 index 00000000..70a7ec84 --- /dev/null +++ b/lib/lithic/models/account_holder_updated_webhook_event.rb @@ -0,0 +1,702 @@ +# frozen_string_literal: true + +module Lithic + module Models + # KYB payload for an updated account holder. + module AccountHolderUpdatedWebhookEvent + extend Lithic::Internal::Type::Union + + # KYB payload for an updated account holder. + variant -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload } + + # KYC payload for an updated account holder. + variant -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload } + + # Legacy payload for an updated account holder. + variant -> { Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload } + + class KYBPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest] + required :update_request, -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil, nature_of_business: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload} for more details. + # + # KYB payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param nature_of_business [String] Short description of the company's line of business (i.e., what does the company + # + # @param website_url [String] Company website URL. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute beneficial_owner_entities + # @deprecated + # + # Deprecated. + # + # @return [Array, nil] + optional :beneficial_owner_entities, -> { Lithic::Internal::Type::ArrayOf[Lithic::KYBBusinessEntity] } + + # @!attribute beneficial_owner_individuals + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::KYBBusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, nil] + optional :control_person, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson } + + # @!method initialize(beneficial_owner_entities: nil, beneficial_owner_individuals: nil, business_entity: nil, control_person: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest} + # for more details. + # + # Original request to update the account holder. + # + # @param beneficial_owner_entities [Array] Deprecated. + # + # @param beneficial_owner_individuals [Array] You must submit a list of all direct and indirect individuals with 25% or more o + # + # @param business_entity [Lithic::Models::KYBBusinessEntity] Information for business for which the account is being opened and KYB is being + # + # @param control_person [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson] An individual with significant responsibility for managing the legal entity (e.g + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual} + # for more details. + # + # @param address [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, nil] + optional :address, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson} + # for more details. + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @param address [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest] + required :update_request, -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload} for more details. + # + # KYC payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute individual + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual, nil] + optional :individual, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual } + + # @!method initialize(individual: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest} + # for more details. + # + # Original request to update the account holder. + # + # @param individual [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual] Information on the individual for whom the account is being opened and KYC is be + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, nil] + optional :address, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual} + # for more details. + # + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @param address [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute business_account_token + # If applicable, represents the business account token associated with the + # account_holder. + # + # @return [String, nil] + optional :business_account_token, String, nil?: true + + # @!attribute created + # When the account_holder updated event was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute email + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + # + # @return [String, nil] + optional :email, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType } + + # @!attribute external_id + # If applicable, represents the external_id associated with the account_holder. + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!attribute first_name + # If applicable, represents the account_holder's first name. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # If applicable, represents the account_holder's last name. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute legal_business_name + # If applicable, represents the account_holder's business name. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute phone_number + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(token:, business_account_token: nil, created: nil, email: nil, event_type: nil, external_id: nil, first_name: nil, last_name: nil, legal_business_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload} for more + # details. + # + # Legacy payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param business_account_token [String, nil] If applicable, represents the business account token associated with the account + # + # @param created [Time] When the account_holder updated event was created + # + # @param email [String] If updated, the newly updated email associated with the account_holder otherwise + # + # @param event_type [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType] The type of event that occurred. + # + # @param external_id [String, nil] If applicable, represents the external_id associated with the account_holder. + # + # @param first_name [String] If applicable, represents the account_holder's first name. + # + # @param last_name [String] If applicable, represents the account_holder's last name. + # + # @param legal_business_name [String] If applicable, represents the account_holder's business name. + # + # @param phone_number [String] If updated, the newly updated phone_number associated with the account_holder ot + + # The type of event that occurred. + # + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload, Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload)] + end + end +end diff --git a/lib/lithic/models/account_holder_verification_webhook_event.rb b/lib/lithic/models/account_holder_verification_webhook_event.rb new file mode 100644 index 00000000..0fbb60d1 --- /dev/null +++ b/lib/lithic/models/account_holder_verification_webhook_event.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderVerificationWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"account_holder.verification"] + required :event_type, const: :"account_holder.verification" + + # @!attribute token + # The token of the account_holder being verified. + # + # @return [String, nil] + optional :token, String + + # @!attribute account_token + # The token of the account being verified. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute created + # When the account_holder verification status was updated + # + # @return [Time, nil] + optional :created, Time + + # @!attribute status + # The status of the account_holder that was created + # + # @return [Symbol, Lithic::Models::AccountHolderVerificationWebhookEvent::Status, nil] + optional :status, enum: -> { Lithic::AccountHolderVerificationWebhookEvent::Status } + + # @!attribute status_reasons + # + # @return [Array, nil] + optional :status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(token: nil, account_token: nil, created: nil, status: nil, status_reasons: nil, event_type: :"account_holder.verification") + # @param token [String] The token of the account_holder being verified. + # + # @param account_token [String] The token of the account being verified. + # + # @param created [Time] When the account_holder verification status was updated + # + # @param status [Symbol, Lithic::Models::AccountHolderVerificationWebhookEvent::Status] The status of the account_holder that was created + # + # @param status_reasons [Array] + # + # @param event_type [Symbol, :"account_holder.verification"] The type of event that occurred. + + # The status of the account_holder that was created + # + # @see Lithic::Models::AccountHolderVerificationWebhookEvent#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/asa_request_webhook_event.rb b/lib/lithic/models/asa_request_webhook_event.rb new file mode 100644 index 00000000..179ff08d --- /dev/null +++ b/lib/lithic/models/asa_request_webhook_event.rb @@ -0,0 +1,1010 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AsaRequestWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute token + # The provisional transaction group uuid associated with the authorization + # + # @return [String] + required :token, String + + # @!attribute acquirer_fee + # Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # zero if no fee is assessed. Rebates may be transmitted as a negative value to + # indicate credited fees. + # + # @return [Integer] + required :acquirer_fee, Integer + + # @!attribute amount + # Authorization amount of the transaction (in cents), including any acquirer fees. + # The contents of this field are identical to `authorization_amount`. + # + # @return [Integer] + required :amount, Integer + + # @!attribute authorization_amount + # The base transaction amount (in cents) plus the acquirer fee field. This is the + # amount the issuer should authorize against unless the issuer is paying the + # acquirer fee on behalf of the cardholder. + # + # @return [Integer] + required :authorization_amount, Integer + + # @!attribute avs + # + # @return [Lithic::Models::AsaRequestWebhookEvent::Avs] + required :avs, -> { Lithic::AsaRequestWebhookEvent::Avs } + + # @!attribute card + # Card object in ASA + # + # @return [Lithic::Models::AsaRequestWebhookEvent::Card] + required :card, -> { Lithic::AsaRequestWebhookEvent::Card } + + # @!attribute cardholder_currency + # 3-character alphabetic ISO 4217 code for cardholder's billing currency. + # + # @return [String] + required :cardholder_currency, String + + # @!attribute cash_amount + # The portion of the transaction requested as cash back by the cardholder, and + # does not include any acquirer fees. The amount field includes the purchase + # amount, the requested cash back amount, and any acquirer fees. + # + # If no cash back was requested, the value of this field will be 0, and the field + # will always be present. + # + # @return [Integer] + required :cash_amount, Integer + + # @!attribute created + # Date and time when the transaction first occurred in UTC. + # + # @return [Time] + required :created, Time + + # @!attribute merchant + # + # @return [Lithic::Models::Merchant] + required :merchant, -> { Lithic::Merchant } + + # @!attribute merchant_amount + # The amount that the merchant will receive, denominated in `merchant_currency` + # and in the smallest currency unit. Note the amount includes `acquirer_fee`, + # similar to `authorization_amount`. It will be different from + # `authorization_amount` if the merchant is taking payment in a different + # currency. + # + # @return [Integer] + required :merchant_amount, Integer + + # @!attribute merchant_currency + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + # + # @return [String] + required :merchant_currency, String + + # @!attribute settled_amount + # Amount (in cents) of the transaction that has been settled, including any + # acquirer fees + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Status] + required :status, enum: -> { Lithic::AsaRequestWebhookEvent::Status } + + # @!attribute transaction_initiator + # The entity that initiated the transaction. + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::TransactionInitiator] + required :transaction_initiator, enum: -> { Lithic::AsaRequestWebhookEvent::TransactionInitiator } + + # @!attribute account_type + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::AccountType, nil] + optional :account_type, enum: -> { Lithic::AsaRequestWebhookEvent::AccountType } + + # @!attribute cardholder_authentication + # + # @return [Lithic::Models::CardholderAuthentication, nil] + optional :cardholder_authentication, -> { Lithic::CardholderAuthentication } + + # @!attribute cashback + # Deprecated, use `cash_amount`. + # + # @return [Integer, nil] + optional :cashback, Integer + + # @!attribute conversion_rate + # If the transaction was requested in a currency other than the settlement + # currency, this field will be populated to indicate the rate used to translate + # the merchant_amount to the amount (i.e., `merchant_amount` x `conversion_rate` = + # `amount`). Note that the `merchant_amount` is in the local currency and the + # amount is in the settlement currency. + # + # @return [Float, nil] + optional :conversion_rate, Float + + # @!attribute event_token + # The event token associated with the authorization. This field is only set for + # programs enrolled into the beta. + # + # @return [String, nil] + optional :event_token, String + + # @!attribute fleet_info + # Optional Object containing information if the Card is a part of a Fleet managed + # program + # + # @return [Lithic::Models::AsaRequestWebhookEvent::FleetInfo, nil] + optional :fleet_info, -> { Lithic::AsaRequestWebhookEvent::FleetInfo }, nil?: true + + # @!attribute latest_challenge + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + # + # @return [Lithic::Models::AsaRequestWebhookEvent::LatestChallenge, nil] + optional :latest_challenge, -> { Lithic::AsaRequestWebhookEvent::LatestChallenge } + + # @!attribute network + # Card network of the authorization. + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Network, nil] + optional :network, enum: -> { Lithic::AsaRequestWebhookEvent::Network } + + # @!attribute network_risk_score + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + # + # @return [Integer, nil] + optional :network_risk_score, Integer, nil?: true + + # @!attribute network_specific_data + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + # + # @return [Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData, nil] + optional :network_specific_data, -> { Lithic::AsaRequestWebhookEvent::NetworkSpecificData }, nil?: true + + # @!attribute pos + # + # @return [Lithic::Models::AsaRequestWebhookEvent::Pos, nil] + optional :pos, -> { Lithic::AsaRequestWebhookEvent::Pos } + + # @!attribute token_info + # + # @return [Lithic::Models::TokenInfo, nil] + optional :token_info, -> { Lithic::TokenInfo }, nil?: true + + # @!attribute ttl + # Deprecated: approximate time-to-live for the authorization. + # + # @return [Time, nil] + optional :ttl, Time + + # @!method initialize(token:, acquirer_fee:, amount:, authorization_amount:, avs:, card:, cardholder_currency:, cash_amount:, created:, merchant:, merchant_amount:, merchant_currency:, settled_amount:, status:, transaction_initiator:, account_type: nil, cardholder_authentication: nil, cashback: nil, conversion_rate: nil, event_token: nil, fleet_info: nil, latest_challenge: nil, network: nil, network_risk_score: nil, network_specific_data: nil, pos: nil, token_info: nil, ttl: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent} for more details. + # + # The Auth Stream Access request payload that was sent to the ASA responder. + # + # @param token [String] The provisional transaction group uuid associated with the authorization + # + # @param acquirer_fee [Integer] Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # + # @param amount [Integer] Authorization amount of the transaction (in cents), including any acquirer fees. + # + # @param authorization_amount [Integer] The base transaction amount (in cents) plus the acquirer fee field. This is the + # + # @param avs [Lithic::Models::AsaRequestWebhookEvent::Avs] + # + # @param card [Lithic::Models::AsaRequestWebhookEvent::Card] Card object in ASA + # + # @param cardholder_currency [String] 3-character alphabetic ISO 4217 code for cardholder's billing currency. + # + # @param cash_amount [Integer] The portion of the transaction requested as cash back by the cardholder, and doe + # + # @param created [Time] Date and time when the transaction first occurred in UTC. + # + # @param merchant [Lithic::Models::Merchant] + # + # @param merchant_amount [Integer] The amount that the merchant will receive, denominated in `merchant_currency` an + # + # @param merchant_currency [String] 3-character alphabetic ISO 4217 code for the local currency of the transaction. + # + # @param settled_amount [Integer] Amount (in cents) of the transaction that has been settled, including any acquir + # + # @param status [Symbol, Lithic::Models::AsaRequestWebhookEvent::Status] The type of authorization request that this request is for. Note that `CREDIT_AU + # + # @param transaction_initiator [Symbol, Lithic::Models::AsaRequestWebhookEvent::TransactionInitiator] The entity that initiated the transaction. + # + # @param account_type [Symbol, Lithic::Models::AsaRequestWebhookEvent::AccountType] + # + # @param cardholder_authentication [Lithic::Models::CardholderAuthentication] + # + # @param cashback [Integer] Deprecated, use `cash_amount`. + # + # @param conversion_rate [Float] If the transaction was requested in a currency other than the settlement currenc + # + # @param event_token [String] The event token associated with the authorization. This field is only set for pr + # + # @param fleet_info [Lithic::Models::AsaRequestWebhookEvent::FleetInfo, nil] Optional Object containing information if the Card is a part of a Fleet managed + # + # @param latest_challenge [Lithic::Models::AsaRequestWebhookEvent::LatestChallenge] The latest Authorization Challenge that was issued to the cardholder for this me + # + # @param network [Symbol, Lithic::Models::AsaRequestWebhookEvent::Network] Card network of the authorization. + # + # @param network_risk_score [Integer, nil] Network-provided score assessing risk level associated with a given authorizatio + # + # @param network_specific_data [Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData, nil] Contains raw data provided by the card network, including attributes that provid + # + # @param pos [Lithic::Models::AsaRequestWebhookEvent::Pos] + # + # @param token_info [Lithic::Models::TokenInfo, nil] + # + # @param ttl [Time] Deprecated: approximate time-to-live for the authorization. + + # @see Lithic::Models::AsaRequestWebhookEvent#avs + class Avs < Lithic::Internal::Type::BaseModel + # @!attribute address + # Cardholder address + # + # @return [String] + required :address, String + + # @!attribute address_on_file_match + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Avs::AddressOnFileMatch] + required :address_on_file_match, enum: -> { Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch } + + # @!attribute zipcode + # Cardholder ZIP code + # + # @return [String] + required :zipcode, String + + # @!method initialize(address:, address_on_file_match:, zipcode:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent::Avs} for more details. + # + # @param address [String] Cardholder address + # + # @param address_on_file_match [Symbol, Lithic::Models::AsaRequestWebhookEvent::Avs::AddressOnFileMatch] Lithic's evaluation result comparing the transaction's address data with the car + # + # @param zipcode [String] Cardholder ZIP code + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + # + # @see Lithic::Models::AsaRequestWebhookEvent::Avs#address_on_file_match + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + MATCH = :MATCH + MATCH_ADDRESS_ONLY = :MATCH_ADDRESS_ONLY + MATCH_ZIP_ONLY = :MATCH_ZIP_ONLY + MISMATCH = :MISMATCH + NOT_PRESENT = :NOT_PRESENT + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::AsaRequestWebhookEvent#card + class Card < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the card. + # + # @return [String, nil] + optional :token, String + + # @!attribute hostname + # Hostname of card’s locked merchant (will be empty if not applicable) + # + # @return [String, nil] + optional :hostname, String + + # @!attribute last_four + # Last four digits of the card number + # + # @return [String, nil] + optional :last_four, String + + # @!attribute memo + # Customizable name to identify the card. We recommend against using this field to + # store JSON data as it can cause unexpected behavior. + # + # @return [String, nil] + optional :memo, String + + # @!attribute spend_limit + # Amount (in cents) to limit approved authorizations. Purchase requests above the + # spend limit will be declined (refunds and credits will be approved). + # + # Note that while spend limits are enforced based on authorized and settled volume + # on a card, they are not recommended to be used for balance or + # reconciliation-level accuracy. Spend limits also cannot block force posted + # charges (i.e., when a merchant sends a clearing message without a prior + # authorization). + # + # @return [Integer, nil] + optional :spend_limit, Integer + + # @!attribute spend_limit_duration + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Card::SpendLimitDuration, nil] + optional :spend_limit_duration, enum: -> { Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration } + + # @!attribute state + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Card::State, nil] + optional :state, enum: -> { Lithic::AsaRequestWebhookEvent::Card::State } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Card::Type, nil] + optional :type, enum: -> { Lithic::AsaRequestWebhookEvent::Card::Type } + + # @!method initialize(token: nil, hostname: nil, last_four: nil, memo: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, type: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent::Card} for more details. + # + # Card object in ASA + # + # @param token [String] Globally unique identifier for the card. + # + # @param hostname [String] Hostname of card’s locked merchant (will be empty if not applicable) + # + # @param last_four [String] Last four digits of the card number + # + # @param memo [String] Customizable name to identify the card. We recommend against using this field to + # + # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations. Purchase requests above the + # + # @param spend_limit_duration [Symbol, Lithic::Models::AsaRequestWebhookEvent::Card::SpendLimitDuration] Note that to support recurring monthly payments, which can occur on different da + # + # @param state [Symbol, Lithic::Models::AsaRequestWebhookEvent::Card::State] + # + # @param type [Symbol, Lithic::Models::AsaRequestWebhookEvent::Card::Type] + + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + # + # @see Lithic::Models::AsaRequestWebhookEvent::Card#spend_limit_duration + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + ANNUALLY = :ANNUALLY + FOREVER = :FOREVER + MONTHLY = :MONTHLY + TRANSACTION = :TRANSACTION + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AsaRequestWebhookEvent::Card#state + module State + extend Lithic::Internal::Type::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + PENDING_ACTIVATION = :PENDING_ACTIVATION + PENDING_FULFILLMENT = :PENDING_FULFILLMENT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AsaRequestWebhookEvent::Card#type + module Type + extend Lithic::Internal::Type::Enum + + SINGLE_USE = :SINGLE_USE + MERCHANT_LOCKED = :MERCHANT_LOCKED + UNLOCKED = :UNLOCKED + PHYSICAL = :PHYSICAL + DIGITAL_WALLET = :DIGITAL_WALLET + VIRTUAL = :VIRTUAL + + # @!method self.values + # @return [Array] + end + end + + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + # + # @see Lithic::Models::AsaRequestWebhookEvent#status + module Status + extend Lithic::Internal::Type::Enum + + AUTHORIZATION = :AUTHORIZATION + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + BALANCE_INQUIRY = :BALANCE_INQUIRY + + # @!method self.values + # @return [Array] + end + + # The entity that initiated the transaction. + # + # @see Lithic::Models::AsaRequestWebhookEvent#transaction_initiator + module TransactionInitiator + extend Lithic::Internal::Type::Enum + + CARDHOLDER = :CARDHOLDER + MERCHANT = :MERCHANT + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AsaRequestWebhookEvent#account_type + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AsaRequestWebhookEvent#fleet_info + class FleetInfo < Lithic::Internal::Type::BaseModel + # @!attribute fleet_prompt_code + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode] + required :fleet_prompt_code, enum: -> { Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode } + + # @!attribute fleet_restriction_code + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode] + required :fleet_restriction_code, + enum: -> { Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode } + + # @!attribute driver_number + # Number representing the driver + # + # @return [String, nil] + optional :driver_number, String, nil?: true + + # @!attribute vehicle_number + # Number associated with the vehicle + # + # @return [String, nil] + optional :vehicle_number, String, nil?: true + + # @!method initialize(fleet_prompt_code:, fleet_restriction_code:, driver_number: nil, vehicle_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent::FleetInfo} for more details. + # + # Optional Object containing information if the Card is a part of a Fleet managed + # program + # + # @param fleet_prompt_code [Symbol, Lithic::Models::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode] Code indicating what the driver was prompted to enter at time of purchase. This + # + # @param fleet_restriction_code [Symbol, Lithic::Models::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode] Code indicating which restrictions, if any, there are on purchase. This is confi + # + # @param driver_number [String, nil] Number representing the driver + # + # @param vehicle_number [String, nil] Number associated with the vehicle + + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + # + # @see Lithic::Models::AsaRequestWebhookEvent::FleetInfo#fleet_prompt_code + module FleetPromptCode + extend Lithic::Internal::Type::Enum + + NO_PROMPT = :NO_PROMPT + VEHICLE_NUMBER = :VEHICLE_NUMBER + DRIVER_NUMBER = :DRIVER_NUMBER + + # @!method self.values + # @return [Array] + end + + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + # + # @see Lithic::Models::AsaRequestWebhookEvent::FleetInfo#fleet_restriction_code + module FleetRestrictionCode + extend Lithic::Internal::Type::Enum + + NO_RESTRICTIONS = :NO_RESTRICTIONS + FUEL_ONLY = :FUEL_ONLY + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::AsaRequestWebhookEvent#latest_challenge + class LatestChallenge < Lithic::Internal::Type::BaseModel + # @!attribute phone_number + # The phone number used for sending Authorization Challenge SMS. + # + # @return [String] + required :phone_number, String + + # @!attribute status + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::LatestChallenge::Status] + required :status, enum: -> { Lithic::AsaRequestWebhookEvent::LatestChallenge::Status } + + # @!attribute completed_at + # The date and time when the Authorization Challenge was completed in UTC. Present + # only if the status is `COMPLETED`. + # + # @return [Time, nil] + optional :completed_at, Time + + # @!method initialize(phone_number:, status:, completed_at: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent::LatestChallenge} for more details. + # + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + # + # @param phone_number [String] The phone number used for sending Authorization Challenge SMS. + # + # @param status [Symbol, Lithic::Models::AsaRequestWebhookEvent::LatestChallenge::Status] The status of the Authorization Challenge + # + # @param completed_at [Time] The date and time when the Authorization Challenge was completed in UTC. Present + + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + # + # @see Lithic::Models::AsaRequestWebhookEvent::LatestChallenge#status + module Status + extend Lithic::Internal::Type::Enum + + COMPLETED = :COMPLETED + PENDING = :PENDING + EXPIRED = :EXPIRED + ERROR = :ERROR + + # @!method self.values + # @return [Array] + end + end + + # Card network of the authorization. + # + # @see Lithic::Models::AsaRequestWebhookEvent#network + module Network + extend Lithic::Internal::Type::Enum + + AMEX = :AMEX + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AsaRequestWebhookEvent#network_specific_data + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + # @!attribute mastercard + # + # @return [Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard, nil] + optional :mastercard, + -> { + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard + }, + nil?: true + + # @!attribute visa + # + # @return [Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData::Visa, nil] + optional :visa, -> { Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa }, nil?: true + + # @!method initialize(mastercard: nil, visa: nil) + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + # + # @param mastercard [Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard, nil] + # @param visa [Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData::Visa, nil] + + # @see Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData#mastercard + class Mastercard < Lithic::Internal::Type::BaseModel + # @!attribute ecommerce_security_level_indicator + # Indicates the electronic commerce security level and UCAF collection. + # + # @return [String, nil] + optional :ecommerce_security_level_indicator, String, nil?: true + + # @!attribute on_behalf_service_result + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + # + # @return [Array, nil] + optional :on_behalf_service_result, + -> { + Lithic::Internal::Type::ArrayOf[Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult] + }, + nil?: true + + # @!attribute transaction_type_identifier + # Indicates the type of additional transaction purpose. + # + # @return [String, nil] + optional :transaction_type_identifier, String, nil?: true + + # @!method initialize(ecommerce_security_level_indicator: nil, on_behalf_service_result: nil, transaction_type_identifier: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard} for + # more details. + # + # @param ecommerce_security_level_indicator [String, nil] Indicates the electronic commerce security level and UCAF collection. + # + # @param on_behalf_service_result [Array, nil] The On-behalf Service performed on the transaction and the results. Contains all + # + # @param transaction_type_identifier [String, nil] Indicates the type of additional transaction purpose. + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + # @!attribute result_1 + # Indicates the results of the service processing. + # + # @return [String] + required :result_1, String + + # @!attribute result_2 + # Identifies the results of the service processing. + # + # @return [String] + required :result_2, String + + # @!attribute service + # Indicates the service performed on the transaction. + # + # @return [String] + required :service, String + + # @!method initialize(result_1:, result_2:, service:) + # @param result_1 [String] Indicates the results of the service processing. + # + # @param result_2 [String] Identifies the results of the service processing. + # + # @param service [String] Indicates the service performed on the transaction. + end + end + + # @see Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData#visa + class Visa < Lithic::Internal::Type::BaseModel + # @!attribute business_application_identifier + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + # + # @return [String, nil] + optional :business_application_identifier, String, nil?: true + + # @!method initialize(business_application_identifier: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent::NetworkSpecificData::Visa} for more + # details. + # + # @param business_application_identifier [String, nil] Identifies the purpose or category of a transaction, used to classify and proces + end + end + + # @see Lithic::Models::AsaRequestWebhookEvent#pos + class Pos < Lithic::Internal::Type::BaseModel + # @!attribute entry_mode + # POS > Entry Mode object in ASA + # + # @return [Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode, nil] + optional :entry_mode, -> { Lithic::AsaRequestWebhookEvent::Pos::EntryMode } + + # @!attribute terminal + # + # @return [Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal, nil] + optional :terminal, -> { Lithic::AsaRequestWebhookEvent::Pos::Terminal } + + # @!method initialize(entry_mode: nil, terminal: nil) + # @param entry_mode [Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode] POS > Entry Mode object in ASA + # + # @param terminal [Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal] + + # @see Lithic::Models::AsaRequestWebhookEvent::Pos#entry_mode + class EntryMode < Lithic::Internal::Type::BaseModel + # @!attribute card + # Card Presence Indicator + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::Card, nil] + optional :card, enum: -> { Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card } + + # @!attribute cardholder + # Cardholder Presence Indicator + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder, nil] + optional :cardholder, enum: -> { Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder } + + # @!attribute pan + # Method of entry for the PAN + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::Pan, nil] + optional :pan, enum: -> { Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan } + + # @!attribute pin_entered + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + # + # @return [Boolean, nil] + optional :pin_entered, Lithic::Internal::Type::Boolean + + # @!method initialize(card: nil, cardholder: nil, pan: nil, pin_entered: nil) + # POS > Entry Mode object in ASA + # + # @param card [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::Card] Card Presence Indicator + # + # @param cardholder [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder] Cardholder Presence Indicator + # + # @param pan [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::Pan] Method of entry for the PAN + # + # @param pin_entered [Boolean] Indicates whether the cardholder entered the PIN. True if the PIN was entered. + + # Card Presence Indicator + # + # @see Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode#card + module Card + extend Lithic::Internal::Type::Enum + + PRESENT = :PRESENT + NOT_PRESENT = :NOT_PRESENT + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Cardholder Presence Indicator + # + # @see Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode#cardholder + module Cardholder + extend Lithic::Internal::Type::Enum + + DEFERRED_BILLING = :DEFERRED_BILLING + ELECTRONIC_ORDER = :ELECTRONIC_ORDER + INSTALLMENT = :INSTALLMENT + MAIL_ORDER = :MAIL_ORDER + NOT_PRESENT = :NOT_PRESENT + PRESENT = :PRESENT + REOCCURRING = :REOCCURRING + TELEPHONE_ORDER = :TELEPHONE_ORDER + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Method of entry for the PAN + # + # @see Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode#pan + module Pan + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY = :AUTO_ENTRY + BAR_CODE = :BAR_CODE + CONTACTLESS = :CONTACTLESS + ECOMMERCE = :ECOMMERCE + ERROR_KEYED = :ERROR_KEYED + ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE + ICC = :ICC + KEY_ENTERED = :KEY_ENTERED + MAGNETIC_STRIPE = :MAGNETIC_STRIPE + MANUAL = :MANUAL + OCR = :OCR + SECURE_CARDLESS = :SECURE_CARDLESS + UNSPECIFIED = :UNSPECIFIED + UNKNOWN = :UNKNOWN + CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::AsaRequestWebhookEvent::Pos#terminal + class Terminal < Lithic::Internal::Type::BaseModel + # @!attribute attended + # True if a clerk is present at the sale. + # + # @return [Boolean] + required :attended, Lithic::Internal::Type::Boolean + + # @!attribute card_retention_capable + # True if the terminal is capable of retaining the card. + # + # @return [Boolean] + required :card_retention_capable, Lithic::Internal::Type::Boolean + + # @!attribute on_premise + # True if the sale was made at the place of business (vs. mobile). + # + # @return [Boolean] + required :on_premise, Lithic::Internal::Type::Boolean + + # @!attribute operator + # The person that is designated to swipe the card + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::Operator] + required :operator, enum: -> { Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator } + + # @!attribute partial_approval_capable + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + # + # @return [Boolean] + required :partial_approval_capable, Lithic::Internal::Type::Boolean + + # @!attribute pin_capability + # Status of whether the POS is able to accept PINs + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::PinCapability] + required :pin_capability, enum: -> { Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability } + + # @!attribute type + # POS Type + # + # @return [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::Type] + required :type, enum: -> { Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type } + + # @!attribute acceptor_terminal_id + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems. Left justified with trailing spaces. + # + # @return [String, nil] + optional :acceptor_terminal_id, String, nil?: true + + # @!method initialize(attended:, card_retention_capable:, on_premise:, operator:, partial_approval_capable:, pin_capability:, type:, acceptor_terminal_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal} for more details. + # + # @param attended [Boolean] True if a clerk is present at the sale. + # + # @param card_retention_capable [Boolean] True if the terminal is capable of retaining the card. + # + # @param on_premise [Boolean] True if the sale was made at the place of business (vs. mobile). + # + # @param operator [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::Operator] The person that is designated to swipe the card + # + # @param partial_approval_capable [Boolean] True if the terminal is capable of partial approval. Partial approval is when pa + # + # @param pin_capability [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::PinCapability] Status of whether the POS is able to accept PINs + # + # @param type [Symbol, Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::Type] POS Type + # + # @param acceptor_terminal_id [String, nil] Uniquely identifies a terminal at the card acceptor location of acquiring instit + + # The person that is designated to swipe the card + # + # @see Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal#operator + module Operator + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + CARDHOLDER = :CARDHOLDER + CARD_ACCEPTOR = :CARD_ACCEPTOR + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Status of whether the POS is able to accept PINs + # + # @see Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal#pin_capability + module PinCapability + extend Lithic::Internal::Type::Enum + + CAPABLE = :CAPABLE + INOPERATIVE = :INOPERATIVE + NOT_CAPABLE = :NOT_CAPABLE + UNSPECIFIED = :UNSPECIFIED + + # @!method self.values + # @return [Array] + end + + # POS Type + # + # @see Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal#type + module Type + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + ATM = :ATM + AUTHORIZATION = :AUTHORIZATION + COUPON_MACHINE = :COUPON_MACHINE + DIAL_TERMINAL = :DIAL_TERMINAL + ECOMMERCE = :ECOMMERCE + ECR = :ECR + FUEL_MACHINE = :FUEL_MACHINE + HOME_TERMINAL = :HOME_TERMINAL + MICR = :MICR + OFF_PREMISE = :OFF_PREMISE + PAYMENT = :PAYMENT + PDA = :PDA + PHONE = :PHONE + POINT = :POINT + POS_TERMINAL = :POS_TERMINAL + PUBLIC_UTILITY = :PUBLIC_UTILITY + SELF_SERVICE = :SELF_SERVICE + TELEVISION = :TELEVISION + TELLER = :TELLER + TRAVELERS_CHECK_MACHINE = :TRAVELERS_CHECK_MACHINE + VENDING = :VENDING + VOICE = :VOICE + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules_backtest_report_created_webhook_event.rb b/lib/lithic/models/auth_rules_backtest_report_created_webhook_event.rb new file mode 100644 index 00000000..7d203e6e --- /dev/null +++ b/lib/lithic/models/auth_rules_backtest_report_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AuthRulesBacktestReportCreatedWebhookEvent < Lithic::Models::AuthRules::V2::BacktestResults + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"auth_rules.backtest_report.created"] + required :event_type, const: :"auth_rules.backtest_report.created" + + # @!method initialize(event_type: :"auth_rules.backtest_report.created") + # @param event_type [Symbol, :"auth_rules.backtest_report.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/balance_updated_webhook_event.rb b/lib/lithic/models/balance_updated_webhook_event.rb new file mode 100644 index 00000000..b6ad7255 --- /dev/null +++ b/lib/lithic/models/balance_updated_webhook_event.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BalanceUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialAccountBalance] } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"balance.updated"] + required :event_type, const: :"balance.updated" + + # @!method initialize(data:, event_type: :"balance.updated") + # @param data [Array] + # + # @param event_type [Symbol, :"balance.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/book_transfer_transaction_created_webhook_event.rb b/lib/lithic/models/book_transfer_transaction_created_webhook_event.rb new file mode 100644 index 00000000..09b7bf67 --- /dev/null +++ b/lib/lithic/models/book_transfer_transaction_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferTransactionCreatedWebhookEvent < Lithic::Models::BookTransferResponse + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"book_transfer_transaction.created"] + required :event_type, const: :"book_transfer_transaction.created" + + # @!method initialize(event_type: :"book_transfer_transaction.created") + # Book transfer transaction + # + # @param event_type [Symbol, :"book_transfer_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/book_transfer_transaction_updated_webhook_event.rb b/lib/lithic/models/book_transfer_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..2e51f986 --- /dev/null +++ b/lib/lithic/models/book_transfer_transaction_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferTransactionUpdatedWebhookEvent < Lithic::Models::BookTransferResponse + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"book_transfer_transaction.updated"] + required :event_type, const: :"book_transfer_transaction.updated" + + # @!method initialize(event_type: :"book_transfer_transaction.updated") + # Book transfer transaction + # + # @param event_type [Symbol, :"book_transfer_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_converted_webhook_event.rb b/lib/lithic/models/card_converted_webhook_event.rb new file mode 100644 index 00000000..4aca6451 --- /dev/null +++ b/lib/lithic/models/card_converted_webhook_event.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardConvertedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card that was created. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.converted"] + required :event_type, const: :"card.converted" + + # @!method initialize(card_token:, event_type: :"card.converted") + # @param card_token [String] The token of the card that was created. + # + # @param event_type [Symbol, :"card.converted"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_created_webhook_event.rb b/lib/lithic/models/card_created_webhook_event.rb new file mode 100644 index 00000000..485bb488 --- /dev/null +++ b/lib/lithic/models/card_created_webhook_event.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card that was created. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.created"] + required :event_type, const: :"card.created" + + # @!attribute replacement_for + # The token of the card that was replaced, if the new card is a replacement card. + # + # @return [String, nil] + optional :replacement_for, String, nil?: true + + # @!method initialize(card_token:, replacement_for: nil, event_type: :"card.created") + # @param card_token [String] The token of the card that was created. + # + # @param replacement_for [String, nil] The token of the card that was replaced, if the new card is a replacement card. + # + # @param event_type [Symbol, :"card.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_reissued_webhook_event.rb b/lib/lithic/models/card_reissued_webhook_event.rb new file mode 100644 index 00000000..278c751e --- /dev/null +++ b/lib/lithic/models/card_reissued_webhook_event.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardReissuedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.reissued"] + required :event_type, const: :"card.reissued" + + # @!attribute card_token + # The token of the card that was reissued. + # + # @return [String, nil] + optional :card_token, String + + # @!method initialize(card_token: nil, event_type: :"card.reissued") + # @param card_token [String] The token of the card that was reissued. + # + # @param event_type [Symbol, :"card.reissued"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_renewed_webhook_event.rb b/lib/lithic/models/card_renewed_webhook_event.rb new file mode 100644 index 00000000..786ab5e5 --- /dev/null +++ b/lib/lithic/models/card_renewed_webhook_event.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardRenewedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.renewed"] + required :event_type, const: :"card.renewed" + + # @!attribute card_token + # The token of the card that was renewed. + # + # @return [String, nil] + optional :card_token, String + + # @!attribute exp_month + # The new expiration month of the card. + # + # @return [String, nil] + optional :exp_month, String + + # @!attribute exp_year + # The new expiration year of the card. + # + # @return [String, nil] + optional :exp_year, String + + # @!attribute previous_exp_month + # The previous expiration month of the card. + # + # @return [String, nil] + optional :previous_exp_month, String + + # @!attribute previous_exp_year + # The previous expiration year of the card. + # + # @return [String, nil] + optional :previous_exp_year, String + + # @!method initialize(card_token: nil, exp_month: nil, exp_year: nil, previous_exp_month: nil, previous_exp_year: nil, event_type: :"card.renewed") + # @param card_token [String] The token of the card that was renewed. + # + # @param exp_month [String] The new expiration month of the card. + # + # @param exp_year [String] The new expiration year of the card. + # + # @param previous_exp_month [String] The previous expiration month of the card. + # + # @param previous_exp_year [String] The previous expiration year of the card. + # + # @param event_type [Symbol, :"card.renewed"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_shipped_webhook_event.rb b/lib/lithic/models/card_shipped_webhook_event.rb new file mode 100644 index 00000000..197c09e4 --- /dev/null +++ b/lib/lithic/models/card_shipped_webhook_event.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardShippedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute bulk_order_token + # The token of the bulk order associated with this card shipment, if applicable. + # + # @return [String, nil] + required :bulk_order_token, String, nil?: true + + # @!attribute card_token + # The token of the card that was shipped. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.shipped"] + required :event_type, const: :"card.shipped" + + # @!attribute shipping_method + # The specific shipping method used to ship the card. + # + # @return [Symbol, Lithic::Models::CardShippedWebhookEvent::ShippingMethod] + required :shipping_method, enum: -> { Lithic::CardShippedWebhookEvent::ShippingMethod } + + # @!attribute tracking_number + # The tracking number of the shipment. + # + # @return [String, nil] + required :tracking_number, String, nil?: true + + # @!method initialize(bulk_order_token:, card_token:, shipping_method:, tracking_number:, event_type: :"card.shipped") + # @param bulk_order_token [String, nil] The token of the bulk order associated with this card shipment, if applicable. + # + # @param card_token [String] The token of the card that was shipped. + # + # @param shipping_method [Symbol, Lithic::Models::CardShippedWebhookEvent::ShippingMethod] The specific shipping method used to ship the card. + # + # @param tracking_number [String, nil] The tracking number of the shipment. + # + # @param event_type [Symbol, :"card.shipped"] The type of event that occurred. + + # The specific shipping method used to ship the card. + # + # @see Lithic::Models::CardShippedWebhookEvent#shipping_method + module ShippingMethod + extend Lithic::Internal::Type::Enum + + EX_US_EXPEDITED_WITH_TRACKING = :"Ex-US expedited with tracking" + EX_US_STANDARD_WITH_TRACKING = :"Ex-US standard with tracking" + EX_US_STANDARD_WITHOUT_TRACKING = :"Ex-US standard without tracking" + FED_EX_2_DAYS = :"FedEx 2 days" + FED_EX_EXPRESS = :"FedEx express" + FED_EX_OVERNIGHT = :"FedEx overnight" + USPS_PRIORITY = :"USPS priority" + USPS_WITH_TRACKING = :"USPS with tracking" + USPS_WITHOUT_TRACKING_ENVELOPE = :"USPS without tracking envelope" + USPS_WITHOUT_TRACKING_ENVELOPE_NON_MACHINE = :"USPS without tracking envelope non-machine" + USPS_WITHOUT_TRACKING_FLAT = :"USPS without tracking flat" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_transaction_enhanced_data_created_webhook_event.rb b/lib/lithic/models/card_transaction_enhanced_data_created_webhook_event.rb new file mode 100644 index 00000000..ecba5563 --- /dev/null +++ b/lib/lithic/models/card_transaction_enhanced_data_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardTransactionEnhancedDataCreatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card_transaction.enhanced_data.created"] + required :event_type, const: :"card_transaction.enhanced_data.created" + + # @!method initialize(event_type: :"card_transaction.enhanced_data.created") + # @param event_type [Symbol, :"card_transaction.enhanced_data.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rb b/lib/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rb new file mode 100644 index 00000000..9ae7c516 --- /dev/null +++ b/lib/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardTransactionEnhancedDataUpdatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card_transaction.enhanced_data.updated"] + required :event_type, const: :"card_transaction.enhanced_data.updated" + + # @!method initialize(event_type: :"card_transaction.enhanced_data.updated") + # @param event_type [Symbol, :"card_transaction.enhanced_data.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_transaction_updated_webhook_event.rb b/lib/lithic/models/card_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..77b6a66b --- /dev/null +++ b/lib/lithic/models/card_transaction_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardTransactionUpdatedWebhookEvent < Lithic::Models::Transaction + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card_transaction.updated"] + required :event_type, const: :"card_transaction.updated" + + # @!method initialize(event_type: :"card_transaction.updated") + # @param event_type [Symbol, :"card_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb new file mode 100644 index 00000000..18426c38 --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute customer_tokenization_decision + # Contains the metadata for the customer tokenization decision. + # + # @return [Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] + required :customer_tokenization_decision, + -> { + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + }, + nil?: true + + # @!attribute event_type + # The name of this event + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType] + required :event_type, enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType } + + # @!attribute issuer_decision + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision] + required :issuer_decision, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision } + + # @!attribute tokenization_channel + # The channel through which the tokenization was made. + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel] + required :tokenization_channel, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel } + + # @!attribute tokenization_token + # Unique identifier for the digital wallet token attempt + # + # @return [String] + required :tokenization_token, String + + # @!attribute wallet_decisioning_info + # + # @return [Lithic::Models::WalletDecisioningInfo] + required :wallet_decisioning_info, -> { Lithic::WalletDecisioningInfo } + + # @!attribute device + # + # @return [Lithic::Models::Device, nil] + optional :device, -> { Lithic::Device } + + # @!attribute digital_wallet_token_metadata + # Contains the metadata for the digital wallet being tokenized. + # + # @return [Lithic::Models::DigitalWalletTokenMetadata, nil] + optional :digital_wallet_token_metadata, -> { Lithic::DigitalWalletTokenMetadata } + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array, nil] + optional :tokenization_decline_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationDeclineReason] } + + # @!attribute tokenization_source + # The source of the tokenization. + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource, nil] + optional :tokenization_source, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource } + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!method initialize(account_token:, card_token:, created:, customer_tokenization_decision:, event_type:, issuer_decision:, tokenization_channel:, tokenization_token:, wallet_decisioning_info:, device: nil, digital_wallet_token_metadata: nil, rule_results: nil, tokenization_decline_reasons: nil, tokenization_source: nil, tokenization_tfa_reasons: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent} for more + # details. + # + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param customer_tokenization_decision [Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] Contains the metadata for the customer tokenization decision. + # + # @param event_type [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType] The name of this event + # + # @param issuer_decision [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision] Whether Lithic decisioned on the token, and if so, what the decision was. APPROV + # + # @param tokenization_channel [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel] The channel through which the tokenization was made. + # + # @param tokenization_token [String] Unique identifier for the digital wallet token attempt + # + # @param wallet_decisioning_info [Lithic::Models::WalletDecisioningInfo] + # + # @param device [Lithic::Models::Device] + # + # @param digital_wallet_token_metadata [Lithic::Models::DigitalWalletTokenMetadata] Contains the metadata for the digital wallet being tokenized. + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param tokenization_source [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource] The source of the tokenization. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#customer_tokenization_decision + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + # @!attribute outcome + # The outcome of the customer's decision + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] + required :outcome, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome } + + # @!attribute responder_url + # The customer's subscribed URL + # + # @return [String] + required :responder_url, String + + # @!attribute latency + # Time in ms it took for the customer's URL to respond + # + # @return [String, nil] + optional :latency, String + + # @!attribute response_code + # The response code that the customer provided + # + # @return [String, nil] + optional :response_code, String + + # @!method initialize(outcome:, responder_url:, latency: nil, response_code: nil) + # Contains the metadata for the customer tokenization decision. + # + # @param outcome [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] The outcome of the customer's decision + # + # @param responder_url [String] The customer's subscribed URL + # + # @param latency [String] Time in ms it took for the customer's URL to respond + # + # @param response_code [String] The response code that the customer provided + + # The outcome of the customer's decision + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision#outcome + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + ERROR = :ERROR + INVALID_RESPONSE = :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT = :TIMEOUT + + # @!method self.values + # @return [Array] + end + end + + # The name of this event + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#event_type + module EventType + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + + # @!method self.values + # @return [Array] + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#issuer_decision + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DENIED = :DENIED + VERIFICATION_REQUIRED = :VERIFICATION_REQUIRED + + # @!method self.values + # @return [Array] + end + + # The channel through which the tokenization was made. + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#tokenization_channel + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + + # @!method self.values + # @return [Array] + end + + # The source of the tokenization. + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#tokenization_source + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE = :ACCOUNT_ON_FILE + CONTACTLESS_TAP = :CONTACTLESS_TAP + MANUAL_PROVISION = :MANUAL_PROVISION + PUSH_PROVISION = :PUSH_PROVISION + TOKEN = :TOKEN + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_result_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_result_webhook_event.rb new file mode 100644 index 00000000..9b6f621a --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_result_webhook_event.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_result"] + required :event_type, const: :"digital_wallet.tokenization_result" + + # @!attribute tokenization_result_details + # The result of the tokenization request. + # + # @return [Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails] + required :tokenization_result_details, + -> { Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails } + + # @!attribute tokenization_token + # Tokenization token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, card_token:, created:, tokenization_result_details:, tokenization_token:, event_type: :"digital_wallet.tokenization_result") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization_result_details [Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails] The result of the tokenization request. + # + # @param tokenization_token [String] Tokenization token + # + # @param event_type [Symbol, :"digital_wallet.tokenization_result"] The type of event that occurred. + + # @see Lithic::Models::DigitalWalletTokenizationResultWebhookEvent#tokenization_result_details + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + # @!attribute issuer_decision + # Lithic's tokenization decision. + # + # @return [String] + required :issuer_decision, String + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array] + required :tokenization_decline_reasons, + -> do + Lithic::Internal::Type::ArrayOf[ + enum: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason + ] + end + + # @!attribute customer_decision + # The customer's tokenization decision if applicable. + # + # @return [String, nil] + optional :customer_decision, String, nil?: true + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute token_activated_date_time + # An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @return [Time, nil] + optional :token_activated_date_time, Time, nil?: true + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!attribute wallet_decision + # The wallet's recommended decision. + # + # @return [String, nil] + optional :wallet_decision, String, nil?: true + + # @!method initialize(issuer_decision:, tokenization_decline_reasons:, customer_decision: nil, rule_results: nil, token_activated_date_time: nil, tokenization_tfa_reasons: nil, wallet_decision: nil) + # The result of the tokenization request. + # + # @param issuer_decision [String] Lithic's tokenization decision. + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param customer_decision [String, nil] The customer's tokenization decision if applicable. + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param token_activated_date_time [Time, nil] An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + # + # @param wallet_decision [String, nil] The wallet's recommended decision. + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + CVC_MISMATCH = :CVC_MISMATCH + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + GENERIC_DECLINE = :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rb new file mode 100644 index 00000000..287fdeab --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod } + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code_sent"] + required :event_type, const: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, card_token:, created:, tokenization_token:, event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code_sent"] The type of event that occurred. + + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location to which the authentication code was sent. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rb new file mode 100644 index 00000000..3b354398 --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod } + + # @!attribute authentication_code + # Authentication code to provide to the user tokenizing a card. + # + # @return [String] + required :authentication_code, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code"] + required :event_type, const: :"digital_wallet.tokenization_two_factor_authentication_code" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, authentication_code:, card_token:, created:, tokenization_token:, event_type: :"digital_wallet.tokenization_two_factor_authentication_code") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + # + # @param authentication_code [String] Authentication code to provide to the user tokenizing a card. + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code"] The type of event that occurred. + + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location where the user wants to receive the authentication code. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_updated_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_updated_webhook_event.rb new file mode 100644 index 00000000..869e9d2a --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_updated_webhook_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_updated"] + required :event_type, const: :"digital_wallet.tokenization_updated" + + # @!attribute tokenization + # + # @return [Lithic::Models::Tokenization] + required :tokenization, -> { Lithic::Tokenization } + + # @!method initialize(account_token:, card_token:, created:, tokenization:, event_type: :"digital_wallet.tokenization_updated") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization [Lithic::Models::Tokenization] + # + # @param event_type [Symbol, :"digital_wallet.tokenization_updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_evidence_upload_failed_webhook_event.rb b/lib/lithic/models/dispute_evidence_upload_failed_webhook_event.rb new file mode 100644 index 00000000..bf9f5ec4 --- /dev/null +++ b/lib/lithic/models/dispute_evidence_upload_failed_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeEvidenceUploadFailedWebhookEvent < Lithic::Models::DisputeEvidence + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute_evidence.upload_failed"] + required :event_type, const: :"dispute_evidence.upload_failed" + + # @!method initialize(event_type: :"dispute_evidence.upload_failed") + # Dispute evidence. + # + # @param event_type [Symbol, :"dispute_evidence.upload_failed"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_transaction_created_webhook_event.rb b/lib/lithic/models/dispute_transaction_created_webhook_event.rb new file mode 100644 index 00000000..b04fdb6b --- /dev/null +++ b/lib/lithic/models/dispute_transaction_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeTransactionCreatedWebhookEvent < Lithic::Models::DisputeV2 + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute_transaction.created"] + required :event_type, const: :"dispute_transaction.created" + + # @!method initialize(event_type: :"dispute_transaction.created") + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + # + # @param event_type [Symbol, :"dispute_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_transaction_updated_webhook_event.rb b/lib/lithic/models/dispute_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..d08ddb0d --- /dev/null +++ b/lib/lithic/models/dispute_transaction_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeTransactionUpdatedWebhookEvent < Lithic::Models::DisputeV2 + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute_transaction.updated"] + required :event_type, const: :"dispute_transaction.updated" + + # @!method initialize(event_type: :"dispute_transaction.updated") + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + # + # @param event_type [Symbol, :"dispute_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_updated_webhook_event.rb b/lib/lithic/models/dispute_updated_webhook_event.rb new file mode 100644 index 00000000..68d7a869 --- /dev/null +++ b/lib/lithic/models/dispute_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeUpdatedWebhookEvent < Lithic::Models::Dispute + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute.updated"] + required :event_type, const: :"dispute.updated" + + # @!method initialize(event_type: :"dispute.updated") + # Dispute. + # + # @param event_type [Symbol, :"dispute.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_bank_account_created_webhook_event.rb b/lib/lithic/models/external_bank_account_created_webhook_event.rb new file mode 100644 index 00000000..61680c3c --- /dev/null +++ b/lib/lithic/models/external_bank_account_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountCreatedWebhookEvent < Lithic::Models::ExternalBankAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_bank_account.created"] + required :event_type, const: :"external_bank_account.created" + + # @!method initialize(event_type: :"external_bank_account.created") + # @param event_type [Symbol, :"external_bank_account.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_bank_account_updated_webhook_event.rb b/lib/lithic/models/external_bank_account_updated_webhook_event.rb new file mode 100644 index 00000000..19869a90 --- /dev/null +++ b/lib/lithic/models/external_bank_account_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountUpdatedWebhookEvent < Lithic::Models::ExternalBankAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_bank_account.updated"] + required :event_type, const: :"external_bank_account.updated" + + # @!method initialize(event_type: :"external_bank_account.updated") + # @param event_type [Symbol, :"external_bank_account.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_payment_created_webhook_event.rb b/lib/lithic/models/external_payment_created_webhook_event.rb new file mode 100644 index 00000000..41fd4bf2 --- /dev/null +++ b/lib/lithic/models/external_payment_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentCreatedWebhookEvent < Lithic::Models::ExternalPayment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_payment.created"] + required :event_type, const: :"external_payment.created" + + # @!method initialize(event_type: :"external_payment.created") + # @param event_type [Symbol, :"external_payment.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_payment_updated_webhook_event.rb b/lib/lithic/models/external_payment_updated_webhook_event.rb new file mode 100644 index 00000000..20523f81 --- /dev/null +++ b/lib/lithic/models/external_payment_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentUpdatedWebhookEvent < Lithic::Models::ExternalPayment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_payment.updated"] + required :event_type, const: :"external_payment.updated" + + # @!method initialize(event_type: :"external_payment.updated") + # @param event_type [Symbol, :"external_payment.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/financial_account_created_webhook_event.rb b/lib/lithic/models/financial_account_created_webhook_event.rb new file mode 100644 index 00000000..f412434b --- /dev/null +++ b/lib/lithic/models/financial_account_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountCreatedWebhookEvent < Lithic::Models::FinancialAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"financial_account.created"] + required :event_type, const: :"financial_account.created" + + # @!method initialize(event_type: :"financial_account.created") + # @param event_type [Symbol, :"financial_account.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/financial_account_updated_webhook_event.rb b/lib/lithic/models/financial_account_updated_webhook_event.rb new file mode 100644 index 00000000..eaf7b969 --- /dev/null +++ b/lib/lithic/models/financial_account_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountUpdatedWebhookEvent < Lithic::Models::FinancialAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"financial_account.updated"] + required :event_type, const: :"financial_account.updated" + + # @!method initialize(event_type: :"financial_account.updated") + # @param event_type [Symbol, :"financial_account.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/funding_event_created_webhook_event.rb b/lib/lithic/models/funding_event_created_webhook_event.rb new file mode 100644 index 00000000..1d93ba78 --- /dev/null +++ b/lib/lithic/models/funding_event_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FundingEventCreatedWebhookEvent < Lithic::Models::FundingEvent + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"funding_event.created"] + required :event_type, const: :"funding_event.created" + + # @!method initialize(event_type: :"funding_event.created") + # @param event_type [Symbol, :"funding_event.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/internal_transaction_created_webhook_event.rb b/lib/lithic/models/internal_transaction_created_webhook_event.rb new file mode 100644 index 00000000..0bcd7399 --- /dev/null +++ b/lib/lithic/models/internal_transaction_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class InternalTransactionCreatedWebhookEvent < Lithic::Models::InternalTransactionAPI + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"internal_transaction.created"] + required :event_type, const: :"internal_transaction.created" + + # @!method initialize(event_type: :"internal_transaction.created") + # @param event_type [Symbol, :"internal_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/internal_transaction_updated_webhook_event.rb b/lib/lithic/models/internal_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..ba3993be --- /dev/null +++ b/lib/lithic/models/internal_transaction_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class InternalTransactionUpdatedWebhookEvent < Lithic::Models::InternalTransactionAPI + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"internal_transaction.updated"] + required :event_type, const: :"internal_transaction.updated" + + # @!method initialize(event_type: :"internal_transaction.updated") + # @param event_type [Symbol, :"internal_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/loan_tape_created_webhook_event.rb b/lib/lithic/models/loan_tape_created_webhook_event.rb new file mode 100644 index 00000000..e24138c4 --- /dev/null +++ b/lib/lithic/models/loan_tape_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class LoanTapeCreatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"loan_tape.created"] + required :event_type, const: :"loan_tape.created" + + # @!method initialize(event_type: :"loan_tape.created") + # @param event_type [Symbol, :"loan_tape.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/loan_tape_updated_webhook_event.rb b/lib/lithic/models/loan_tape_updated_webhook_event.rb new file mode 100644 index 00000000..6ff06c20 --- /dev/null +++ b/lib/lithic/models/loan_tape_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class LoanTapeUpdatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"loan_tape.updated"] + required :event_type, const: :"loan_tape.updated" + + # @!method initialize(event_type: :"loan_tape.updated") + # @param event_type [Symbol, :"loan_tape.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/management_operation_created_webhook_event.rb b/lib/lithic/models/management_operation_created_webhook_event.rb new file mode 100644 index 00000000..e853775a --- /dev/null +++ b/lib/lithic/models/management_operation_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationCreatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"management_operation.created"] + required :event_type, const: :"management_operation.created" + + # @!method initialize(event_type: :"management_operation.created") + # @param event_type [Symbol, :"management_operation.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/management_operation_updated_webhook_event.rb b/lib/lithic/models/management_operation_updated_webhook_event.rb new file mode 100644 index 00000000..aaa17709 --- /dev/null +++ b/lib/lithic/models/management_operation_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationUpdatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"management_operation.updated"] + required :event_type, const: :"management_operation.updated" + + # @!method initialize(event_type: :"management_operation.updated") + # @param event_type [Symbol, :"management_operation.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/network_total_created_webhook_event.rb b/lib/lithic/models/network_total_created_webhook_event.rb new file mode 100644 index 00000000..386e666d --- /dev/null +++ b/lib/lithic/models/network_total_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class NetworkTotalCreatedWebhookEvent < Lithic::Models::NetworkTotal + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"network_total.created"] + required :event_type, const: :"network_total.created" + + # @!method initialize(event_type: :"network_total.created") + # @param event_type [Symbol, :"network_total.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/network_total_updated_webhook_event.rb b/lib/lithic/models/network_total_updated_webhook_event.rb new file mode 100644 index 00000000..d94ad810 --- /dev/null +++ b/lib/lithic/models/network_total_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class NetworkTotalUpdatedWebhookEvent < Lithic::Models::NetworkTotal + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"network_total.updated"] + required :event_type, const: :"network_total.updated" + + # @!method initialize(event_type: :"network_total.updated") + # @param event_type [Symbol, :"network_total.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/parsed_webhook_event.rb b/lib/lithic/models/parsed_webhook_event.rb new file mode 100644 index 00000000..652ebf75 --- /dev/null +++ b/lib/lithic/models/parsed_webhook_event.rb @@ -0,0 +1,818 @@ +# frozen_string_literal: true + +module Lithic + module Models + # KYB payload for an updated account holder. + module ParsedWebhookEvent + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AccountHolderCreatedWebhookEvent } + + # KYB payload for an updated account holder. + variant -> { Lithic::ParsedWebhookEvent::KYBPayload } + + # KYC payload for an updated account holder. + variant -> { Lithic::ParsedWebhookEvent::KYCPayload } + + # Legacy payload for an updated account holder. + variant -> { Lithic::ParsedWebhookEvent::LegacyPayload } + + variant -> { Lithic::AccountHolderVerificationWebhookEvent } + + variant -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent } + + # The Auth Stream Access request payload that was sent to the ASA responder. + variant -> { Lithic::AsaRequestWebhookEvent } + + # A webhook for tokenization decisioning sent to the customer's responder endpoint + variant -> { Lithic::TokenizationDecisioningRequestWebhookEvent } + + variant -> { Lithic::AuthRulesBacktestReportCreatedWebhookEvent } + + variant -> { Lithic::BalanceUpdatedWebhookEvent } + + # Book transfer transaction + variant -> { Lithic::BookTransferTransactionCreatedWebhookEvent } + + # Book transfer transaction + variant -> { Lithic::BookTransferTransactionUpdatedWebhookEvent } + + variant -> { Lithic::CardCreatedWebhookEvent } + + variant -> { Lithic::CardConvertedWebhookEvent } + + variant -> { Lithic::CardRenewedWebhookEvent } + + variant -> { Lithic::CardReissuedWebhookEvent } + + variant -> { Lithic::CardShippedWebhookEvent } + + variant -> { Lithic::CardTransactionUpdatedWebhookEvent } + + variant -> { Lithic::CardTransactionEnhancedDataCreatedWebhookEvent } + + variant -> { Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationResultWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationUpdatedWebhookEvent } + + # Dispute. + variant -> { Lithic::DisputeUpdatedWebhookEvent } + + # Dispute evidence. + variant -> { Lithic::DisputeEvidenceUploadFailedWebhookEvent } + + variant -> { Lithic::ExternalBankAccountCreatedWebhookEvent } + + variant -> { Lithic::ExternalBankAccountUpdatedWebhookEvent } + + variant -> { Lithic::ExternalPaymentCreatedWebhookEvent } + + variant -> { Lithic::ExternalPaymentUpdatedWebhookEvent } + + variant -> { Lithic::FinancialAccountCreatedWebhookEvent } + + variant -> { Lithic::FinancialAccountUpdatedWebhookEvent } + + variant -> { Lithic::FundingEventCreatedWebhookEvent } + + variant -> { Lithic::LoanTapeCreatedWebhookEvent } + + variant -> { Lithic::LoanTapeUpdatedWebhookEvent } + + variant -> { Lithic::ManagementOperationCreatedWebhookEvent } + + variant -> { Lithic::ManagementOperationUpdatedWebhookEvent } + + variant -> { Lithic::InternalTransactionCreatedWebhookEvent } + + variant -> { Lithic::InternalTransactionUpdatedWebhookEvent } + + variant -> { Lithic::NetworkTotalCreatedWebhookEvent } + + variant -> { Lithic::NetworkTotalUpdatedWebhookEvent } + + # Payment transaction + variant -> { Lithic::PaymentTransactionCreatedWebhookEvent } + + # Payment transaction + variant -> { Lithic::PaymentTransactionUpdatedWebhookEvent } + + variant -> { Lithic::SettlementReportUpdatedWebhookEvent } + + variant -> { Lithic::StatementsCreatedWebhookEvent } + + # Represents a 3DS authentication + variant -> { Lithic::ThreeDSAuthenticationCreatedWebhookEvent } + + # Represents a 3DS authentication + variant -> { Lithic::ThreeDSAuthenticationUpdatedWebhookEvent } + + variant -> { Lithic::ThreeDSAuthenticationChallengeWebhookEvent } + + variant -> { Lithic::TokenizationApprovalRequestWebhookEvent } + + variant -> { Lithic::TokenizationResultWebhookEvent } + + variant -> { Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent } + + variant -> { Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent } + + variant -> { Lithic::TokenizationUpdatedWebhookEvent } + + # Represents a 3DS authentication + variant -> { Lithic::ThreeDSAuthentication } + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + variant -> { Lithic::DisputeTransactionCreatedWebhookEvent } + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + variant -> { Lithic::DisputeTransactionUpdatedWebhookEvent } + + class KYBPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest] + required :update_request, -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::ParsedWebhookEvent::KYBPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::ParsedWebhookEvent::KYBPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil, nature_of_business: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload} for more details. + # + # KYB payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::ParsedWebhookEvent::KYBPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param nature_of_business [String] Short description of the company's line of business (i.e., what does the company + # + # @param website_url [String] Company website URL. + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute beneficial_owner_entities + # @deprecated + # + # Deprecated. + # + # @return [Array, nil] + optional :beneficial_owner_entities, -> { Lithic::Internal::Type::ArrayOf[Lithic::KYBBusinessEntity] } + + # @!attribute beneficial_owner_individuals + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::KYBBusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, nil] + optional :control_person, -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson } + + # @!method initialize(beneficial_owner_entities: nil, beneficial_owner_individuals: nil, business_entity: nil, control_person: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest} for more + # details. + # + # Original request to update the account holder. + # + # @param beneficial_owner_entities [Array] Deprecated. + # + # @param beneficial_owner_individuals [Array] You must submit a list of all direct and indirect individuals with 25% or more o + # + # @param business_entity [Lithic::Models::KYBBusinessEntity] Information for business for which the account is being opened and KYB is being + # + # @param control_person [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson] An individual with significant responsibility for managing the legal entity (e.g + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual} + # for more details. + # + # @param address [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, nil] + optional :address, -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson} + # for more details. + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @param address [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest] + required :update_request, -> { Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::ParsedWebhookEvent::KYCPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::ParsedWebhookEvent::KYCPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload} for more details. + # + # KYC payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::ParsedWebhookEvent::KYCPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute individual + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual, nil] + optional :individual, -> { Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual } + + # @!method initialize(individual: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest} for more + # details. + # + # Original request to update the account holder. + # + # @param individual [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual] Information on the individual for whom the account is being opened and KYC is be + + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, nil] + optional :address, -> { Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual} for + # more details. + # + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @param address [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute business_account_token + # If applicable, represents the business account token associated with the + # account_holder. + # + # @return [String, nil] + optional :business_account_token, String, nil?: true + + # @!attribute created + # When the account_holder updated event was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute email + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + # + # @return [String, nil] + optional :email, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::ParsedWebhookEvent::LegacyPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::ParsedWebhookEvent::LegacyPayload::EventType } + + # @!attribute external_id + # If applicable, represents the external_id associated with the account_holder. + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!attribute first_name + # If applicable, represents the account_holder's first name. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # If applicable, represents the account_holder's last name. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute legal_business_name + # If applicable, represents the account_holder's business name. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute phone_number + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(token:, business_account_token: nil, created: nil, email: nil, event_type: nil, external_id: nil, first_name: nil, last_name: nil, legal_business_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::LegacyPayload} for more details. + # + # Legacy payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param business_account_token [String, nil] If applicable, represents the business account token associated with the account + # + # @param created [Time] When the account_holder updated event was created + # + # @param email [String] If updated, the newly updated email associated with the account_holder otherwise + # + # @param event_type [Symbol, Lithic::Models::ParsedWebhookEvent::LegacyPayload::EventType] The type of event that occurred. + # + # @param external_id [String, nil] If applicable, represents the external_id associated with the account_holder. + # + # @param first_name [String] If applicable, represents the account_holder's first name. + # + # @param last_name [String] If applicable, represents the account_holder's last name. + # + # @param legal_business_name [String] If applicable, represents the account_holder's business name. + # + # @param phone_number [String] If updated, the newly updated phone_number associated with the account_holder ot + + # The type of event that occurred. + # + # @see Lithic::Models::ParsedWebhookEvent::LegacyPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::AsaRequestWebhookEvent, Lithic::Models::TokenizationDecisioningRequestWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthentication, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent)] + end + end +end diff --git a/lib/lithic/models/payment_transaction_created_webhook_event.rb b/lib/lithic/models/payment_transaction_created_webhook_event.rb new file mode 100644 index 00000000..bffe3fd5 --- /dev/null +++ b/lib/lithic/models/payment_transaction_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentTransactionCreatedWebhookEvent < Lithic::Models::Payment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"payment_transaction.created"] + required :event_type, const: :"payment_transaction.created" + + # @!method initialize(event_type: :"payment_transaction.created") + # Payment transaction + # + # @param event_type [Symbol, :"payment_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/payment_transaction_updated_webhook_event.rb b/lib/lithic/models/payment_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..7a53c62c --- /dev/null +++ b/lib/lithic/models/payment_transaction_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentTransactionUpdatedWebhookEvent < Lithic::Models::Payment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"payment_transaction.updated"] + required :event_type, const: :"payment_transaction.updated" + + # @!method initialize(event_type: :"payment_transaction.updated") + # Payment transaction + # + # @param event_type [Symbol, :"payment_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/settlement_report_updated_webhook_event.rb b/lib/lithic/models/settlement_report_updated_webhook_event.rb new file mode 100644 index 00000000..d3d4a6e3 --- /dev/null +++ b/lib/lithic/models/settlement_report_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementReportUpdatedWebhookEvent < Lithic::Models::SettlementReport + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"settlement_report.updated"] + required :event_type, const: :"settlement_report.updated" + + # @!method initialize(event_type: :"settlement_report.updated") + # @param event_type [Symbol, :"settlement_report.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/statements_created_webhook_event.rb b/lib/lithic/models/statements_created_webhook_event.rb new file mode 100644 index 00000000..ad9dcc73 --- /dev/null +++ b/lib/lithic/models/statements_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class StatementsCreatedWebhookEvent < Lithic::Models::FinancialAccounts::Statement + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"statements.created"] + required :event_type, const: :"statements.created" + + # @!method initialize(event_type: :"statements.created") + # @param event_type [Symbol, :"statements.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/three_ds_authentication_challenge_webhook_event.rb b/lib/lithic/models/three_ds_authentication_challenge_webhook_event.rb new file mode 100644 index 00000000..7bd381e9 --- /dev/null +++ b/lib/lithic/models/three_ds_authentication_challenge_webhook_event.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthenticationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute authentication_object + # Represents a 3DS authentication + # + # @return [Lithic::Models::ThreeDSAuthentication] + required :authentication_object, -> { Lithic::ThreeDSAuthentication } + + # @!attribute challenge + # Represents a challenge object for 3DS authentication + # + # @return [Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge] + required :challenge, -> { Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge } + + # @!attribute event_type + # + # @return [Symbol, :"three_ds_authentication.challenge"] + required :event_type, const: :"three_ds_authentication.challenge" + + # @!method initialize(authentication_object:, challenge:, event_type: :"three_ds_authentication.challenge") + # @param authentication_object [Lithic::Models::ThreeDSAuthentication] Represents a 3DS authentication + # + # @param challenge [Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge] Represents a challenge object for 3DS authentication + # + # @param event_type [Symbol, :"three_ds_authentication.challenge"] + + # @see Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent#challenge + class Challenge < Lithic::Internal::Type::BaseModel + # @!attribute challenge_method_type + # The type of challenge method issued to the cardholder + # + # @return [Symbol, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType] + required :challenge_method_type, + enum: -> { Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType } + + # @!attribute expiry_time + # ISO-8601 time at which the challenge expires + # + # @return [Time] + required :expiry_time, Time + + # @!attribute start_time + # ISO-8601 time at which the challenge has started + # + # @return [Time] + required :start_time, Time + + # @!attribute app_requestor_url + # Fully qualified app URL of the merchant app. This should be used to redirect the + # cardholder back to the merchant app after completing an app-based challenge. + # This URL will only be populated if the 3DS Requestor App is provided to the 3DS + # SDK. + # + # @return [String, nil] + optional :app_requestor_url, String, nil?: true + + # @!method initialize(challenge_method_type:, expiry_time:, start_time:, app_requestor_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge} for more + # details. + # + # Represents a challenge object for 3DS authentication + # + # @param challenge_method_type [Symbol, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType] The type of challenge method issued to the cardholder + # + # @param expiry_time [Time] ISO-8601 time at which the challenge expires + # + # @param start_time [Time] ISO-8601 time at which the challenge has started + # + # @param app_requestor_url [String, nil] Fully qualified app URL of the merchant app. This should be used to redirect the + + # The type of challenge method issued to the cardholder + # + # @see Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge#challenge_method_type + module ChallengeMethodType + extend Lithic::Internal::Type::Enum + + OUT_OF_BAND = :OUT_OF_BAND + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/three_ds_authentication_created_webhook_event.rb b/lib/lithic/models/three_ds_authentication_created_webhook_event.rb new file mode 100644 index 00000000..f7f16295 --- /dev/null +++ b/lib/lithic/models/three_ds_authentication_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthenticationCreatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"three_ds_authentication.created"] + required :event_type, const: :"three_ds_authentication.created" + + # @!method initialize(event_type: :"three_ds_authentication.created") + # Represents a 3DS authentication + # + # @param event_type [Symbol, :"three_ds_authentication.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/three_ds_authentication_updated_webhook_event.rb b/lib/lithic/models/three_ds_authentication_updated_webhook_event.rb new file mode 100644 index 00000000..bd5d470f --- /dev/null +++ b/lib/lithic/models/three_ds_authentication_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthenticationUpdatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"three_ds_authentication.updated"] + required :event_type, const: :"three_ds_authentication.updated" + + # @!method initialize(event_type: :"three_ds_authentication.updated") + # Represents a 3DS authentication + # + # @param event_type [Symbol, :"three_ds_authentication.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/tokenization_approval_request_webhook_event.rb b/lib/lithic/models/tokenization_approval_request_webhook_event.rb new file mode 100644 index 00000000..1ef0aaad --- /dev/null +++ b/lib/lithic/models/tokenization_approval_request_webhook_event.rb @@ -0,0 +1,249 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute customer_tokenization_decision + # Contains the metadata for the customer tokenization decision. + # + # @return [Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] + required :customer_tokenization_decision, + -> { Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision }, + nil?: true + + # @!attribute event_type + # The name of this event + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::EventType] + required :event_type, enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::EventType } + + # @!attribute issuer_decision + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::IssuerDecision] + required :issuer_decision, enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision } + + # @!attribute tokenization_channel + # The channel through which the tokenization was made. + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationChannel] + required :tokenization_channel, + enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel } + + # @!attribute tokenization_token + # Unique identifier for the digital wallet token attempt + # + # @return [String] + required :tokenization_token, String + + # @!attribute wallet_decisioning_info + # + # @return [Lithic::Models::WalletDecisioningInfo] + required :wallet_decisioning_info, -> { Lithic::WalletDecisioningInfo } + + # @!attribute device + # + # @return [Lithic::Models::Device, nil] + optional :device, -> { Lithic::Device } + + # @!attribute digital_wallet_token_metadata + # Contains the metadata for the digital wallet being tokenized. + # + # @return [Lithic::Models::DigitalWalletTokenMetadata, nil] + optional :digital_wallet_token_metadata, -> { Lithic::DigitalWalletTokenMetadata } + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array, nil] + optional :tokenization_decline_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationDeclineReason] } + + # @!attribute tokenization_source + # The source of the tokenization. + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationSource, nil] + optional :tokenization_source, + enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource } + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!method initialize(account_token:, card_token:, created:, customer_tokenization_decision:, event_type:, issuer_decision:, tokenization_channel:, tokenization_token:, wallet_decisioning_info:, device: nil, digital_wallet_token_metadata: nil, rule_results: nil, tokenization_decline_reasons: nil, tokenization_source: nil, tokenization_tfa_reasons: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationApprovalRequestWebhookEvent} for more details. + # + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param customer_tokenization_decision [Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] Contains the metadata for the customer tokenization decision. + # + # @param event_type [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::EventType] The name of this event + # + # @param issuer_decision [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::IssuerDecision] Whether Lithic decisioned on the token, and if so, what the decision was. APPROV + # + # @param tokenization_channel [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationChannel] The channel through which the tokenization was made. + # + # @param tokenization_token [String] Unique identifier for the digital wallet token attempt + # + # @param wallet_decisioning_info [Lithic::Models::WalletDecisioningInfo] + # + # @param device [Lithic::Models::Device] + # + # @param digital_wallet_token_metadata [Lithic::Models::DigitalWalletTokenMetadata] Contains the metadata for the digital wallet being tokenized. + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param tokenization_source [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationSource] The source of the tokenization. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#customer_tokenization_decision + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + # @!attribute outcome + # The outcome of the customer's decision + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] + required :outcome, + enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome } + + # @!attribute responder_url + # The customer's subscribed URL + # + # @return [String] + required :responder_url, String + + # @!attribute latency + # Time in ms it took for the customer's URL to respond + # + # @return [String, nil] + optional :latency, String + + # @!attribute response_code + # The response code that the customer provided + # + # @return [String, nil] + optional :response_code, String + + # @!method initialize(outcome:, responder_url:, latency: nil, response_code: nil) + # Contains the metadata for the customer tokenization decision. + # + # @param outcome [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] The outcome of the customer's decision + # + # @param responder_url [String] The customer's subscribed URL + # + # @param latency [String] Time in ms it took for the customer's URL to respond + # + # @param response_code [String] The response code that the customer provided + + # The outcome of the customer's decision + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision#outcome + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + ERROR = :ERROR + INVALID_RESPONSE = :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT = :TIMEOUT + + # @!method self.values + # @return [Array] + end + end + + # The name of this event + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#event_type + module EventType + extend Lithic::Internal::Type::Enum + + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + + # @!method self.values + # @return [Array] + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#issuer_decision + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DENIED = :DENIED + VERIFICATION_REQUIRED = :VERIFICATION_REQUIRED + + # @!method self.values + # @return [Array] + end + + # The channel through which the tokenization was made. + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#tokenization_channel + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + + # @!method self.values + # @return [Array] + end + + # The source of the tokenization. + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#tokenization_source + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE = :ACCOUNT_ON_FILE + CONTACTLESS_TAP = :CONTACTLESS_TAP + MANUAL_PROVISION = :MANUAL_PROVISION + PUSH_PROVISION = :PUSH_PROVISION + TOKEN = :TOKEN + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization_decisioning_request_webhook_event.rb b/lib/lithic/models/tokenization_decisioning_request_webhook_event.rb new file mode 100644 index 00000000..92be6a66 --- /dev/null +++ b/lib/lithic/models/tokenization_decisioning_request_webhook_event.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationDecisioningRequestWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The name of this event + # + # @return [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::EventType] + required :event_type, enum: -> { Lithic::TokenizationDecisioningRequestWebhookEvent::EventType } + + # @!attribute issuer_decision + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @return [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::IssuerDecision] + required :issuer_decision, enum: -> { Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision } + + # @!attribute tokenization_channel + # The channel through which the tokenization was made. + # + # @return [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel] + required :tokenization_channel, + enum: -> { Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel } + + # @!attribute tokenization_token + # Unique identifier for the digital wallet token attempt + # + # @return [String] + required :tokenization_token, String + + # @!attribute wallet_decisioning_info + # + # @return [Lithic::Models::WalletDecisioningInfo] + required :wallet_decisioning_info, -> { Lithic::WalletDecisioningInfo } + + # @!attribute device + # + # @return [Lithic::Models::Device, nil] + optional :device, -> { Lithic::Device } + + # @!attribute digital_wallet_token_metadata + # Contains the metadata for the digital wallet being tokenized. + # + # @return [Lithic::Models::DigitalWalletTokenMetadata, nil] + optional :digital_wallet_token_metadata, -> { Lithic::DigitalWalletTokenMetadata } + + # @!attribute tokenization_source + # The source of the tokenization. + # + # @return [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::TokenizationSource, nil] + optional :tokenization_source, + enum: -> { Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource } + + # @!method initialize(account_token:, card_token:, created:, event_type:, issuer_decision:, tokenization_channel:, tokenization_token:, wallet_decisioning_info:, device: nil, digital_wallet_token_metadata: nil, tokenization_source: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationDecisioningRequestWebhookEvent} for more details. + # + # A webhook for tokenization decisioning sent to the customer's responder endpoint + # + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param event_type [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::EventType] The name of this event + # + # @param issuer_decision [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::IssuerDecision] Whether Lithic decisioned on the token, and if so, what the decision was. APPROV + # + # @param tokenization_channel [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel] The channel through which the tokenization was made. + # + # @param tokenization_token [String] Unique identifier for the digital wallet token attempt + # + # @param wallet_decisioning_info [Lithic::Models::WalletDecisioningInfo] + # + # @param device [Lithic::Models::Device] + # + # @param digital_wallet_token_metadata [Lithic::Models::DigitalWalletTokenMetadata] Contains the metadata for the digital wallet being tokenized. + # + # @param tokenization_source [Symbol, Lithic::Models::TokenizationDecisioningRequestWebhookEvent::TokenizationSource] The source of the tokenization. + + # The name of this event + # + # @see Lithic::Models::TokenizationDecisioningRequestWebhookEvent#event_type + module EventType + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + + # @!method self.values + # @return [Array] + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @see Lithic::Models::TokenizationDecisioningRequestWebhookEvent#issuer_decision + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DENIED = :DENIED + VERIFICATION_REQUIRED = :VERIFICATION_REQUIRED + + # @!method self.values + # @return [Array] + end + + # The channel through which the tokenization was made. + # + # @see Lithic::Models::TokenizationDecisioningRequestWebhookEvent#tokenization_channel + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + + # @!method self.values + # @return [Array] + end + + # The source of the tokenization. + # + # @see Lithic::Models::TokenizationDecisioningRequestWebhookEvent#tokenization_source + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE = :ACCOUNT_ON_FILE + CONTACTLESS_TAP = :CONTACTLESS_TAP + MANUAL_PROVISION = :MANUAL_PROVISION + PUSH_PROVISION = :PUSH_PROVISION + TOKEN = :TOKEN + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization_result_webhook_event.rb b/lib/lithic/models/tokenization_result_webhook_event.rb new file mode 100644 index 00000000..235b0e44 --- /dev/null +++ b/lib/lithic/models/tokenization_result_webhook_event.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.result"] + required :event_type, const: :"tokenization.result" + + # @!attribute tokenization_result_details + # The result of the tokenization request. + # + # @return [Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails] + required :tokenization_result_details, + -> { Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails } + + # @!attribute tokenization_token + # Tokenization token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, card_token:, created:, tokenization_result_details:, tokenization_token:, event_type: :"tokenization.result") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization_result_details [Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails] The result of the tokenization request. + # + # @param tokenization_token [String] Tokenization token + # + # @param event_type [Symbol, :"tokenization.result"] The type of event that occurred. + + # @see Lithic::Models::TokenizationResultWebhookEvent#tokenization_result_details + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + # @!attribute issuer_decision + # Lithic's tokenization decision. + # + # @return [String] + required :issuer_decision, String + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array] + required :tokenization_decline_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason] } + + # @!attribute customer_decision + # The customer's tokenization decision if applicable. + # + # @return [String, nil] + optional :customer_decision, String, nil?: true + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute token_activated_date_time + # An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @return [Time, nil] + optional :token_activated_date_time, Time, nil?: true + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!attribute wallet_decision + # The wallet's recommended decision. + # + # @return [String, nil] + optional :wallet_decision, String, nil?: true + + # @!method initialize(issuer_decision:, tokenization_decline_reasons:, customer_decision: nil, rule_results: nil, token_activated_date_time: nil, tokenization_tfa_reasons: nil, wallet_decision: nil) + # The result of the tokenization request. + # + # @param issuer_decision [String] Lithic's tokenization decision. + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param customer_decision [String, nil] The customer's tokenization decision if applicable. + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param token_activated_date_time [Time, nil] An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + # + # @param wallet_decision [String, nil] The wallet's recommended decision. + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + CVC_MISMATCH = :CVC_MISMATCH + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + GENERIC_DECLINE = :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rb b/lib/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rb new file mode 100644 index 00000000..fe60247d --- /dev/null +++ b/lib/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod } + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.two_factor_authentication_code_sent"] + required :event_type, const: :"tokenization.two_factor_authentication_code_sent" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, card_token:, created:, tokenization_token:, event_type: :"tokenization.two_factor_authentication_code_sent") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"tokenization.two_factor_authentication_code_sent"] The type of event that occurred. + + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location to which the authentication code was sent. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rb b/lib/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rb new file mode 100644 index 00000000..e1f76309 --- /dev/null +++ b/lib/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod } + + # @!attribute authentication_code + # Authentication code to provide to the user tokenizing a card. + # + # @return [String] + required :authentication_code, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.two_factor_authentication_code"] + required :event_type, const: :"tokenization.two_factor_authentication_code" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, authentication_code:, card_token:, created:, tokenization_token:, event_type: :"tokenization.two_factor_authentication_code") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + # + # @param authentication_code [String] Authentication code to provide to the user tokenizing a card. + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"tokenization.two_factor_authentication_code"] The type of event that occurred. + + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location where the user wants to receive the authentication code. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_updated_webhook_event.rb b/lib/lithic/models/tokenization_updated_webhook_event.rb new file mode 100644 index 00000000..ae6a443e --- /dev/null +++ b/lib/lithic/models/tokenization_updated_webhook_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.updated"] + required :event_type, const: :"tokenization.updated" + + # @!attribute tokenization + # + # @return [Lithic::Models::Tokenization] + required :tokenization, -> { Lithic::Tokenization } + + # @!method initialize(account_token:, card_token:, created:, tokenization:, event_type: :"tokenization.updated") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization [Lithic::Models::Tokenization] + # + # @param event_type [Symbol, :"tokenization.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/webhook_parsed_params.rb b/lib/lithic/models/webhook_parsed_params.rb new file mode 100644 index 00000000..5d943bb9 --- /dev/null +++ b/lib/lithic/models/webhook_parsed_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Webhooks#parsed + class WebhookParsedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/resources/webhooks.rb b/lib/lithic/resources/webhooks.rb new file mode 100644 index 00000000..ee7d93d7 --- /dev/null +++ b/lib/lithic/resources/webhooks.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Webhooks + # Parses and verifies a webhook payload. Verifies the signature before parsing. + # + # @param payload [String] The raw webhook payload as a string + # @param headers [Hash{String => String}] The webhook request headers + # @param secret [String, nil] The webhook secret. If not provided, reads from LITHIC_WEBHOOK_SECRET environment variable. + # + # @return [Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::AsaRequestWebhookEvent, Lithic::Models::TokenizationDecisioningRequestWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthentication, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent] + # + # @raise [ArgumentError] if secret is not provided and LITHIC_WEBHOOK_SECRET env var is not set + # @raise [Lithic::Errors::MissingDependencyError] if the standardwebhooks gem is not installed + # @raise [StandardWebhooks::WebhookVerificationError] if the signature is invalid + # + # @example + # event = lithic.webhooks.parse( + # request.body.read, + # headers: request.headers + # ) + def parse(payload, headers:, secret: nil) + verified_json = verify_signature(payload: payload, headers: headers, secret: secret) + Lithic::Internal::Type::Converter.coerce(Lithic::Models::ParsedWebhookEvent, verified_json) + end + + # Parses a webhook payload without verifying the signature. + # + # WARNING: This method does not verify the webhook signature. Use only for testing or when + # signature verification is not required. + # + # @param payload [String] The raw webhook payload as a string + # + # @return [Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::AsaRequestWebhookEvent, Lithic::Models::TokenizationDecisioningRequestWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthentication, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent] + def parse_unsafe(payload) + parsed = JSON.parse(payload, symbolize_names: true) + Lithic::Internal::Type::Converter.coerce(Lithic::Models::ParsedWebhookEvent, parsed) + end + + # Verifies the signature of a webhook payload using the Standard Webhooks specification. + # + # @param payload [String] The raw webhook payload as a string + # @param headers [Hash{String => String}] The webhook request headers + # @param secret [String, nil] The webhook secret (with or without the "whsec_" prefix). + # If not provided, reads from LITHIC_WEBHOOK_SECRET environment variable. + # + # @return [Hash] The parsed webhook payload with symbolized keys + # + # @raise [ArgumentError] if secret is not provided and LITHIC_WEBHOOK_SECRET env var is not set + # @raise [Lithic::Errors::MissingDependencyError] if the standardwebhooks gem is not installed + # @raise [StandardWebhooks::WebhookVerificationError] if the signature is invalid + # + # @example + # json = lithic.webhooks.verify_signature( + # payload: request.body.read, + # headers: request.headers + # ) + # puts json[:event_type] + def verify_signature(payload:, headers:, secret: nil) + secret ||= ENV["LITHIC_WEBHOOK_SECRET"] + if secret.nil? || secret.empty? + raise ArgumentError, "Webhook secret must be provided or set in LITHIC_WEBHOOK_SECRET environment variable" + end + + begin + require("standardwebhooks") + rescue LoadError + raise Lithic::Errors::MissingDependencyError.new( + gem_name: "standardwebhooks", + feature: "webhook signature verification" + ) + end + + wh = StandardWebhooks::Webhook.new(secret) + wh.verify(payload, headers) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/rbi/lithic/client.rbi b/rbi/lithic/client.rbi index f82fd1da..2b400356 100644 --- a/rbi/lithic/client.rbi +++ b/rbi/lithic/client.rbi @@ -118,6 +118,9 @@ module Lithic sig { returns(Lithic::Resources::AccountActivity) } attr_reader :account_activity + sig { returns(Lithic::Resources::Webhooks) } + attr_reader :webhooks + # Status of api sig do params(request_options: Lithic::RequestOptions::OrHash).returns( diff --git a/rbi/lithic/models.rbi b/rbi/lithic/models.rbi index a7f0d927..71191d59 100644 --- a/rbi/lithic/models.rbi +++ b/rbi/lithic/models.rbi @@ -12,8 +12,14 @@ module Lithic AccountHolder = Lithic::Models::AccountHolder + AccountHolderCreatedWebhookEvent = + Lithic::Models::AccountHolderCreatedWebhookEvent + AccountHolderCreateParams = Lithic::Models::AccountHolderCreateParams + AccountHolderDocumentUpdatedWebhookEvent = + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent + AccountHolderListDocumentsParams = Lithic::Models::AccountHolderListDocumentsParams @@ -30,11 +36,17 @@ module Lithic AccountHolderSimulateEnrollmentReviewParams = Lithic::Models::AccountHolderSimulateEnrollmentReviewParams + AccountHolderUpdatedWebhookEvent = + Lithic::Models::AccountHolderUpdatedWebhookEvent + AccountHolderUpdateParams = Lithic::Models::AccountHolderUpdateParams AccountHolderUploadDocumentParams = Lithic::Models::AccountHolderUploadDocumentParams + AccountHolderVerificationWebhookEvent = + Lithic::Models::AccountHolderVerificationWebhookEvent + AccountListParams = Lithic::Models::AccountListParams AccountRetrieveParams = Lithic::Models::AccountRetrieveParams @@ -56,8 +68,13 @@ module Lithic APIStatus = Lithic::Models::APIStatus + AsaRequestWebhookEvent = Lithic::Models::AsaRequestWebhookEvent + AuthRules = Lithic::Models::AuthRules + AuthRulesBacktestReportCreatedWebhookEvent = + Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent + AuthStreamEnrollmentRetrieveSecretParams = Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams @@ -70,6 +87,8 @@ module Lithic BalanceListParams = Lithic::Models::BalanceListParams + BalanceUpdatedWebhookEvent = Lithic::Models::BalanceUpdatedWebhookEvent + BookTransferCreateParams = Lithic::Models::BookTransferCreateParams BookTransferListParams = Lithic::Models::BookTransferListParams @@ -80,6 +99,12 @@ module Lithic BookTransferReverseParams = Lithic::Models::BookTransferReverseParams + BookTransferTransactionCreatedWebhookEvent = + Lithic::Models::BookTransferTransactionCreatedWebhookEvent + + BookTransferTransactionUpdatedWebhookEvent = + Lithic::Models::BookTransferTransactionUpdatedWebhookEvent + Card = Lithic::Models::Card CardBulkOrder = Lithic::Models::CardBulkOrder @@ -92,8 +117,12 @@ module Lithic CardBulkOrderUpdateParams = Lithic::Models::CardBulkOrderUpdateParams + CardConvertedWebhookEvent = Lithic::Models::CardConvertedWebhookEvent + CardConvertPhysicalParams = Lithic::Models::CardConvertPhysicalParams + CardCreatedWebhookEvent = Lithic::Models::CardCreatedWebhookEvent + CardCreateParams = Lithic::Models::CardCreateParams CardEmbedParams = Lithic::Models::CardEmbedParams @@ -110,8 +139,12 @@ module Lithic CardProvisionParams = Lithic::Models::CardProvisionParams + CardReissuedWebhookEvent = Lithic::Models::CardReissuedWebhookEvent + CardReissueParams = Lithic::Models::CardReissueParams + CardRenewedWebhookEvent = Lithic::Models::CardRenewedWebhookEvent + CardRenewParams = Lithic::Models::CardRenewParams CardRetrieveParams = Lithic::Models::CardRetrieveParams @@ -122,8 +155,19 @@ module Lithic CardSearchByPanParams = Lithic::Models::CardSearchByPanParams + CardShippedWebhookEvent = Lithic::Models::CardShippedWebhookEvent + CardSpendLimits = Lithic::Models::CardSpendLimits + CardTransactionEnhancedDataCreatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent + + CardTransactionEnhancedDataUpdatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent + + CardTransactionUpdatedWebhookEvent = + Lithic::Models::CardTransactionUpdatedWebhookEvent + CardUpdateParams = Lithic::Models::CardUpdateParams CardWebProvisionParams = Lithic::Models::CardWebProvisionParams @@ -146,6 +190,21 @@ module Lithic DigitalCardArtRetrieveParams = Lithic::Models::DigitalCardArtRetrieveParams + DigitalWalletTokenizationApprovalRequestWebhookEvent = + Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent + + DigitalWalletTokenizationResultWebhookEvent = + Lithic::Models::DigitalWalletTokenizationResultWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + + DigitalWalletTokenizationUpdatedWebhookEvent = + Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent + DigitalWalletTokenMetadata = Lithic::Models::DigitalWalletTokenMetadata Dispute = Lithic::Models::Dispute @@ -158,6 +217,9 @@ module Lithic DisputeEvidence = Lithic::Models::DisputeEvidence + DisputeEvidenceUploadFailedWebhookEvent = + Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent + DisputeInitiateEvidenceUploadParams = Lithic::Models::DisputeInitiateEvidenceUploadParams @@ -173,6 +235,14 @@ module Lithic DisputesV2RetrieveParams = Lithic::Models::DisputesV2RetrieveParams + DisputeTransactionCreatedWebhookEvent = + Lithic::Models::DisputeTransactionCreatedWebhookEvent + + DisputeTransactionUpdatedWebhookEvent = + Lithic::Models::DisputeTransactionUpdatedWebhookEvent + + DisputeUpdatedWebhookEvent = Lithic::Models::DisputeUpdatedWebhookEvent + DisputeUpdateParams = Lithic::Models::DisputeUpdateParams DisputeV2 = Lithic::Models::DisputeV2 @@ -195,6 +265,9 @@ module Lithic ExternalBankAccountAddress = Lithic::Models::ExternalBankAccountAddress + ExternalBankAccountCreatedWebhookEvent = + Lithic::Models::ExternalBankAccountCreatedWebhookEvent + ExternalBankAccountCreateParams = Lithic::Models::ExternalBankAccountCreateParams @@ -214,6 +287,9 @@ module Lithic ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams + ExternalBankAccountUpdatedWebhookEvent = + Lithic::Models::ExternalBankAccountUpdatedWebhookEvent + ExternalBankAccountUpdateParams = Lithic::Models::ExternalBankAccountUpdateParams @@ -221,6 +297,9 @@ module Lithic ExternalPaymentCancelParams = Lithic::Models::ExternalPaymentCancelParams + ExternalPaymentCreatedWebhookEvent = + Lithic::Models::ExternalPaymentCreatedWebhookEvent + ExternalPaymentCreateParams = Lithic::Models::ExternalPaymentCreateParams ExternalPaymentListParams = Lithic::Models::ExternalPaymentListParams @@ -233,6 +312,9 @@ module Lithic ExternalPaymentSettleParams = Lithic::Models::ExternalPaymentSettleParams + ExternalPaymentUpdatedWebhookEvent = + Lithic::Models::ExternalPaymentUpdatedWebhookEvent + ExternalResource = Lithic::Models::ExternalResource ExternalResourceType = Lithic::Models::ExternalResourceType @@ -241,6 +323,9 @@ module Lithic FinancialAccountBalance = Lithic::Models::FinancialAccountBalance + FinancialAccountCreatedWebhookEvent = + Lithic::Models::FinancialAccountCreatedWebhookEvent + FinancialAccountCreateParams = Lithic::Models::FinancialAccountCreateParams FinancialAccountListParams = Lithic::Models::FinancialAccountListParams @@ -253,6 +338,9 @@ module Lithic FinancialAccounts = Lithic::Models::FinancialAccounts + FinancialAccountUpdatedWebhookEvent = + Lithic::Models::FinancialAccountUpdatedWebhookEvent + FinancialAccountUpdateParams = Lithic::Models::FinancialAccountUpdateParams FinancialAccountUpdateStatusParams = @@ -266,6 +354,9 @@ module Lithic FundingEvent = Lithic::Models::FundingEvent + FundingEventCreatedWebhookEvent = + Lithic::Models::FundingEventCreatedWebhookEvent + FundingEventListParams = Lithic::Models::FundingEventListParams FundingEventRetrieveDetailsParams = @@ -277,6 +368,12 @@ module Lithic InternalTransactionAPI = Lithic::Models::InternalTransactionAPI + InternalTransactionCreatedWebhookEvent = + Lithic::Models::InternalTransactionCreatedWebhookEvent + + InternalTransactionUpdatedWebhookEvent = + Lithic::Models::InternalTransactionUpdatedWebhookEvent + KYB = Lithic::Models::KYB KYBBusinessEntity = Lithic::Models::KYBBusinessEntity @@ -285,6 +382,13 @@ module Lithic KYCExempt = Lithic::Models::KYCExempt + LoanTapeCreatedWebhookEvent = Lithic::Models::LoanTapeCreatedWebhookEvent + + LoanTapeUpdatedWebhookEvent = Lithic::Models::LoanTapeUpdatedWebhookEvent + + ManagementOperationCreatedWebhookEvent = + Lithic::Models::ManagementOperationCreatedWebhookEvent + ManagementOperationCreateParams = Lithic::Models::ManagementOperationCreateParams @@ -299,6 +403,9 @@ module Lithic ManagementOperationTransaction = Lithic::Models::ManagementOperationTransaction + ManagementOperationUpdatedWebhookEvent = + Lithic::Models::ManagementOperationUpdatedWebhookEvent + Merchant = Lithic::Models::Merchant MessageAttempt = Lithic::Models::MessageAttempt @@ -311,10 +418,18 @@ module Lithic NetworkTotal = Lithic::Models::NetworkTotal + NetworkTotalCreatedWebhookEvent = + Lithic::Models::NetworkTotalCreatedWebhookEvent + + NetworkTotalUpdatedWebhookEvent = + Lithic::Models::NetworkTotalUpdatedWebhookEvent + NonPCICard = Lithic::Models::NonPCICard OwnerType = Lithic::Models::OwnerType + ParsedWebhookEvent = Lithic::Models::ParsedWebhookEvent + Payment = Lithic::Models::Payment PaymentCreateParams = Lithic::Models::PaymentCreateParams @@ -335,6 +450,12 @@ module Lithic PaymentSimulateReturnParams = Lithic::Models::PaymentSimulateReturnParams + PaymentTransactionCreatedWebhookEvent = + Lithic::Models::PaymentTransactionCreatedWebhookEvent + + PaymentTransactionUpdatedWebhookEvent = + Lithic::Models::PaymentTransactionUpdatedWebhookEvent + ProvisionResponse = Lithic::Models::ProvisionResponse Reports = Lithic::Models::Reports @@ -354,26 +475,46 @@ module Lithic SettlementReport = Lithic::Models::SettlementReport + SettlementReportUpdatedWebhookEvent = + Lithic::Models::SettlementReportUpdatedWebhookEvent + SettlementSummaryDetails = Lithic::Models::SettlementSummaryDetails ShippingAddress = Lithic::Models::ShippingAddress SpendLimitDuration = Lithic::Models::SpendLimitDuration + StatementsCreatedWebhookEvent = Lithic::Models::StatementsCreatedWebhookEvent + StatementTotals = Lithic::Models::StatementTotals ThreeDS = Lithic::Models::ThreeDS ThreeDSAuthentication = Lithic::Models::ThreeDSAuthentication + ThreeDSAuthenticationChallengeWebhookEvent = + Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent + + ThreeDSAuthenticationCreatedWebhookEvent = + Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent + + ThreeDSAuthenticationUpdatedWebhookEvent = + Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent + TokenInfo = Lithic::Models::TokenInfo Tokenization = Lithic::Models::Tokenization TokenizationActivateParams = Lithic::Models::TokenizationActivateParams + TokenizationApprovalRequestWebhookEvent = + Lithic::Models::TokenizationApprovalRequestWebhookEvent + TokenizationDeactivateParams = Lithic::Models::TokenizationDeactivateParams + TokenizationDecisioningRequestWebhookEvent = + Lithic::Models::TokenizationDecisioningRequestWebhookEvent + TokenizationDecisioningRetrieveSecretParams = Lithic::Models::TokenizationDecisioningRetrieveSecretParams @@ -389,6 +530,9 @@ module Lithic TokenizationResendActivationCodeParams = Lithic::Models::TokenizationResendActivationCodeParams + TokenizationResultWebhookEvent = + Lithic::Models::TokenizationResultWebhookEvent + TokenizationRetrieveParams = Lithic::Models::TokenizationRetrieveParams TokenizationRuleResult = Lithic::Models::TokenizationRuleResult @@ -399,11 +543,20 @@ module Lithic TokenizationTfaReason = Lithic::Models::TokenizationTfaReason + TokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + TokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent + TokenizationUnpauseParams = Lithic::Models::TokenizationUnpauseParams TokenizationUpdateDigitalCardArtParams = Lithic::Models::TokenizationUpdateDigitalCardArtParams + TokenizationUpdatedWebhookEvent = + Lithic::Models::TokenizationUpdatedWebhookEvent + Transaction = Lithic::Models::Transaction TransactionExpireAuthorizationParams = @@ -443,5 +596,7 @@ module Lithic WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo + WebhookParsedParams = Lithic::Models::WebhookParsedParams + WirePartyDetails = Lithic::Models::WirePartyDetails end diff --git a/rbi/lithic/models/account_holder_created_webhook_event.rbi b/rbi/lithic/models/account_holder_created_webhook_event.rbi new file mode 100644 index 00000000..84bc7189 --- /dev/null +++ b/rbi/lithic/models/account_holder_created_webhook_event.rbi @@ -0,0 +1,149 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the account_holder that was created. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The token of the account that was created. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # When the account_holder was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + sig { returns(T.nilable(T::Array[Lithic::RequiredDocument])) } + attr_reader :required_documents + + sig do + params( + required_documents: T::Array[Lithic::RequiredDocument::OrHash] + ).void + end + attr_writer :required_documents + + # The status of the account_holder that was created. + sig do + returns( + T.nilable( + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: Lithic::AccountHolderCreatedWebhookEvent::Status::OrSymbol + ).void + end + attr_writer :status + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :status_reason + + sig { params(status_reason: T::Array[String]).void } + attr_writer :status_reason + + sig do + params( + token: String, + account_token: String, + created: Time, + required_documents: T::Array[Lithic::RequiredDocument::OrHash], + status: Lithic::AccountHolderCreatedWebhookEvent::Status::OrSymbol, + status_reason: T::Array[String], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token: nil, + # The token of the account that was created. + account_token: nil, + # When the account_holder was created + created: nil, + required_documents: nil, + # The status of the account_holder that was created. + status: nil, + status_reason: nil, + # The type of event that occurred. + event_type: :"account_holder.created" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + token: String, + account_token: String, + created: Time, + required_documents: T::Array[Lithic::RequiredDocument], + status: + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol, + status_reason: T::Array[String] + } + ) + end + def to_hash + end + + # The status of the account_holder that was created. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountHolderCreatedWebhookEvent::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_document_updated_webhook_event.rbi b/rbi/lithic/models/account_holder_document_updated_webhook_event.rbi new file mode 100644 index 00000000..c7637490 --- /dev/null +++ b/rbi/lithic/models/account_holder_document_updated_webhook_event.rbi @@ -0,0 +1,479 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderDocumentUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the account holder document + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The token of the account_holder that the document belongs to + sig { returns(T.nilable(String)) } + attr_reader :account_holder_token + + sig { params(account_holder_token: String).void } + attr_writer :account_holder_token + + # When the account_holder was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # Type of documentation to be submitted for verification of an account holder + sig do + returns( + T.nilable( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ) + end + attr_reader :document_type + + sig do + params( + document_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::OrSymbol + ).void + end + attr_writer :document_type + + # The token of the entity that the document belongs to + sig { returns(T.nilable(String)) } + attr_reader :entity_token + + sig { params(entity_token: String).void } + attr_writer :entity_token + + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload + ] + ) + ) + end + attr_reader :required_document_uploads + + sig do + params( + required_document_uploads: + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::OrHash + ] + ).void + end + attr_writer :required_document_uploads + + sig do + params( + token: String, + account_holder_token: String, + created: Time, + document_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::OrSymbol, + entity_token: String, + required_document_uploads: + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::OrHash + ], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the account holder document + token: nil, + # The token of the account_holder that the document belongs to + account_holder_token: nil, + # When the account_holder was created + created: nil, + # Type of documentation to be submitted for verification of an account holder + document_type: nil, + # The token of the entity that the document belongs to + entity_token: nil, + required_document_uploads: nil, + # The type of event that occurred. + event_type: :"account_holder_document.updated" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + token: String, + account_holder_token: String, + created: Time, + document_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol, + entity_token: String, + required_document_uploads: + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload + ] + } + ) + end + def to_hash + end + + # Type of documentation to be submitted for verification of an account holder + module DocumentType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DRIVERS_LICENSE = + T.let( + :DRIVERS_LICENSE, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + PASSPORT = + T.let( + :PASSPORT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + PASSPORT_CARD = + T.let( + :PASSPORT_CARD, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + EIN_LETTER = + T.let( + :EIN_LETTER, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + TAX_RETURN = + T.let( + :TAX_RETURN, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + OPERATING_AGREEMENT = + T.let( + :OPERATING_AGREEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_FORMATION = + T.let( + :CERTIFICATE_OF_FORMATION, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_GOOD_STANDING = + T.let( + :CERTIFICATE_OF_GOOD_STANDING, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ARTICLES_OF_INCORPORATION = + T.let( + :ARTICLES_OF_INCORPORATION, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ARTICLES_OF_ORGANIZATION = + T.let( + :ARTICLES_OF_ORGANIZATION, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + BYLAWS = + T.let( + :BYLAWS, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + GOVERNMENT_BUSINESS_LICENSE = + T.let( + :GOVERNMENT_BUSINESS_LICENSE, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + PARTNERSHIP_AGREEMENT = + T.let( + :PARTNERSHIP_AGREEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + SS4_FORM = + T.let( + :SS4_FORM, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + BANK_STATEMENT = + T.let( + :BANK_STATEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + UTILITY_BILL_STATEMENT = + T.let( + :UTILITY_BILL_STATEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + SSN_CARD = + T.let( + :SSN_CARD, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ITIN_LETTER = + T.let( + :ITIN_LETTER, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + FINCEN_BOI_REPORT = + T.let( + :FINCEN_BOI_REPORT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload, + Lithic::Internal::AnyHash + ) + end + + # The token of the document upload + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :accepted_entity_status_reasons + + sig { params(accepted_entity_status_reasons: T::Array[String]).void } + attr_writer :accepted_entity_status_reasons + + # When the document upload was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # The type of image that was uploaded + sig do + returns( + T.nilable( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + ) + end + attr_reader :image_type + + sig do + params( + image_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::OrSymbol + ).void + end + attr_writer :image_type + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :rejected_entity_status_reasons + + sig { params(rejected_entity_status_reasons: T::Array[String]).void } + attr_writer :rejected_entity_status_reasons + + # The status of the document upload + sig do + returns( + T.nilable( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::OrSymbol + ).void + end + attr_writer :status + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :status_reasons + + sig { params(status_reasons: T::Array[String]).void } + attr_writer :status_reasons + + # When the document upload was last updated + sig { returns(T.nilable(Time)) } + attr_reader :updated + + sig { params(updated: Time).void } + attr_writer :updated + + # A document upload that belongs to the overall account holder document + sig do + params( + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::OrSymbol, + rejected_entity_status_reasons: T::Array[String], + status: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::OrSymbol, + status_reasons: T::Array[String], + updated: Time + ).returns(T.attached_class) + end + def self.new( + # The token of the document upload + token: nil, + accepted_entity_status_reasons: nil, + # When the document upload was created + created: nil, + # The type of image that was uploaded + image_type: nil, + rejected_entity_status_reasons: nil, + # The status of the document upload + status: nil, + status_reasons: nil, + # When the document upload was last updated + updated: nil + ) + end + + sig do + override.returns( + { + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol, + rejected_entity_status_reasons: T::Array[String], + status: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol, + status_reasons: T::Array[String], + updated: Time + } + ) + end + def to_hash + end + + # The type of image that was uploaded + module ImageType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FRONT = + T.let( + :FRONT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + BACK = + T.let( + :BACK, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the document upload + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + PENDING_UPLOAD = + T.let( + :PENDING_UPLOAD, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + UPLOADED = + T.let( + :UPLOADED, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + PARTIAL_APPROVAL = + T.let( + :PARTIAL_APPROVAL, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_updated_webhook_event.rbi b/rbi/lithic/models/account_holder_updated_webhook_event.rbi new file mode 100644 index 00000000..8e7f9603 --- /dev/null +++ b/rbi/lithic/models/account_holder_updated_webhook_event.rbi @@ -0,0 +1,1274 @@ +# typed: strong + +module Lithic + module Models + # KYB payload for an updated account holder. + module AccountHolderUpdatedWebhookEvent + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload, + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload, + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload + ) + end + + class KYBPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig do + returns( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest + ) + end + attr_reader :update_request + + sig do + params( + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Short description of the company's line of business (i.e., what does the company + # do?). + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # KYB payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::OrHash, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::OrSymbol, + external_id: String, + nature_of_business: String, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # Short description of the company's line of business (i.e., what does the company + # do?). + nature_of_business: nil, + # Company website URL. + website_url: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol, + external_id: String, + nature_of_business: String, + website_url: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # Deprecated. + sig { returns(T.nilable(T::Array[Lithic::KYBBusinessEntity])) } + attr_reader :beneficial_owner_entities + + sig do + params( + beneficial_owner_entities: + T::Array[Lithic::KYBBusinessEntity::OrHash] + ).void + end + attr_writer :beneficial_owner_entities + + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(T.nilable(Lithic::KYBBusinessEntity)) } + attr_reader :business_entity + + sig do + params(business_entity: Lithic::KYBBusinessEntity::OrHash).void + end + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # Original request to update the account holder. + sig do + params( + beneficial_owner_entities: + T::Array[Lithic::KYBBusinessEntity::OrHash], + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ], + business_entity: Lithic::KYBBusinessEntity::OrHash, + control_person: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).returns(T.attached_class) + end + def self.new( + # Deprecated. + beneficial_owner_entities: nil, + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity: nil, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person: nil + ) + end + + sig do + override.returns( + { + beneficial_owner_entities: T::Array[Lithic::KYBBusinessEntity], + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ], + business_entity: Lithic::KYBBusinessEntity, + control_person: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig do + returns( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest + ) + end + attr_reader :update_request + + sig do + params( + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # KYC payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::OrHash, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::OrSymbol, + external_id: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol, + external_id: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) + ) + end + attr_reader :individual + + sig do + params( + individual: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).void + end + attr_writer :individual + + # Original request to update the account holder. + sig do + params( + individual: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).returns(T.attached_class) + end + def self.new( + # Information on the individual for whom the account is being opened and KYC is + # being run. + individual: nil + ) + end + + sig do + override.returns( + { + individual: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + ) + end + def to_hash + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # If applicable, represents the business account token associated with the + # account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # When the account_holder updated event was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # If applicable, represents the external_id associated with the account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # If applicable, represents the account_holder's first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # If applicable, represents the account_holder's last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # If applicable, represents the account_holder's business name. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Legacy payload for an updated account holder. + sig do + params( + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::OrSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # If applicable, represents the business account token associated with the + # account_holder. + business_account_token: nil, + # When the account_holder updated event was created + created: nil, + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + email: nil, + # The type of event that occurred. + event_type: nil, + # If applicable, represents the external_id associated with the account_holder. + external_id: nil, + # If applicable, represents the account_holder's first name. + first_name: nil, + # If applicable, represents the account_holder's last name. + last_name: nil, + # If applicable, represents the account_holder's business name. + legal_business_name: nil, + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + phone_number: nil + ) + end + + sig do + override.returns( + { + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + ) + end + def to_hash + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::AccountHolderUpdatedWebhookEvent::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/account_holder_verification_webhook_event.rbi b/rbi/lithic/models/account_holder_verification_webhook_event.rbi new file mode 100644 index 00000000..a8174be7 --- /dev/null +++ b/rbi/lithic/models/account_holder_verification_webhook_event.rbi @@ -0,0 +1,143 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderVerificationWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the account_holder being verified. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The token of the account being verified. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # When the account_holder verification status was updated + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # The status of the account_holder that was created + sig do + returns( + T.nilable( + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::AccountHolderVerificationWebhookEvent::Status::OrSymbol + ).void + end + attr_writer :status + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :status_reasons + + sig { params(status_reasons: T::Array[String]).void } + attr_writer :status_reasons + + sig do + params( + token: String, + account_token: String, + created: Time, + status: + Lithic::AccountHolderVerificationWebhookEvent::Status::OrSymbol, + status_reasons: T::Array[String], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder being verified. + token: nil, + # The token of the account being verified. + account_token: nil, + # When the account_holder verification status was updated + created: nil, + # The status of the account_holder that was created + status: nil, + status_reasons: nil, + # The type of event that occurred. + event_type: :"account_holder.verification" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + token: String, + account_token: String, + created: Time, + status: + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol, + status_reasons: T::Array[String] + } + ) + end + def to_hash + end + + # The status of the account_holder that was created + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountHolderVerificationWebhookEvent::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/asa_request_webhook_event.rbi b/rbi/lithic/models/asa_request_webhook_event.rbi new file mode 100644 index 00000000..b50ad86a --- /dev/null +++ b/rbi/lithic/models/asa_request_webhook_event.rbi @@ -0,0 +1,2229 @@ +# typed: strong + +module Lithic + module Models + class AsaRequestWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AsaRequestWebhookEvent, Lithic::Internal::AnyHash) + end + + # The provisional transaction group uuid associated with the authorization + sig { returns(String) } + attr_accessor :token + + # Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # zero if no fee is assessed. Rebates may be transmitted as a negative value to + # indicate credited fees. + sig { returns(Integer) } + attr_accessor :acquirer_fee + + # Authorization amount of the transaction (in cents), including any acquirer fees. + # The contents of this field are identical to `authorization_amount`. + sig { returns(Integer) } + attr_accessor :amount + + # The base transaction amount (in cents) plus the acquirer fee field. This is the + # amount the issuer should authorize against unless the issuer is paying the + # acquirer fee on behalf of the cardholder. + sig { returns(Integer) } + attr_accessor :authorization_amount + + sig { returns(Lithic::AsaRequestWebhookEvent::Avs) } + attr_reader :avs + + sig { params(avs: Lithic::AsaRequestWebhookEvent::Avs::OrHash).void } + attr_writer :avs + + # Card object in ASA + sig { returns(Lithic::AsaRequestWebhookEvent::Card) } + attr_reader :card + + sig { params(card: Lithic::AsaRequestWebhookEvent::Card::OrHash).void } + attr_writer :card + + # 3-character alphabetic ISO 4217 code for cardholder's billing currency. + sig { returns(String) } + attr_accessor :cardholder_currency + + # The portion of the transaction requested as cash back by the cardholder, and + # does not include any acquirer fees. The amount field includes the purchase + # amount, the requested cash back amount, and any acquirer fees. + # + # If no cash back was requested, the value of this field will be 0, and the field + # will always be present. + sig { returns(Integer) } + attr_accessor :cash_amount + + # Date and time when the transaction first occurred in UTC. + sig { returns(Time) } + attr_accessor :created + + sig { returns(Lithic::Merchant) } + attr_reader :merchant + + sig { params(merchant: Lithic::Merchant::OrHash).void } + attr_writer :merchant + + # The amount that the merchant will receive, denominated in `merchant_currency` + # and in the smallest currency unit. Note the amount includes `acquirer_fee`, + # similar to `authorization_amount`. It will be different from + # `authorization_amount` if the merchant is taking payment in a different + # currency. + sig { returns(Integer) } + attr_accessor :merchant_amount + + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + sig { returns(String) } + attr_accessor :merchant_currency + + # Amount (in cents) of the transaction that has been settled, including any + # acquirer fees + sig { returns(Integer) } + attr_accessor :settled_amount + + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + sig { returns(Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol) } + attr_accessor :status + + # The entity that initiated the transaction. + sig do + returns( + Lithic::AsaRequestWebhookEvent::TransactionInitiator::TaggedSymbol + ) + end + attr_accessor :transaction_initiator + + sig do + returns( + T.nilable(Lithic::AsaRequestWebhookEvent::AccountType::TaggedSymbol) + ) + end + attr_reader :account_type + + sig do + params( + account_type: Lithic::AsaRequestWebhookEvent::AccountType::OrSymbol + ).void + end + attr_writer :account_type + + sig { returns(T.nilable(Lithic::CardholderAuthentication)) } + attr_reader :cardholder_authentication + + sig do + params( + cardholder_authentication: Lithic::CardholderAuthentication::OrHash + ).void + end + attr_writer :cardholder_authentication + + # Deprecated, use `cash_amount`. + sig { returns(T.nilable(Integer)) } + attr_reader :cashback + + sig { params(cashback: Integer).void } + attr_writer :cashback + + # If the transaction was requested in a currency other than the settlement + # currency, this field will be populated to indicate the rate used to translate + # the merchant_amount to the amount (i.e., `merchant_amount` x `conversion_rate` = + # `amount`). Note that the `merchant_amount` is in the local currency and the + # amount is in the settlement currency. + sig { returns(T.nilable(Float)) } + attr_reader :conversion_rate + + sig { params(conversion_rate: Float).void } + attr_writer :conversion_rate + + # The event token associated with the authorization. This field is only set for + # programs enrolled into the beta. + sig { returns(T.nilable(String)) } + attr_reader :event_token + + sig { params(event_token: String).void } + attr_writer :event_token + + # Optional Object containing information if the Card is a part of a Fleet managed + # program + sig { returns(T.nilable(Lithic::AsaRequestWebhookEvent::FleetInfo)) } + attr_reader :fleet_info + + sig do + params( + fleet_info: + T.nilable(Lithic::AsaRequestWebhookEvent::FleetInfo::OrHash) + ).void + end + attr_writer :fleet_info + + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + sig do + returns(T.nilable(Lithic::AsaRequestWebhookEvent::LatestChallenge)) + end + attr_reader :latest_challenge + + sig do + params( + latest_challenge: + Lithic::AsaRequestWebhookEvent::LatestChallenge::OrHash + ).void + end + attr_writer :latest_challenge + + # Card network of the authorization. + sig do + returns( + T.nilable(Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol) + ) + end + attr_reader :network + + sig do + params(network: Lithic::AsaRequestWebhookEvent::Network::OrSymbol).void + end + attr_writer :network + + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + sig { returns(T.nilable(Integer)) } + attr_accessor :network_risk_score + + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + sig do + returns(T.nilable(Lithic::AsaRequestWebhookEvent::NetworkSpecificData)) + end + attr_reader :network_specific_data + + sig do + params( + network_specific_data: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::OrHash + ) + ).void + end + attr_writer :network_specific_data + + sig { returns(T.nilable(Lithic::AsaRequestWebhookEvent::Pos)) } + attr_reader :pos + + sig { params(pos: Lithic::AsaRequestWebhookEvent::Pos::OrHash).void } + attr_writer :pos + + sig { returns(T.nilable(Lithic::TokenInfo)) } + attr_reader :token_info + + sig { params(token_info: T.nilable(Lithic::TokenInfo::OrHash)).void } + attr_writer :token_info + + # Deprecated: approximate time-to-live for the authorization. + sig { returns(T.nilable(Time)) } + attr_reader :ttl + + sig { params(ttl: Time).void } + attr_writer :ttl + + # The Auth Stream Access request payload that was sent to the ASA responder. + sig do + params( + token: String, + acquirer_fee: Integer, + amount: Integer, + authorization_amount: Integer, + avs: Lithic::AsaRequestWebhookEvent::Avs::OrHash, + card: Lithic::AsaRequestWebhookEvent::Card::OrHash, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::Merchant::OrHash, + merchant_amount: Integer, + merchant_currency: String, + settled_amount: Integer, + status: Lithic::AsaRequestWebhookEvent::Status::OrSymbol, + transaction_initiator: + Lithic::AsaRequestWebhookEvent::TransactionInitiator::OrSymbol, + account_type: Lithic::AsaRequestWebhookEvent::AccountType::OrSymbol, + cardholder_authentication: Lithic::CardholderAuthentication::OrHash, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: + T.nilable(Lithic::AsaRequestWebhookEvent::FleetInfo::OrHash), + latest_challenge: + Lithic::AsaRequestWebhookEvent::LatestChallenge::OrHash, + network: Lithic::AsaRequestWebhookEvent::Network::OrSymbol, + network_risk_score: T.nilable(Integer), + network_specific_data: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::OrHash + ), + pos: Lithic::AsaRequestWebhookEvent::Pos::OrHash, + token_info: T.nilable(Lithic::TokenInfo::OrHash), + ttl: Time + ).returns(T.attached_class) + end + def self.new( + # The provisional transaction group uuid associated with the authorization + token:, + # Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # zero if no fee is assessed. Rebates may be transmitted as a negative value to + # indicate credited fees. + acquirer_fee:, + # Authorization amount of the transaction (in cents), including any acquirer fees. + # The contents of this field are identical to `authorization_amount`. + amount:, + # The base transaction amount (in cents) plus the acquirer fee field. This is the + # amount the issuer should authorize against unless the issuer is paying the + # acquirer fee on behalf of the cardholder. + authorization_amount:, + avs:, + # Card object in ASA + card:, + # 3-character alphabetic ISO 4217 code for cardholder's billing currency. + cardholder_currency:, + # The portion of the transaction requested as cash back by the cardholder, and + # does not include any acquirer fees. The amount field includes the purchase + # amount, the requested cash back amount, and any acquirer fees. + # + # If no cash back was requested, the value of this field will be 0, and the field + # will always be present. + cash_amount:, + # Date and time when the transaction first occurred in UTC. + created:, + merchant:, + # The amount that the merchant will receive, denominated in `merchant_currency` + # and in the smallest currency unit. Note the amount includes `acquirer_fee`, + # similar to `authorization_amount`. It will be different from + # `authorization_amount` if the merchant is taking payment in a different + # currency. + merchant_amount:, + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + merchant_currency:, + # Amount (in cents) of the transaction that has been settled, including any + # acquirer fees + settled_amount:, + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + status:, + # The entity that initiated the transaction. + transaction_initiator:, + account_type: nil, + cardholder_authentication: nil, + # Deprecated, use `cash_amount`. + cashback: nil, + # If the transaction was requested in a currency other than the settlement + # currency, this field will be populated to indicate the rate used to translate + # the merchant_amount to the amount (i.e., `merchant_amount` x `conversion_rate` = + # `amount`). Note that the `merchant_amount` is in the local currency and the + # amount is in the settlement currency. + conversion_rate: nil, + # The event token associated with the authorization. This field is only set for + # programs enrolled into the beta. + event_token: nil, + # Optional Object containing information if the Card is a part of a Fleet managed + # program + fleet_info: nil, + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + latest_challenge: nil, + # Card network of the authorization. + network: nil, + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + network_risk_score: nil, + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + network_specific_data: nil, + pos: nil, + token_info: nil, + # Deprecated: approximate time-to-live for the authorization. + ttl: nil + ) + end + + sig do + override.returns( + { + token: String, + acquirer_fee: Integer, + amount: Integer, + authorization_amount: Integer, + avs: Lithic::AsaRequestWebhookEvent::Avs, + card: Lithic::AsaRequestWebhookEvent::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::Merchant, + merchant_amount: Integer, + merchant_currency: String, + settled_amount: Integer, + status: Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol, + transaction_initiator: + Lithic::AsaRequestWebhookEvent::TransactionInitiator::TaggedSymbol, + account_type: + Lithic::AsaRequestWebhookEvent::AccountType::TaggedSymbol, + cardholder_authentication: Lithic::CardholderAuthentication, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: T.nilable(Lithic::AsaRequestWebhookEvent::FleetInfo), + latest_challenge: Lithic::AsaRequestWebhookEvent::LatestChallenge, + network: Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol, + network_risk_score: T.nilable(Integer), + network_specific_data: + T.nilable(Lithic::AsaRequestWebhookEvent::NetworkSpecificData), + pos: Lithic::AsaRequestWebhookEvent::Pos, + token_info: T.nilable(Lithic::TokenInfo), + ttl: Time + } + ) + end + def to_hash + end + + class Avs < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::Avs, + Lithic::Internal::AnyHash + ) + end + + # Cardholder address + sig { returns(String) } + attr_accessor :address + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + sig do + returns( + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol + ) + end + attr_accessor :address_on_file_match + + # Cardholder ZIP code + sig { returns(String) } + attr_accessor :zipcode + + sig do + params( + address: String, + address_on_file_match: + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::OrSymbol, + zipcode: String + ).returns(T.attached_class) + end + def self.new( + # Cardholder address + address:, + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + address_on_file_match:, + # Cardholder ZIP code + zipcode: + ) + end + + sig do + override.returns( + { + address: String, + address_on_file_match: + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol, + zipcode: String + } + ) + end + def to_hash + end + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MATCH = + T.let( + :MATCH, + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol + ) + MATCH_ADDRESS_ONLY = + T.let( + :MATCH_ADDRESS_ONLY, + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol + ) + MATCH_ZIP_ONLY = + T.let( + :MATCH_ZIP_ONLY, + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol + ) + MISMATCH = + T.let( + :MISMATCH, + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Avs::AddressOnFileMatch::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Card < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::Card, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the card. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Hostname of card’s locked merchant (will be empty if not applicable) + sig { returns(T.nilable(String)) } + attr_reader :hostname + + sig { params(hostname: String).void } + attr_writer :hostname + + # Last four digits of the card number + sig { returns(T.nilable(String)) } + attr_reader :last_four + + sig { params(last_four: String).void } + attr_writer :last_four + + # Customizable name to identify the card. We recommend against using this field to + # store JSON data as it can cause unexpected behavior. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Amount (in cents) to limit approved authorizations. Purchase requests above the + # spend limit will be declined (refunds and credits will be approved). + # + # Note that while spend limits are enforced based on authorized and settled volume + # on a card, they are not recommended to be used for balance or + # reconciliation-level accuracy. Spend limits also cannot block force posted + # charges (i.e., when a merchant sends a clearing message without a prior + # authorization). + sig { returns(T.nilable(Integer)) } + attr_reader :spend_limit + + sig { params(spend_limit: Integer).void } + attr_writer :spend_limit + + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + sig do + returns( + T.nilable( + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol + ) + ) + end + attr_reader :spend_limit_duration + + sig do + params( + spend_limit_duration: + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::OrSymbol + ).void + end + attr_writer :spend_limit_duration + + sig do + returns( + T.nilable(Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol) + ) + end + attr_reader :state + + sig do + params( + state: Lithic::AsaRequestWebhookEvent::Card::State::OrSymbol + ).void + end + attr_writer :state + + sig do + returns( + T.nilable(Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol) + ) + end + attr_reader :type + + sig do + params( + type: Lithic::AsaRequestWebhookEvent::Card::Type::OrSymbol + ).void + end + attr_writer :type + + # Card object in ASA + sig do + params( + token: String, + hostname: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::OrSymbol, + state: Lithic::AsaRequestWebhookEvent::Card::State::OrSymbol, + type: Lithic::AsaRequestWebhookEvent::Card::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the card. + token: nil, + # Hostname of card’s locked merchant (will be empty if not applicable) + hostname: nil, + # Last four digits of the card number + last_four: nil, + # Customizable name to identify the card. We recommend against using this field to + # store JSON data as it can cause unexpected behavior. + memo: nil, + # Amount (in cents) to limit approved authorizations. Purchase requests above the + # spend limit will be declined (refunds and credits will be approved). + # + # Note that while spend limits are enforced based on authorized and settled volume + # on a card, they are not recommended to be used for balance or + # reconciliation-level accuracy. Spend limits also cannot block force posted + # charges (i.e., when a merchant sends a clearing message without a prior + # authorization). + spend_limit: nil, + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + spend_limit_duration: nil, + state: nil, + type: nil + ) + end + + sig do + override.returns( + { + token: String, + hostname: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol, + state: Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol, + type: Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUALLY = + T.let( + :ANNUALLY, + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol + ) + FOREVER = + T.let( + :FOREVER, + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol + ) + MONTHLY = + T.let( + :MONTHLY, + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol + ) + TRANSACTION = + T.let( + :TRANSACTION, + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Card::SpendLimitDuration::TaggedSymbol + ] + ) + end + def self.values + end + end + + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AsaRequestWebhookEvent::Card::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLOSED = + T.let( + :CLOSED, + Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol + ) + OPEN = + T.let( + :OPEN, + Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol + ) + PENDING_ACTIVATION = + T.let( + :PENDING_ACTIVATION, + Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol + ) + PENDING_FULFILLMENT = + T.let( + :PENDING_FULFILLMENT, + Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Card::State::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AsaRequestWebhookEvent::Card::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SINGLE_USE = + T.let( + :SINGLE_USE, + Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol + ) + MERCHANT_LOCKED = + T.let( + :MERCHANT_LOCKED, + Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol + ) + UNLOCKED = + T.let( + :UNLOCKED, + Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol + ) + PHYSICAL = + T.let( + :PHYSICAL, + Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol + ) + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol + ) + VIRTUAL = + T.let( + :VIRTUAL, + Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AsaRequestWebhookEvent::Card::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AsaRequestWebhookEvent::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol + ) + CREDIT_AUTHORIZATION = + T.let( + :CREDIT_AUTHORIZATION, + Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol + ) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol + ) + BALANCE_INQUIRY = + T.let( + :BALANCE_INQUIRY, + Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AsaRequestWebhookEvent::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # The entity that initiated the transaction. + module TransactionInitiator + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AsaRequestWebhookEvent::TransactionInitiator) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARDHOLDER = + T.let( + :CARDHOLDER, + Lithic::AsaRequestWebhookEvent::TransactionInitiator::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::AsaRequestWebhookEvent::TransactionInitiator::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AsaRequestWebhookEvent::TransactionInitiator::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::TransactionInitiator::TaggedSymbol + ] + ) + end + def self.values + end + end + + module AccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AsaRequestWebhookEvent::AccountType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::AsaRequestWebhookEvent::AccountType::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::AsaRequestWebhookEvent::AccountType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AsaRequestWebhookEvent::AccountType::TaggedSymbol] + ) + end + def self.values + end + end + + class FleetInfo < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::FleetInfo, + Lithic::Internal::AnyHash + ) + end + + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + sig do + returns( + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode::TaggedSymbol + ) + end + attr_accessor :fleet_prompt_code + + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + sig do + returns( + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode::TaggedSymbol + ) + end + attr_accessor :fleet_restriction_code + + # Number representing the driver + sig { returns(T.nilable(String)) } + attr_accessor :driver_number + + # Number associated with the vehicle + sig { returns(T.nilable(String)) } + attr_accessor :vehicle_number + + # Optional Object containing information if the Card is a part of a Fleet managed + # program + sig do + params( + fleet_prompt_code: + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode::OrSymbol, + fleet_restriction_code: + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode::OrSymbol, + driver_number: T.nilable(String), + vehicle_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + fleet_prompt_code:, + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + fleet_restriction_code:, + # Number representing the driver + driver_number: nil, + # Number associated with the vehicle + vehicle_number: nil + ) + end + + sig do + override.returns( + { + fleet_prompt_code: + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode::TaggedSymbol, + fleet_restriction_code: + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode::TaggedSymbol, + driver_number: T.nilable(String), + vehicle_number: T.nilable(String) + } + ) + end + def to_hash + end + + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + module FleetPromptCode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NO_PROMPT = + T.let( + :NO_PROMPT, + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode::TaggedSymbol + ) + VEHICLE_NUMBER = + T.let( + :VEHICLE_NUMBER, + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode::TaggedSymbol + ) + DRIVER_NUMBER = + T.let( + :DRIVER_NUMBER, + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetPromptCode::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + module FleetRestrictionCode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NO_RESTRICTIONS = + T.let( + :NO_RESTRICTIONS, + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode::TaggedSymbol + ) + FUEL_ONLY = + T.let( + :FUEL_ONLY, + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::FleetInfo::FleetRestrictionCode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LatestChallenge < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::LatestChallenge, + Lithic::Internal::AnyHash + ) + end + + # The phone number used for sending Authorization Challenge SMS. + sig { returns(String) } + attr_accessor :phone_number + + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + sig do + returns( + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The date and time when the Authorization Challenge was completed in UTC. Present + # only if the status is `COMPLETED`. + sig { returns(T.nilable(Time)) } + attr_reader :completed_at + + sig { params(completed_at: Time).void } + attr_writer :completed_at + + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + sig do + params( + phone_number: String, + status: + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::OrSymbol, + completed_at: Time + ).returns(T.attached_class) + end + def self.new( + # The phone number used for sending Authorization Challenge SMS. + phone_number:, + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + status:, + # The date and time when the Authorization Challenge was completed in UTC. Present + # only if the status is `COMPLETED`. + completed_at: nil + ) + end + + sig do + override.returns( + { + phone_number: String, + status: + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::TaggedSymbol, + completed_at: Time + } + ) + end + def to_hash + end + + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPLETED = + T.let( + :COMPLETED, + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :EXPIRED, + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::LatestChallenge::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Card network of the authorization. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AsaRequestWebhookEvent::Network) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMEX = + T.let(:AMEX, Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol) + INTERLINK = + T.let( + :INTERLINK, + Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol + ) + MAESTRO = + T.let(:MAESTRO, Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol) + MASTERCARD = + T.let( + :MASTERCARD, + Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol + ) + UNKNOWN = + T.let(:UNKNOWN, Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol) + VISA = + T.let(:VISA, Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AsaRequestWebhookEvent::Network::TaggedSymbol] + ) + end + def self.values + end + end + + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard + ) + ) + end + attr_reader :mastercard + + sig do + params( + mastercard: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OrHash + ) + ).void + end + attr_writer :mastercard + + sig do + returns( + T.nilable(Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa) + ) + end + attr_reader :visa + + sig do + params( + visa: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa::OrHash + ) + ).void + end + attr_writer :visa + + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + sig do + params( + mastercard: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OrHash + ), + visa: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa::OrHash + ) + ).returns(T.attached_class) + end + def self.new(mastercard: nil, visa: nil) + end + + sig do + override.returns( + { + mastercard: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard + ), + visa: + T.nilable( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa + ) + } + ) + end + def to_hash + end + + class Mastercard < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard, + Lithic::Internal::AnyHash + ) + end + + # Indicates the electronic commerce security level and UCAF collection. + sig { returns(T.nilable(String)) } + attr_accessor :ecommerce_security_level_indicator + + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult + ] + ) + ) + end + attr_accessor :on_behalf_service_result + + # Indicates the type of additional transaction purpose. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_type_identifier + + sig do + params( + ecommerce_security_level_indicator: T.nilable(String), + on_behalf_service_result: + T.nilable( + T::Array[ + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult::OrHash + ] + ), + transaction_type_identifier: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Indicates the electronic commerce security level and UCAF collection. + ecommerce_security_level_indicator: nil, + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + on_behalf_service_result: nil, + # Indicates the type of additional transaction purpose. + transaction_type_identifier: nil + ) + end + + sig do + override.returns( + { + ecommerce_security_level_indicator: T.nilable(String), + on_behalf_service_result: + T.nilable( + T::Array[ + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult + ] + ), + transaction_type_identifier: T.nilable(String) + } + ) + end + def to_hash + end + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult, + Lithic::Internal::AnyHash + ) + end + + # Indicates the results of the service processing. + sig { returns(String) } + attr_accessor :result_1 + + # Identifies the results of the service processing. + sig { returns(String) } + attr_accessor :result_2 + + # Indicates the service performed on the transaction. + sig { returns(String) } + attr_accessor :service + + sig do + params( + result_1: String, + result_2: String, + service: String + ).returns(T.attached_class) + end + def self.new( + # Indicates the results of the service processing. + result_1:, + # Identifies the results of the service processing. + result_2:, + # Indicates the service performed on the transaction. + service: + ) + end + + sig do + override.returns( + { result_1: String, result_2: String, service: String } + ) + end + def to_hash + end + end + end + + class Visa < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa, + Lithic::Internal::AnyHash + ) + end + + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + sig { returns(T.nilable(String)) } + attr_accessor :business_application_identifier + + sig do + params(business_application_identifier: T.nilable(String)).returns( + T.attached_class + ) + end + def self.new( + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + business_application_identifier: nil + ) + end + + sig do + override.returns( + { business_application_identifier: T.nilable(String) } + ) + end + def to_hash + end + end + end + + class Pos < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::Pos, + Lithic::Internal::AnyHash + ) + end + + # POS > Entry Mode object in ASA + sig do + returns(T.nilable(Lithic::AsaRequestWebhookEvent::Pos::EntryMode)) + end + attr_reader :entry_mode + + sig do + params( + entry_mode: Lithic::AsaRequestWebhookEvent::Pos::EntryMode::OrHash + ).void + end + attr_writer :entry_mode + + sig do + returns(T.nilable(Lithic::AsaRequestWebhookEvent::Pos::Terminal)) + end + attr_reader :terminal + + sig do + params( + terminal: Lithic::AsaRequestWebhookEvent::Pos::Terminal::OrHash + ).void + end + attr_writer :terminal + + sig do + params( + entry_mode: Lithic::AsaRequestWebhookEvent::Pos::EntryMode::OrHash, + terminal: Lithic::AsaRequestWebhookEvent::Pos::Terminal::OrHash + ).returns(T.attached_class) + end + def self.new( + # POS > Entry Mode object in ASA + entry_mode: nil, + terminal: nil + ) + end + + sig do + override.returns( + { + entry_mode: Lithic::AsaRequestWebhookEvent::Pos::EntryMode, + terminal: Lithic::AsaRequestWebhookEvent::Pos::Terminal + } + ) + end + def to_hash + end + + class EntryMode < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::Pos::EntryMode, + Lithic::Internal::AnyHash + ) + end + + # Card Presence Indicator + sig do + returns( + T.nilable( + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::TaggedSymbol + ) + ) + end + attr_reader :card + + sig do + params( + card: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::OrSymbol + ).void + end + attr_writer :card + + # Cardholder Presence Indicator + sig do + returns( + T.nilable( + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + ) + end + attr_reader :cardholder + + sig do + params( + cardholder: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::OrSymbol + ).void + end + attr_writer :cardholder + + # Method of entry for the PAN + sig do + returns( + T.nilable( + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + ) + end + attr_reader :pan + + sig do + params( + pan: Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::OrSymbol + ).void + end + attr_writer :pan + + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :pin_entered + + sig { params(pin_entered: T::Boolean).void } + attr_writer :pin_entered + + # POS > Entry Mode object in ASA + sig do + params( + card: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::OrSymbol, + cardholder: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::OrSymbol, + pan: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::OrSymbol, + pin_entered: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Card Presence Indicator + card: nil, + # Cardholder Presence Indicator + cardholder: nil, + # Method of entry for the PAN + pan: nil, + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + pin_entered: nil + ) + end + + sig do + override.returns( + { + card: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::TaggedSymbol, + cardholder: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol, + pan: + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol, + pin_entered: T::Boolean + } + ) + end + def to_hash + end + + # Card Presence Indicator + module Card + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRESENT = + T.let( + :PRESENT, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Card::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Cardholder Presence Indicator + module Cardholder + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEFERRED_BILLING = + T.let( + :DEFERRED_BILLING, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + ELECTRONIC_ORDER = + T.let( + :ELECTRONIC_ORDER, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + INSTALLMENT = + T.let( + :INSTALLMENT, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + MAIL_ORDER = + T.let( + :MAIL_ORDER, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + PRESENT = + T.let( + :PRESENT, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + REOCCURRING = + T.let( + :REOCCURRING, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + TELEPHONE_ORDER = + T.let( + :TELEPHONE_ORDER, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Cardholder::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Method of entry for the PAN + module Pan + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTO_ENTRY = + T.let( + :AUTO_ENTRY, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + BAR_CODE = + T.let( + :BAR_CODE, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + CONTACTLESS = + T.let( + :CONTACTLESS, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + ERROR_KEYED = + T.let( + :ERROR_KEYED, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + ERROR_MAGNETIC_STRIPE = + T.let( + :ERROR_MAGNETIC_STRIPE, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + ICC = + T.let( + :ICC, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + KEY_ENTERED = + T.let( + :KEY_ENTERED, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + MAGNETIC_STRIPE = + T.let( + :MAGNETIC_STRIPE, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + MANUAL = + T.let( + :MANUAL, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + OCR = + T.let( + :OCR, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + SECURE_CARDLESS = + T.let( + :SECURE_CARDLESS, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + CREDENTIAL_ON_FILE = + T.let( + :CREDENTIAL_ON_FILE, + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Pos::EntryMode::Pan::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Terminal < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AsaRequestWebhookEvent::Pos::Terminal, + Lithic::Internal::AnyHash + ) + end + + # True if a clerk is present at the sale. + sig { returns(T::Boolean) } + attr_accessor :attended + + # True if the terminal is capable of retaining the card. + sig { returns(T::Boolean) } + attr_accessor :card_retention_capable + + # True if the sale was made at the place of business (vs. mobile). + sig { returns(T::Boolean) } + attr_accessor :on_premise + + # The person that is designated to swipe the card + sig do + returns( + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::TaggedSymbol + ) + end + attr_accessor :operator + + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + sig { returns(T::Boolean) } + attr_accessor :partial_approval_capable + + # Status of whether the POS is able to accept PINs + sig do + returns( + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::TaggedSymbol + ) + end + attr_accessor :pin_capability + + # POS Type + sig do + returns( + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems. Left justified with trailing spaces. + sig { returns(T.nilable(String)) } + attr_accessor :acceptor_terminal_id + + sig do + params( + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::OrSymbol, + partial_approval_capable: T::Boolean, + pin_capability: + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::OrSymbol, + type: + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::OrSymbol, + acceptor_terminal_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # True if a clerk is present at the sale. + attended:, + # True if the terminal is capable of retaining the card. + card_retention_capable:, + # True if the sale was made at the place of business (vs. mobile). + on_premise:, + # The person that is designated to swipe the card + operator:, + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + partial_approval_capable:, + # Status of whether the POS is able to accept PINs + pin_capability:, + # POS Type + type:, + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems. Left justified with trailing spaces. + acceptor_terminal_id: nil + ) + end + + sig do + override.returns( + { + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::TaggedSymbol, + partial_approval_capable: T::Boolean, + pin_capability: + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::TaggedSymbol, + type: + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol, + acceptor_terminal_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The person that is designated to swipe the card + module Operator + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADMINISTRATIVE = + T.let( + :ADMINISTRATIVE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::TaggedSymbol + ) + CARDHOLDER = + T.let( + :CARDHOLDER, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::TaggedSymbol + ) + CARD_ACCEPTOR = + T.let( + :CARD_ACCEPTOR, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Operator::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status of whether the POS is able to accept PINs + module PinCapability + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CAPABLE = + T.let( + :CAPABLE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::TaggedSymbol + ) + INOPERATIVE = + T.let( + :INOPERATIVE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::TaggedSymbol + ) + NOT_CAPABLE = + T.let( + :NOT_CAPABLE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Pos::Terminal::PinCapability::TaggedSymbol + ] + ) + end + def self.values + end + end + + # POS Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADMINISTRATIVE = + T.let( + :ADMINISTRATIVE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + ATM = + T.let( + :ATM, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + COUPON_MACHINE = + T.let( + :COUPON_MACHINE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + DIAL_TERMINAL = + T.let( + :DIAL_TERMINAL, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + ECR = + T.let( + :ECR, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + FUEL_MACHINE = + T.let( + :FUEL_MACHINE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + HOME_TERMINAL = + T.let( + :HOME_TERMINAL, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + MICR = + T.let( + :MICR, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + OFF_PREMISE = + T.let( + :OFF_PREMISE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + PAYMENT = + T.let( + :PAYMENT, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + PDA = + T.let( + :PDA, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + PHONE = + T.let( + :PHONE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + POINT = + T.let( + :POINT, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + POS_TERMINAL = + T.let( + :POS_TERMINAL, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + PUBLIC_UTILITY = + T.let( + :PUBLIC_UTILITY, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + SELF_SERVICE = + T.let( + :SELF_SERVICE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + TELEVISION = + T.let( + :TELEVISION, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + TELLER = + T.let( + :TELLER, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + TRAVELERS_CHECK_MACHINE = + T.let( + :TRAVELERS_CHECK_MACHINE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + VENDING = + T.let( + :VENDING, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + VOICE = + T.let( + :VOICE, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AsaRequestWebhookEvent::Pos::Terminal::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules_backtest_report_created_webhook_event.rbi b/rbi/lithic/models/auth_rules_backtest_report_created_webhook_event.rbi new file mode 100644 index 00000000..ceedce00 --- /dev/null +++ b/rbi/lithic/models/auth_rules_backtest_report_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class AuthRulesBacktestReportCreatedWebhookEvent < Lithic::Models::AuthRules::V2::BacktestResults + OrHash = + T.type_alias do + T.any( + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"auth_rules.backtest_report.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/balance_updated_webhook_event.rbi b/rbi/lithic/models/balance_updated_webhook_event.rbi new file mode 100644 index 00000000..3b279ea0 --- /dev/null +++ b/rbi/lithic/models/balance_updated_webhook_event.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class BalanceUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::BalanceUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + sig { returns(T::Array[Lithic::FinancialAccountBalance]) } + attr_accessor :data + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig do + params( + data: T::Array[Lithic::FinancialAccountBalance::OrHash], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + data:, + # The type of event that occurred. + event_type: :"balance.updated" + ) + end + + sig do + override.returns( + { + data: T::Array[Lithic::FinancialAccountBalance], + event_type: Symbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_transaction_created_webhook_event.rbi b/rbi/lithic/models/book_transfer_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..bc907e6d --- /dev/null +++ b/rbi/lithic/models/book_transfer_transaction_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class BookTransferTransactionCreatedWebhookEvent < Lithic::Models::BookTransferResponse + OrHash = + T.type_alias do + T.any( + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Book transfer transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"book_transfer_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_transaction_updated_webhook_event.rbi b/rbi/lithic/models/book_transfer_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..73a80459 --- /dev/null +++ b/rbi/lithic/models/book_transfer_transaction_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class BookTransferTransactionUpdatedWebhookEvent < Lithic::Models::BookTransferResponse + OrHash = + T.type_alias do + T.any( + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Book transfer transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"book_transfer_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_converted_webhook_event.rbi b/rbi/lithic/models/card_converted_webhook_event.rbi new file mode 100644 index 00000000..b0c57a65 --- /dev/null +++ b/rbi/lithic/models/card_converted_webhook_event.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class CardConvertedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardConvertedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the card that was created. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig do + params(card_token: String, event_type: Symbol).returns(T.attached_class) + end + def self.new( + # The token of the card that was created. + card_token:, + # The type of event that occurred. + event_type: :"card.converted" + ) + end + + sig { override.returns({ card_token: String, event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_created_webhook_event.rbi b/rbi/lithic/models/card_created_webhook_event.rbi new file mode 100644 index 00000000..5e70e353 --- /dev/null +++ b/rbi/lithic/models/card_created_webhook_event.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Lithic + module Models + class CardCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardCreatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the card that was created. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the card that was replaced, if the new card is a replacement card. + sig { returns(T.nilable(String)) } + attr_accessor :replacement_for + + sig do + params( + card_token: String, + replacement_for: T.nilable(String), + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card that was created. + card_token:, + # The token of the card that was replaced, if the new card is a replacement card. + replacement_for: nil, + # The type of event that occurred. + event_type: :"card.created" + ) + end + + sig do + override.returns( + { + card_token: String, + event_type: Symbol, + replacement_for: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_reissued_webhook_event.rbi b/rbi/lithic/models/card_reissued_webhook_event.rbi new file mode 100644 index 00000000..7ce6bf66 --- /dev/null +++ b/rbi/lithic/models/card_reissued_webhook_event.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class CardReissuedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardReissuedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the card that was reissued. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + sig do + params(card_token: String, event_type: Symbol).returns(T.attached_class) + end + def self.new( + # The token of the card that was reissued. + card_token: nil, + # The type of event that occurred. + event_type: :"card.reissued" + ) + end + + sig { override.returns({ event_type: Symbol, card_token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_renewed_webhook_event.rbi b/rbi/lithic/models/card_renewed_webhook_event.rbi new file mode 100644 index 00000000..22320f32 --- /dev/null +++ b/rbi/lithic/models/card_renewed_webhook_event.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Lithic + module Models + class CardRenewedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardRenewedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the card that was renewed. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # The new expiration month of the card. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # The new expiration year of the card. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # The previous expiration month of the card. + sig { returns(T.nilable(String)) } + attr_reader :previous_exp_month + + sig { params(previous_exp_month: String).void } + attr_writer :previous_exp_month + + # The previous expiration year of the card. + sig { returns(T.nilable(String)) } + attr_reader :previous_exp_year + + sig { params(previous_exp_year: String).void } + attr_writer :previous_exp_year + + sig do + params( + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card that was renewed. + card_token: nil, + # The new expiration month of the card. + exp_month: nil, + # The new expiration year of the card. + exp_year: nil, + # The previous expiration month of the card. + previous_exp_month: nil, + # The previous expiration year of the card. + previous_exp_year: nil, + # The type of event that occurred. + event_type: :"card.renewed" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_shipped_webhook_event.rbi b/rbi/lithic/models/card_shipped_webhook_event.rbi new file mode 100644 index 00000000..41bbbe53 --- /dev/null +++ b/rbi/lithic/models/card_shipped_webhook_event.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module Lithic + module Models + class CardShippedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardShippedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the bulk order associated with this card shipment, if applicable. + sig { returns(T.nilable(String)) } + attr_accessor :bulk_order_token + + # The token of the card that was shipped. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The specific shipping method used to ship the card. + sig do + returns(Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol) + end + attr_accessor :shipping_method + + # The tracking number of the shipment. + sig { returns(T.nilable(String)) } + attr_accessor :tracking_number + + sig do + params( + bulk_order_token: T.nilable(String), + card_token: String, + shipping_method: + Lithic::CardShippedWebhookEvent::ShippingMethod::OrSymbol, + tracking_number: T.nilable(String), + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the bulk order associated with this card shipment, if applicable. + bulk_order_token:, + # The token of the card that was shipped. + card_token:, + # The specific shipping method used to ship the card. + shipping_method:, + # The tracking number of the shipment. + tracking_number:, + # The type of event that occurred. + event_type: :"card.shipped" + ) + end + + sig do + override.returns( + { + bulk_order_token: T.nilable(String), + card_token: String, + event_type: Symbol, + shipping_method: + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol, + tracking_number: T.nilable(String) + } + ) + end + def to_hash + end + + # The specific shipping method used to ship the card. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardShippedWebhookEvent::ShippingMethod) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EX_US_EXPEDITED_WITH_TRACKING = + T.let( + :"Ex-US expedited with tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + EX_US_STANDARD_WITH_TRACKING = + T.let( + :"Ex-US standard with tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + EX_US_STANDARD_WITHOUT_TRACKING = + T.let( + :"Ex-US standard without tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + FED_EX_2_DAYS = + T.let( + :"FedEx 2 days", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + FED_EX_EXPRESS = + T.let( + :"FedEx express", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + FED_EX_OVERNIGHT = + T.let( + :"FedEx overnight", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_PRIORITY = + T.let( + :"USPS priority", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITH_TRACKING = + T.let( + :"USPS with tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITHOUT_TRACKING_ENVELOPE = + T.let( + :"USPS without tracking envelope", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITHOUT_TRACKING_ENVELOPE_NON_MACHINE = + T.let( + :"USPS without tracking envelope non-machine", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITHOUT_TRACKING_FLAT = + T.let( + :"USPS without tracking flat", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbi b/rbi/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbi new file mode 100644 index 00000000..386a934b --- /dev/null +++ b/rbi/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class CardTransactionEnhancedDataCreatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + OrHash = + T.type_alias do + T.any( + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"card_transaction.enhanced_data.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbi b/rbi/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbi new file mode 100644 index 00000000..db3945ed --- /dev/null +++ b/rbi/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class CardTransactionEnhancedDataUpdatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + OrHash = + T.type_alias do + T.any( + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"card_transaction.enhanced_data.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_transaction_updated_webhook_event.rbi b/rbi/lithic/models/card_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..f407237c --- /dev/null +++ b/rbi/lithic/models/card_transaction_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class CardTransactionUpdatedWebhookEvent < Lithic::Models::Transaction + OrHash = + T.type_alias do + T.any( + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"card_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_token_metadata.rbi b/rbi/lithic/models/digital_wallet_token_metadata.rbi index f84ef27d..db80faf5 100644 --- a/rbi/lithic/models/digital_wallet_token_metadata.rbi +++ b/rbi/lithic/models/digital_wallet_token_metadata.rbi @@ -40,7 +40,7 @@ module Lithic sig do returns( T.nilable( - Lithic::DigitalWalletTokenMetadata::TokenRequestorName::OrSymbol + Lithic::DigitalWalletTokenMetadata::TokenRequestorName::TaggedSymbol ) ) end @@ -90,7 +90,7 @@ module Lithic payment_app_instance_id: T.nilable(String), token_requestor_id: String, token_requestor_name: - Lithic::DigitalWalletTokenMetadata::TokenRequestorName::OrSymbol + Lithic::DigitalWalletTokenMetadata::TokenRequestorName::TaggedSymbol } ) end diff --git a/rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi new file mode 100644 index 00000000..5cbc69fe --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi @@ -0,0 +1,548 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # Contains the metadata for the customer tokenization decision. + sig do + returns( + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ) + ) + end + attr_reader :customer_tokenization_decision + + sig do + params( + customer_tokenization_decision: + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ) + ).void + end + attr_writer :customer_tokenization_decision + + # The name of this event + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + end + attr_accessor :event_type + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + end + attr_accessor :issuer_decision + + # The channel through which the tokenization was made. + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + end + attr_accessor :tokenization_channel + + # Unique identifier for the digital wallet token attempt + sig { returns(String) } + attr_accessor :tokenization_token + + sig { returns(Lithic::WalletDecisioningInfo) } + attr_reader :wallet_decisioning_info + + sig do + params( + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash + ).void + end + attr_writer :wallet_decisioning_info + + sig { returns(T.nilable(Lithic::Device)) } + attr_reader :device + + sig { params(device: Lithic::Device::OrHash).void } + attr_writer :device + + # Contains the metadata for the digital wallet being tokenized. + sig { returns(T.nilable(Lithic::DigitalWalletTokenMetadata)) } + attr_reader :digital_wallet_token_metadata + + sig do + params( + digital_wallet_token_metadata: + Lithic::DigitalWalletTokenMetadata::OrHash + ).void + end + attr_writer :digital_wallet_token_metadata + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # List of reasons why the tokenization was declined + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_decline_reasons + + sig do + params( + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol] + ).void + end + attr_writer :tokenization_decline_reasons + + # The source of the tokenization. + sig do + returns( + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + ) + end + attr_reader :tokenization_source + + sig do + params( + tokenization_source: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol + ).void + end + attr_writer :tokenization_source + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + sig do + params( + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ), + event_type: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::OrSymbol, + issuer_decision: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::OrSymbol, + tokenization_channel: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::OrSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash, + device: Lithic::Device::OrHash, + digital_wallet_token_metadata: + Lithic::DigitalWalletTokenMetadata::OrHash, + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol], + tokenization_source: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Contains the metadata for the customer tokenization decision. + customer_tokenization_decision:, + # The name of this event + event_type:, + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + issuer_decision:, + # The channel through which the tokenization was made. + tokenization_channel:, + # Unique identifier for the digital wallet token attempt + tokenization_token:, + wallet_decisioning_info:, + device: nil, + # Contains the metadata for the digital wallet being tokenized. + digital_wallet_token_metadata: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # List of reasons why the tokenization was declined + tokenization_decline_reasons: nil, + # The source of the tokenization. + tokenization_source: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ), + event_type: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol, + issuer_decision: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol, + tokenization_channel: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + rule_results: T::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol], + tokenization_source: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol] + } + ) + end + def to_hash + end + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, + Lithic::Internal::AnyHash + ) + end + + # The outcome of the customer's decision + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + end + attr_accessor :outcome + + # The customer's subscribed URL + sig { returns(String) } + attr_accessor :responder_url + + # Time in ms it took for the customer's URL to respond + sig { returns(T.nilable(String)) } + attr_reader :latency + + sig { params(latency: String).void } + attr_writer :latency + + # The response code that the customer provided + sig { returns(T.nilable(String)) } + attr_reader :response_code + + sig { params(response_code: String).void } + attr_writer :response_code + + # Contains the metadata for the customer tokenization decision. + sig do + params( + outcome: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::OrSymbol, + responder_url: String, + latency: String, + response_code: String + ).returns(T.attached_class) + end + def self.new( + # The outcome of the customer's decision + outcome:, + # The customer's subscribed URL + responder_url:, + # Time in ms it took for the customer's URL to respond + latency: nil, + # The response code that the customer provided + response_code: nil + ) + end + + sig do + override.returns( + { + outcome: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol, + responder_url: String, + latency: String, + response_code: String + } + ) + end + def to_hash + end + + # The outcome of the customer's decision + module Outcome + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + INVALID_RESPONSE = + T.let( + :INVALID_RESPONSE, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let( + :REQUIRE_ADDITIONAL_AUTHENTICATION, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + TIMEOUT = + T.let( + :TIMEOUT, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The name of this event + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + module IssuerDecision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + DENIED = + T.let( + :DENIED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + VERIFICATION_REQUIRED = + T.let( + :VERIFICATION_REQUIRED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The source of the tokenization. + module TokenizationSource + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_ON_FILE = + T.let( + :ACCOUNT_ON_FILE, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + CONTACTLESS_TAP = + T.let( + :CONTACTLESS_TAP, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + MANUAL_PROVISION = + T.let( + :MANUAL_PROVISION, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + PUSH_PROVISION = + T.let( + :PUSH_PROVISION, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + TOKEN = + T.let( + :TOKEN, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_result_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_result_webhook_event.rbi new file mode 100644 index 00000000..a76e6dcd --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_result_webhook_event.rbi @@ -0,0 +1,295 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The result of the tokenization request. + sig do + returns( + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails + ) + end + attr_reader :tokenization_result_details + + sig do + params( + tokenization_result_details: + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::OrHash + ).void + end + attr_writer :tokenization_result_details + + # Tokenization token + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::OrHash, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + # The result of the tokenization request. + tokenization_result_details:, + # Tokenization token + tokenization_token:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_result" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_result_details: + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + ) + end + def to_hash + end + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + Lithic::Internal::AnyHash + ) + end + + # Lithic's tokenization decision. + sig { returns(String) } + attr_accessor :issuer_decision + + # List of reasons why the tokenization was declined + sig do + returns( + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + attr_accessor :tokenization_decline_reasons + + # The customer's tokenization decision if applicable. + sig { returns(T.nilable(String)) } + attr_accessor :customer_decision + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # An RFC 3339 timestamp indicating when the tokenization succeeded. + sig { returns(T.nilable(Time)) } + attr_accessor :token_activated_date_time + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + # The wallet's recommended decision. + sig { returns(T.nilable(String)) } + attr_accessor :wallet_decision + + # The result of the tokenization request. + sig do + params( + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::OrSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol], + wallet_decision: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Lithic's tokenization decision. + issuer_decision:, + # List of reasons why the tokenization was declined + tokenization_decline_reasons:, + # The customer's tokenization decision if applicable. + customer_decision: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # An RFC 3339 timestamp indicating when the tokenization succeeded. + token_activated_date_time: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil, + # The wallet's recommended decision. + wallet_decision: nil + ) + end + + sig do + override.returns( + { + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol], + wallet_decision: T.nilable(String) + } + ) + end + def to_hash + end + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let( + :ACCOUNT_SCORE_1, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CVC_MISMATCH = + T.let( + :CVC_MISMATCH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + DEVICE_SCORE_1 = + T.let( + :DEVICE_SCORE_1, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + GENERIC_DECLINE = + T.let( + :GENERIC_DECLINE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let( + :NETWORK_FAILURE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbi new file mode 100644 index 00000000..8a956c05 --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbi @@ -0,0 +1,186 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbi new file mode 100644 index 00000000..1604bad6 --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Authentication code to provide to the user tokenizing a card. + sig { returns(String) } + attr_accessor :authentication_code + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Authentication code to provide to the user tokenizing a card. + authentication_code:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_two_factor_authentication_code" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbi new file mode 100644 index 00000000..db29e929 --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { returns(Lithic::Tokenization) } + attr_reader :tokenization + + sig { params(tokenization: Lithic::Tokenization::OrHash).void } + attr_writer :tokenization + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization::OrHash, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + tokenization:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_updated" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization: Lithic::Tokenization + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_evidence_upload_failed_webhook_event.rbi b/rbi/lithic/models/dispute_evidence_upload_failed_webhook_event.rbi new file mode 100644 index 00000000..9d5a9cee --- /dev/null +++ b/rbi/lithic/models/dispute_evidence_upload_failed_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class DisputeEvidenceUploadFailedWebhookEvent < Lithic::Models::DisputeEvidence + OrHash = + T.type_alias do + T.any( + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Dispute evidence. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute_evidence.upload_failed" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_transaction_created_webhook_event.rbi b/rbi/lithic/models/dispute_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..f400b372 --- /dev/null +++ b/rbi/lithic/models/dispute_transaction_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class DisputeTransactionCreatedWebhookEvent < Lithic::Models::DisputeV2 + OrHash = + T.type_alias do + T.any( + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_transaction_updated_webhook_event.rbi b/rbi/lithic/models/dispute_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..124ee2c6 --- /dev/null +++ b/rbi/lithic/models/dispute_transaction_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class DisputeTransactionUpdatedWebhookEvent < Lithic::Models::DisputeV2 + OrHash = + T.type_alias do + T.any( + Lithic::DisputeTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_updated_webhook_event.rbi b/rbi/lithic/models/dispute_updated_webhook_event.rbi new file mode 100644 index 00000000..5227b6b2 --- /dev/null +++ b/rbi/lithic/models/dispute_updated_webhook_event.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Models + class DisputeUpdatedWebhookEvent < Lithic::Models::Dispute + OrHash = + T.type_alias do + T.any(Lithic::DisputeUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Dispute. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_created_webhook_event.rbi b/rbi/lithic/models/external_bank_account_created_webhook_event.rbi new file mode 100644 index 00000000..3c526c6f --- /dev/null +++ b/rbi/lithic/models/external_bank_account_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountCreatedWebhookEvent < Lithic::Models::ExternalBankAccount + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_bank_account.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_updated_webhook_event.rbi b/rbi/lithic/models/external_bank_account_updated_webhook_event.rbi new file mode 100644 index 00000000..ecb319bf --- /dev/null +++ b/rbi/lithic/models/external_bank_account_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountUpdatedWebhookEvent < Lithic::Models::ExternalBankAccount + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_bank_account.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_payment_created_webhook_event.rbi b/rbi/lithic/models/external_payment_created_webhook_event.rbi new file mode 100644 index 00000000..7f5d3276 --- /dev/null +++ b/rbi/lithic/models/external_payment_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentCreatedWebhookEvent < Lithic::Models::ExternalPayment + OrHash = + T.type_alias do + T.any( + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_payment.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_payment_updated_webhook_event.rbi b/rbi/lithic/models/external_payment_updated_webhook_event.rbi new file mode 100644 index 00000000..5a8b1a53 --- /dev/null +++ b/rbi/lithic/models/external_payment_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentUpdatedWebhookEvent < Lithic::Models::ExternalPayment + OrHash = + T.type_alias do + T.any( + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_payment.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/financial_account_created_webhook_event.rbi b/rbi/lithic/models/financial_account_created_webhook_event.rbi new file mode 100644 index 00000000..1db1bf15 --- /dev/null +++ b/rbi/lithic/models/financial_account_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountCreatedWebhookEvent < Lithic::Models::FinancialAccount + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"financial_account.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/financial_account_updated_webhook_event.rbi b/rbi/lithic/models/financial_account_updated_webhook_event.rbi new file mode 100644 index 00000000..e344e13b --- /dev/null +++ b/rbi/lithic/models/financial_account_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountUpdatedWebhookEvent < Lithic::Models::FinancialAccount + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"financial_account.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/funding_event_created_webhook_event.rbi b/rbi/lithic/models/funding_event_created_webhook_event.rbi new file mode 100644 index 00000000..8d623160 --- /dev/null +++ b/rbi/lithic/models/funding_event_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class FundingEventCreatedWebhookEvent < Lithic::Models::FundingEvent + OrHash = + T.type_alias do + T.any( + Lithic::FundingEventCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"funding_event.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/internal_transaction.rbi b/rbi/lithic/models/internal_transaction.rbi index 1fa282f5..705afccd 100644 --- a/rbi/lithic/models/internal_transaction.rbi +++ b/rbi/lithic/models/internal_transaction.rbi @@ -11,7 +11,7 @@ module Lithic sig { returns(String) } attr_accessor :token - sig { returns(Lithic::InternalTransactionAPI::Category::OrSymbol) } + sig { returns(Lithic::InternalTransactionAPI::Category::TaggedSymbol) } attr_accessor :category sig { returns(Time) } @@ -29,13 +29,13 @@ module Lithic sig { returns(Integer) } attr_accessor :pending_amount - sig { returns(Lithic::InternalTransactionAPI::Result::OrSymbol) } + sig { returns(Lithic::InternalTransactionAPI::Result::TaggedSymbol) } attr_accessor :result sig { returns(Integer) } attr_accessor :settled_amount - sig { returns(Lithic::InternalTransactionAPI::Status::OrSymbol) } + sig { returns(Lithic::InternalTransactionAPI::Status::TaggedSymbol) } attr_accessor :status sig { returns(Time) } @@ -75,15 +75,15 @@ module Lithic override.returns( { token: String, - category: Lithic::InternalTransactionAPI::Category::OrSymbol, + category: Lithic::InternalTransactionAPI::Category::TaggedSymbol, created: Time, currency: String, descriptor: String, events: T::Array[Lithic::InternalTransactionAPI::Event], pending_amount: Integer, - result: Lithic::InternalTransactionAPI::Result::OrSymbol, + result: Lithic::InternalTransactionAPI::Result::TaggedSymbol, settled_amount: Integer, - status: Lithic::InternalTransactionAPI::Status::OrSymbol, + status: Lithic::InternalTransactionAPI::Status::TaggedSymbol, updated: Time } ) @@ -133,10 +133,14 @@ module Lithic sig { returns(Time) } attr_accessor :created - sig { returns(Lithic::InternalTransactionAPI::Event::Result::OrSymbol) } + sig do + returns(Lithic::InternalTransactionAPI::Event::Result::TaggedSymbol) + end attr_accessor :result - sig { returns(Lithic::InternalTransactionAPI::Event::Type::OrSymbol) } + sig do + returns(Lithic::InternalTransactionAPI::Event::Type::TaggedSymbol) + end attr_accessor :type sig do @@ -157,8 +161,9 @@ module Lithic token: String, amount: Integer, created: Time, - result: Lithic::InternalTransactionAPI::Event::Result::OrSymbol, - type: Lithic::InternalTransactionAPI::Event::Type::OrSymbol + result: + Lithic::InternalTransactionAPI::Event::Result::TaggedSymbol, + type: Lithic::InternalTransactionAPI::Event::Type::TaggedSymbol } ) end diff --git a/rbi/lithic/models/internal_transaction_created_webhook_event.rbi b/rbi/lithic/models/internal_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..dfd1f13d --- /dev/null +++ b/rbi/lithic/models/internal_transaction_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class InternalTransactionCreatedWebhookEvent < Lithic::Models::InternalTransactionAPI + OrHash = + T.type_alias do + T.any( + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"internal_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/internal_transaction_updated_webhook_event.rbi b/rbi/lithic/models/internal_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..3db382c6 --- /dev/null +++ b/rbi/lithic/models/internal_transaction_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class InternalTransactionUpdatedWebhookEvent < Lithic::Models::InternalTransactionAPI + OrHash = + T.type_alias do + T.any( + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"internal_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/loan_tape_created_webhook_event.rbi b/rbi/lithic/models/loan_tape_created_webhook_event.rbi new file mode 100644 index 00000000..11b172d8 --- /dev/null +++ b/rbi/lithic/models/loan_tape_created_webhook_event.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class LoanTapeCreatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + OrHash = + T.type_alias do + T.any(Lithic::LoanTapeCreatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"loan_tape.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/loan_tape_updated_webhook_event.rbi b/rbi/lithic/models/loan_tape_updated_webhook_event.rbi new file mode 100644 index 00000000..910b1934 --- /dev/null +++ b/rbi/lithic/models/loan_tape_updated_webhook_event.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class LoanTapeUpdatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + OrHash = + T.type_alias do + T.any(Lithic::LoanTapeUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"loan_tape.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/management_operation_created_webhook_event.rbi b/rbi/lithic/models/management_operation_created_webhook_event.rbi new file mode 100644 index 00000000..71e6c48c --- /dev/null +++ b/rbi/lithic/models/management_operation_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationCreatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"management_operation.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/management_operation_updated_webhook_event.rbi b/rbi/lithic/models/management_operation_updated_webhook_event.rbi new file mode 100644 index 00000000..4e80252a --- /dev/null +++ b/rbi/lithic/models/management_operation_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationUpdatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"management_operation.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/network_total_created_webhook_event.rbi b/rbi/lithic/models/network_total_created_webhook_event.rbi new file mode 100644 index 00000000..51aee723 --- /dev/null +++ b/rbi/lithic/models/network_total_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class NetworkTotalCreatedWebhookEvent < Lithic::Models::NetworkTotal + OrHash = + T.type_alias do + T.any( + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"network_total.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/network_total_updated_webhook_event.rbi b/rbi/lithic/models/network_total_updated_webhook_event.rbi new file mode 100644 index 00000000..889ce294 --- /dev/null +++ b/rbi/lithic/models/network_total_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class NetworkTotalUpdatedWebhookEvent < Lithic::Models::NetworkTotal + OrHash = + T.type_alias do + T.any( + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"network_total.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/parsed_webhook_event.rbi b/rbi/lithic/models/parsed_webhook_event.rbi new file mode 100644 index 00000000..e85e39f8 --- /dev/null +++ b/rbi/lithic/models/parsed_webhook_event.rbi @@ -0,0 +1,1310 @@ +# typed: strong + +module Lithic + module Models + # KYB payload for an updated account holder. + module ParsedWebhookEvent + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::AsaRequestWebhookEvent, + Lithic::TokenizationDecisioningRequestWebhookEvent, + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::BalanceUpdatedWebhookEvent, + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::CardCreatedWebhookEvent, + Lithic::CardConvertedWebhookEvent, + Lithic::CardRenewedWebhookEvent, + Lithic::CardReissuedWebhookEvent, + Lithic::CardShippedWebhookEvent, + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::DisputeUpdatedWebhookEvent, + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::FundingEventCreatedWebhookEvent, + Lithic::LoanTapeCreatedWebhookEvent, + Lithic::LoanTapeUpdatedWebhookEvent, + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::StatementsCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::TokenizationResultWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::ThreeDSAuthentication, + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::DisputeTransactionUpdatedWebhookEvent + ) + end + + class KYBPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig { returns(Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest) } + attr_reader :update_request + + sig do + params( + update_request: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::ParsedWebhookEvent::KYBPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Short description of the company's line of business (i.e., what does the company + # do?). + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # KYB payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::OrHash, + event_type: + Lithic::ParsedWebhookEvent::KYBPayload::EventType::OrSymbol, + external_id: String, + nature_of_business: String, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # Short description of the company's line of business (i.e., what does the company + # do?). + nature_of_business: nil, + # Company website URL. + website_url: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + event_type: + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol, + external_id: String, + nature_of_business: String, + website_url: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # Deprecated. + sig { returns(T.nilable(T::Array[Lithic::KYBBusinessEntity])) } + attr_reader :beneficial_owner_entities + + sig do + params( + beneficial_owner_entities: + T::Array[Lithic::KYBBusinessEntity::OrHash] + ).void + end + attr_writer :beneficial_owner_entities + + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(T.nilable(Lithic::KYBBusinessEntity)) } + attr_reader :business_entity + + sig do + params(business_entity: Lithic::KYBBusinessEntity::OrHash).void + end + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # Original request to update the account holder. + sig do + params( + beneficial_owner_entities: + T::Array[Lithic::KYBBusinessEntity::OrHash], + beneficial_owner_individuals: + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ], + business_entity: Lithic::KYBBusinessEntity::OrHash, + control_person: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).returns(T.attached_class) + end + def self.new( + # Deprecated. + beneficial_owner_entities: nil, + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity: nil, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person: nil + ) + end + + sig do + override.returns( + { + beneficial_owner_entities: T::Array[Lithic::KYBBusinessEntity], + beneficial_owner_individuals: + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ], + business_entity: Lithic::KYBBusinessEntity, + control_person: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ParsedWebhookEvent::KYBPayload::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig { returns(Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest) } + attr_reader :update_request + + sig do + params( + update_request: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::ParsedWebhookEvent::KYCPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # KYC payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::OrHash, + event_type: + Lithic::ParsedWebhookEvent::KYCPayload::EventType::OrSymbol, + external_id: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + event_type: + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol, + external_id: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) + ) + end + attr_reader :individual + + sig do + params( + individual: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).void + end + attr_writer :individual + + # Original request to update the account holder. + sig do + params( + individual: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).returns(T.attached_class) + end + def self.new( + # Information on the individual for whom the account is being opened and KYC is + # being run. + individual: nil + ) + end + + sig do + override.returns( + { + individual: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + ) + end + def to_hash + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ParsedWebhookEvent::KYCPayload::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # If applicable, represents the business account token associated with the + # account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # When the account_holder updated event was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # If applicable, represents the external_id associated with the account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # If applicable, represents the account_holder's first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # If applicable, represents the account_holder's last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # If applicable, represents the account_holder's business name. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Legacy payload for an updated account holder. + sig do + params( + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::OrSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # If applicable, represents the business account token associated with the + # account_holder. + business_account_token: nil, + # When the account_holder updated event was created + created: nil, + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + email: nil, + # The type of event that occurred. + event_type: nil, + # If applicable, represents the external_id associated with the account_holder. + external_id: nil, + # If applicable, represents the account_holder's first name. + first_name: nil, + # If applicable, represents the account_holder's last name. + last_name: nil, + # If applicable, represents the account_holder's business name. + legal_business_name: nil, + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + phone_number: nil + ) + end + + sig do + override.returns( + { + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + ) + end + def to_hash + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ParsedWebhookEvent::LegacyPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig { override.returns(T::Array[Lithic::ParsedWebhookEvent::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/payment_transaction_created_webhook_event.rbi b/rbi/lithic/models/payment_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..2034ecaa --- /dev/null +++ b/rbi/lithic/models/payment_transaction_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class PaymentTransactionCreatedWebhookEvent < Lithic::Models::Payment + OrHash = + T.type_alias do + T.any( + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Payment transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"payment_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_transaction_updated_webhook_event.rbi b/rbi/lithic/models/payment_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..6ea2c419 --- /dev/null +++ b/rbi/lithic/models/payment_transaction_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class PaymentTransactionUpdatedWebhookEvent < Lithic::Models::Payment + OrHash = + T.type_alias do + T.any( + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Payment transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"payment_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/settlement_report_updated_webhook_event.rbi b/rbi/lithic/models/settlement_report_updated_webhook_event.rbi new file mode 100644 index 00000000..53aae0ad --- /dev/null +++ b/rbi/lithic/models/settlement_report_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class SettlementReportUpdatedWebhookEvent < Lithic::Models::SettlementReport + OrHash = + T.type_alias do + T.any( + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"settlement_report.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/statements_created_webhook_event.rbi b/rbi/lithic/models/statements_created_webhook_event.rbi new file mode 100644 index 00000000..195bdbb1 --- /dev/null +++ b/rbi/lithic/models/statements_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class StatementsCreatedWebhookEvent < Lithic::Models::FinancialAccounts::Statement + OrHash = + T.type_alias do + T.any( + Lithic::StatementsCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"statements.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication_challenge_webhook_event.rbi b/rbi/lithic/models/three_ds_authentication_challenge_webhook_event.rbi new file mode 100644 index 00000000..48c3b5e9 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication_challenge_webhook_event.rbi @@ -0,0 +1,175 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthenticationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Represents a 3DS authentication + sig { returns(Lithic::ThreeDSAuthentication) } + attr_reader :authentication_object + + sig do + params( + authentication_object: Lithic::ThreeDSAuthentication::OrHash + ).void + end + attr_writer :authentication_object + + # Represents a challenge object for 3DS authentication + sig do + returns(Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge) + end + attr_reader :challenge + + sig do + params( + challenge: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::OrHash + ).void + end + attr_writer :challenge + + sig { returns(Symbol) } + attr_accessor :event_type + + sig do + params( + authentication_object: Lithic::ThreeDSAuthentication::OrHash, + challenge: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::OrHash, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Represents a 3DS authentication + authentication_object:, + # Represents a challenge object for 3DS authentication + challenge:, + event_type: :"three_ds_authentication.challenge" + ) + end + + sig do + override.returns( + { + authentication_object: Lithic::ThreeDSAuthentication, + challenge: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + event_type: Symbol + } + ) + end + def to_hash + end + + class Challenge < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + Lithic::Internal::AnyHash + ) + end + + # The type of challenge method issued to the cardholder + sig do + returns( + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol + ) + end + attr_accessor :challenge_method_type + + # ISO-8601 time at which the challenge expires + sig { returns(Time) } + attr_accessor :expiry_time + + # ISO-8601 time at which the challenge has started + sig { returns(Time) } + attr_accessor :start_time + + # Fully qualified app URL of the merchant app. This should be used to redirect the + # cardholder back to the merchant app after completing an app-based challenge. + # This URL will only be populated if the 3DS Requestor App is provided to the 3DS + # SDK. + sig { returns(T.nilable(String)) } + attr_accessor :app_requestor_url + + # Represents a challenge object for 3DS authentication + sig do + params( + challenge_method_type: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::OrSymbol, + expiry_time: Time, + start_time: Time, + app_requestor_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The type of challenge method issued to the cardholder + challenge_method_type:, + # ISO-8601 time at which the challenge expires + expiry_time:, + # ISO-8601 time at which the challenge has started + start_time:, + # Fully qualified app URL of the merchant app. This should be used to redirect the + # cardholder back to the merchant app after completing an app-based challenge. + # This URL will only be populated if the 3DS Requestor App is provided to the 3DS + # SDK. + app_requestor_url: nil + ) + end + + sig do + override.returns( + { + challenge_method_type: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol, + expiry_time: Time, + start_time: Time, + app_requestor_url: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of challenge method issued to the cardholder + module ChallengeMethodType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OUT_OF_BAND = + T.let( + :OUT_OF_BAND, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication_created_webhook_event.rbi b/rbi/lithic/models/three_ds_authentication_created_webhook_event.rbi new file mode 100644 index 00000000..bdb5ff54 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthenticationCreatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Represents a 3DS authentication + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"three_ds_authentication.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication_updated_webhook_event.rbi b/rbi/lithic/models/three_ds_authentication_updated_webhook_event.rbi new file mode 100644 index 00000000..7de3e565 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthenticationUpdatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Represents a 3DS authentication + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"three_ds_authentication.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_approval_request_webhook_event.rbi b/rbi/lithic/models/tokenization_approval_request_webhook_event.rbi new file mode 100644 index 00000000..f94ec837 --- /dev/null +++ b/rbi/lithic/models/tokenization_approval_request_webhook_event.rbi @@ -0,0 +1,548 @@ +# typed: strong + +module Lithic + module Models + class TokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # Contains the metadata for the customer tokenization decision. + sig do + returns( + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ) + ) + end + attr_reader :customer_tokenization_decision + + sig do + params( + customer_tokenization_decision: + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ) + ).void + end + attr_writer :customer_tokenization_decision + + # The name of this event + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + end + attr_accessor :event_type + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + end + attr_accessor :issuer_decision + + # The channel through which the tokenization was made. + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + end + attr_accessor :tokenization_channel + + # Unique identifier for the digital wallet token attempt + sig { returns(String) } + attr_accessor :tokenization_token + + sig { returns(Lithic::WalletDecisioningInfo) } + attr_reader :wallet_decisioning_info + + sig do + params( + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash + ).void + end + attr_writer :wallet_decisioning_info + + sig { returns(T.nilable(Lithic::Device)) } + attr_reader :device + + sig { params(device: Lithic::Device::OrHash).void } + attr_writer :device + + # Contains the metadata for the digital wallet being tokenized. + sig { returns(T.nilable(Lithic::DigitalWalletTokenMetadata)) } + attr_reader :digital_wallet_token_metadata + + sig do + params( + digital_wallet_token_metadata: + Lithic::DigitalWalletTokenMetadata::OrHash + ).void + end + attr_writer :digital_wallet_token_metadata + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # List of reasons why the tokenization was declined + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_decline_reasons + + sig do + params( + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol] + ).void + end + attr_writer :tokenization_decline_reasons + + # The source of the tokenization. + sig do + returns( + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + ) + end + attr_reader :tokenization_source + + sig do + params( + tokenization_source: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol + ).void + end + attr_writer :tokenization_source + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + sig do + params( + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ), + event_type: + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::OrSymbol, + issuer_decision: + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::OrSymbol, + tokenization_channel: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::OrSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash, + device: Lithic::Device::OrHash, + digital_wallet_token_metadata: + Lithic::DigitalWalletTokenMetadata::OrHash, + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol], + tokenization_source: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Contains the metadata for the customer tokenization decision. + customer_tokenization_decision:, + # The name of this event + event_type:, + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + issuer_decision:, + # The channel through which the tokenization was made. + tokenization_channel:, + # Unique identifier for the digital wallet token attempt + tokenization_token:, + wallet_decisioning_info:, + device: nil, + # Contains the metadata for the digital wallet being tokenized. + digital_wallet_token_metadata: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # List of reasons why the tokenization was declined + tokenization_decline_reasons: nil, + # The source of the tokenization. + tokenization_source: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ), + event_type: + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol, + issuer_decision: + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol, + tokenization_channel: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + rule_results: T::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol], + tokenization_source: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol] + } + ) + end + def to_hash + end + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, + Lithic::Internal::AnyHash + ) + end + + # The outcome of the customer's decision + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + end + attr_accessor :outcome + + # The customer's subscribed URL + sig { returns(String) } + attr_accessor :responder_url + + # Time in ms it took for the customer's URL to respond + sig { returns(T.nilable(String)) } + attr_reader :latency + + sig { params(latency: String).void } + attr_writer :latency + + # The response code that the customer provided + sig { returns(T.nilable(String)) } + attr_reader :response_code + + sig { params(response_code: String).void } + attr_writer :response_code + + # Contains the metadata for the customer tokenization decision. + sig do + params( + outcome: + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::OrSymbol, + responder_url: String, + latency: String, + response_code: String + ).returns(T.attached_class) + end + def self.new( + # The outcome of the customer's decision + outcome:, + # The customer's subscribed URL + responder_url:, + # Time in ms it took for the customer's URL to respond + latency: nil, + # The response code that the customer provided + response_code: nil + ) + end + + sig do + override.returns( + { + outcome: + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol, + responder_url: String, + latency: String, + response_code: String + } + ) + end + def to_hash + end + + # The outcome of the customer's decision + module Outcome + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + INVALID_RESPONSE = + T.let( + :INVALID_RESPONSE, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let( + :REQUIRE_ADDITIONAL_AUTHENTICATION, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + TIMEOUT = + T.let( + :TIMEOUT, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The name of this event + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + module IssuerDecision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + DENIED = + T.let( + :DENIED, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + VERIFICATION_REQUIRED = + T.let( + :VERIFICATION_REQUIRED, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The source of the tokenization. + module TokenizationSource + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_ON_FILE = + T.let( + :ACCOUNT_ON_FILE, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + CONTACTLESS_TAP = + T.let( + :CONTACTLESS_TAP, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + MANUAL_PROVISION = + T.let( + :MANUAL_PROVISION, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + PUSH_PROVISION = + T.let( + :PUSH_PROVISION, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + TOKEN = + T.let( + :TOKEN, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_decisioning_request_webhook_event.rbi b/rbi/lithic/models/tokenization_decisioning_request_webhook_event.rbi new file mode 100644 index 00000000..90e45f3b --- /dev/null +++ b/rbi/lithic/models/tokenization_decisioning_request_webhook_event.rbi @@ -0,0 +1,333 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDecisioningRequestWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationDecisioningRequestWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The name of this event + sig do + returns( + Lithic::TokenizationDecisioningRequestWebhookEvent::EventType::TaggedSymbol + ) + end + attr_accessor :event_type + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + sig do + returns( + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + end + attr_accessor :issuer_decision + + # The channel through which the tokenization was made. + sig do + returns( + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + end + attr_accessor :tokenization_channel + + # Unique identifier for the digital wallet token attempt + sig { returns(String) } + attr_accessor :tokenization_token + + sig { returns(Lithic::WalletDecisioningInfo) } + attr_reader :wallet_decisioning_info + + sig do + params( + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash + ).void + end + attr_writer :wallet_decisioning_info + + sig { returns(T.nilable(Lithic::Device)) } + attr_reader :device + + sig { params(device: Lithic::Device::OrHash).void } + attr_writer :device + + # Contains the metadata for the digital wallet being tokenized. + sig { returns(T.nilable(Lithic::DigitalWalletTokenMetadata)) } + attr_reader :digital_wallet_token_metadata + + sig do + params( + digital_wallet_token_metadata: + Lithic::DigitalWalletTokenMetadata::OrHash + ).void + end + attr_writer :digital_wallet_token_metadata + + # The source of the tokenization. + sig do + returns( + T.nilable( + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + ) + end + attr_reader :tokenization_source + + sig do + params( + tokenization_source: + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::OrSymbol + ).void + end + attr_writer :tokenization_source + + # A webhook for tokenization decisioning sent to the customer's responder endpoint + sig do + params( + account_token: String, + card_token: String, + created: Time, + event_type: + Lithic::TokenizationDecisioningRequestWebhookEvent::EventType::OrSymbol, + issuer_decision: + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision::OrSymbol, + tokenization_channel: + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel::OrSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash, + device: Lithic::Device::OrHash, + digital_wallet_token_metadata: + Lithic::DigitalWalletTokenMetadata::OrHash, + tokenization_source: + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # The name of this event + event_type:, + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + issuer_decision:, + # The channel through which the tokenization was made. + tokenization_channel:, + # Unique identifier for the digital wallet token attempt + tokenization_token:, + wallet_decisioning_info:, + device: nil, + # Contains the metadata for the digital wallet being tokenized. + digital_wallet_token_metadata: nil, + # The source of the tokenization. + tokenization_source: nil + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: + Lithic::TokenizationDecisioningRequestWebhookEvent::EventType::TaggedSymbol, + issuer_decision: + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision::TaggedSymbol, + tokenization_channel: + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel::TaggedSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + tokenization_source: + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + } + ) + end + def to_hash + end + + # The name of this event + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationDecisioningRequestWebhookEvent::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::TokenizationDecisioningRequestWebhookEvent::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationDecisioningRequestWebhookEvent::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + module IssuerDecision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + DENIED = + T.let( + :DENIED, + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + VERIFICATION_REQUIRED = + T.let( + :VERIFICATION_REQUIRED, + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationDecisioningRequestWebhookEvent::IssuerDecision::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The source of the tokenization. + module TokenizationSource + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_ON_FILE = + T.let( + :ACCOUNT_ON_FILE, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + CONTACTLESS_TAP = + T.let( + :CONTACTLESS_TAP, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + MANUAL_PROVISION = + T.let( + :MANUAL_PROVISION, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + PUSH_PROVISION = + T.let( + :PUSH_PROVISION, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + TOKEN = + T.let( + :TOKEN, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationDecisioningRequestWebhookEvent::TokenizationSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_result_webhook_event.rbi b/rbi/lithic/models/tokenization_result_webhook_event.rbi new file mode 100644 index 00000000..40b5f190 --- /dev/null +++ b/rbi/lithic/models/tokenization_result_webhook_event.rbi @@ -0,0 +1,295 @@ +# typed: strong + +module Lithic + module Models + class TokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationResultWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The result of the tokenization request. + sig do + returns( + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails + ) + end + attr_reader :tokenization_result_details + + sig do + params( + tokenization_result_details: + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::OrHash + ).void + end + attr_writer :tokenization_result_details + + # Tokenization token + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::OrHash, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + # The result of the tokenization request. + tokenization_result_details:, + # Tokenization token + tokenization_token:, + # The type of event that occurred. + event_type: :"tokenization.result" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_result_details: + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + ) + end + def to_hash + end + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + Lithic::Internal::AnyHash + ) + end + + # Lithic's tokenization decision. + sig { returns(String) } + attr_accessor :issuer_decision + + # List of reasons why the tokenization was declined + sig do + returns( + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + attr_accessor :tokenization_decline_reasons + + # The customer's tokenization decision if applicable. + sig { returns(T.nilable(String)) } + attr_accessor :customer_decision + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # An RFC 3339 timestamp indicating when the tokenization succeeded. + sig { returns(T.nilable(Time)) } + attr_accessor :token_activated_date_time + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + # The wallet's recommended decision. + sig { returns(T.nilable(String)) } + attr_accessor :wallet_decision + + # The result of the tokenization request. + sig do + params( + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::OrSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol], + wallet_decision: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Lithic's tokenization decision. + issuer_decision:, + # List of reasons why the tokenization was declined + tokenization_decline_reasons:, + # The customer's tokenization decision if applicable. + customer_decision: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # An RFC 3339 timestamp indicating when the tokenization succeeded. + token_activated_date_time: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil, + # The wallet's recommended decision. + wallet_decision: nil + ) + end + + sig do + override.returns( + { + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol], + wallet_decision: T.nilable(String) + } + ) + end + def to_hash + end + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let( + :ACCOUNT_SCORE_1, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CVC_MISMATCH = + T.let( + :CVC_MISMATCH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + DEVICE_SCORE_1 = + T.let( + :DEVICE_SCORE_1, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + GENERIC_DECLINE = + T.let( + :GENERIC_DECLINE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let( + :NETWORK_FAILURE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbi b/rbi/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbi new file mode 100644 index 00000000..83259f17 --- /dev/null +++ b/rbi/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbi @@ -0,0 +1,186 @@ +# typed: strong + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"tokenization.two_factor_authentication_code_sent" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbi b/rbi/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbi new file mode 100644 index 00000000..2bc789e3 --- /dev/null +++ b/rbi/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Authentication code to provide to the user tokenizing a card. + sig { returns(String) } + attr_accessor :authentication_code + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Authentication code to provide to the user tokenizing a card. + authentication_code:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"tokenization.two_factor_authentication_code" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_updated_webhook_event.rbi b/rbi/lithic/models/tokenization_updated_webhook_event.rbi new file mode 100644 index 00000000..dbebf045 --- /dev/null +++ b/rbi/lithic/models/tokenization_updated_webhook_event.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Lithic + module Models + class TokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { returns(Lithic::Tokenization) } + attr_reader :tokenization + + sig { params(tokenization: Lithic::Tokenization::OrHash).void } + attr_writer :tokenization + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization::OrHash, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + tokenization:, + # The type of event that occurred. + event_type: :"tokenization.updated" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization: Lithic::Tokenization + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/webhook_parsed_params.rbi b/rbi/lithic/models/webhook_parsed_params.rbi new file mode 100644 index 00000000..4d4b5b39 --- /dev/null +++ b/rbi/lithic/models/webhook_parsed_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class WebhookParsedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::WebhookParsedParams, Lithic::Internal::AnyHash) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/resources/webhooks.rbi b/rbi/lithic/resources/webhooks.rbi new file mode 100644 index 00000000..19d31b07 --- /dev/null +++ b/rbi/lithic/resources/webhooks.rbi @@ -0,0 +1,158 @@ +# typed: strong + +module Lithic + module Resources + class Webhooks + sig do + params( + payload: String, + headers: T::Hash[String, String], + secret: T.nilable(String) + ).returns( + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::AsaRequestWebhookEvent, + Lithic::TokenizationDecisioningRequestWebhookEvent, + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::BalanceUpdatedWebhookEvent, + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::CardCreatedWebhookEvent, + Lithic::CardConvertedWebhookEvent, + Lithic::CardRenewedWebhookEvent, + Lithic::CardReissuedWebhookEvent, + Lithic::CardShippedWebhookEvent, + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::DisputeUpdatedWebhookEvent, + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::FundingEventCreatedWebhookEvent, + Lithic::LoanTapeCreatedWebhookEvent, + Lithic::LoanTapeUpdatedWebhookEvent, + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::StatementsCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::TokenizationResultWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::ThreeDSAuthentication, + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::DisputeTransactionUpdatedWebhookEvent + ) + ) + end + def parse(payload, headers:, secret: nil) + end + + sig do + params(payload: String).returns( + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::AsaRequestWebhookEvent, + Lithic::TokenizationDecisioningRequestWebhookEvent, + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::BalanceUpdatedWebhookEvent, + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::CardCreatedWebhookEvent, + Lithic::CardConvertedWebhookEvent, + Lithic::CardRenewedWebhookEvent, + Lithic::CardReissuedWebhookEvent, + Lithic::CardShippedWebhookEvent, + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::DisputeUpdatedWebhookEvent, + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::FundingEventCreatedWebhookEvent, + Lithic::LoanTapeCreatedWebhookEvent, + Lithic::LoanTapeUpdatedWebhookEvent, + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::StatementsCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::TokenizationResultWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::ThreeDSAuthentication, + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::DisputeTransactionUpdatedWebhookEvent + ) + ) + end + def parse_unsafe(payload) + end + + sig do + params( + payload: String, + headers: T::Hash[String, String], + secret: T.nilable(String) + ).returns(T::Hash[Symbol, T.untyped]) + end + def verify_signature(payload:, headers:, secret: nil) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/sig/lithic/client.rbs b/sig/lithic/client.rbs index f309397d..9cc1e433 100644 --- a/sig/lithic/client.rbs +++ b/sig/lithic/client.rbs @@ -79,6 +79,8 @@ module Lithic attr_reader account_activity: Lithic::Resources::AccountActivity + attr_reader webhooks: Lithic::Resources::Webhooks + def api_status: ( ?request_options: Lithic::request_opts ) -> Lithic::APIStatus diff --git a/sig/lithic/models.rbs b/sig/lithic/models.rbs index bffa68d2..573c6180 100644 --- a/sig/lithic/models.rbs +++ b/sig/lithic/models.rbs @@ -9,8 +9,12 @@ module Lithic class AccountHolder = Lithic::Models::AccountHolder + class AccountHolderCreatedWebhookEvent = Lithic::Models::AccountHolderCreatedWebhookEvent + class AccountHolderCreateParams = Lithic::Models::AccountHolderCreateParams + class AccountHolderDocumentUpdatedWebhookEvent = Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent + class AccountHolderListDocumentsParams = Lithic::Models::AccountHolderListDocumentsParams class AccountHolderListParams = Lithic::Models::AccountHolderListParams @@ -23,10 +27,14 @@ module Lithic class AccountHolderSimulateEnrollmentReviewParams = Lithic::Models::AccountHolderSimulateEnrollmentReviewParams + module AccountHolderUpdatedWebhookEvent = Lithic::Models::AccountHolderUpdatedWebhookEvent + class AccountHolderUpdateParams = Lithic::Models::AccountHolderUpdateParams class AccountHolderUploadDocumentParams = Lithic::Models::AccountHolderUploadDocumentParams + class AccountHolderVerificationWebhookEvent = Lithic::Models::AccountHolderVerificationWebhookEvent + class AccountListParams = Lithic::Models::AccountListParams class AccountRetrieveParams = Lithic::Models::AccountRetrieveParams @@ -47,8 +55,12 @@ module Lithic class APIStatus = Lithic::Models::APIStatus + class AsaRequestWebhookEvent = Lithic::Models::AsaRequestWebhookEvent + module AuthRules = Lithic::Models::AuthRules + class AuthRulesBacktestReportCreatedWebhookEvent = Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent + class AuthStreamEnrollmentRetrieveSecretParams = Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams class AuthStreamEnrollmentRotateSecretParams = Lithic::Models::AuthStreamEnrollmentRotateSecretParams @@ -59,6 +71,8 @@ module Lithic class BalanceListParams = Lithic::Models::BalanceListParams + class BalanceUpdatedWebhookEvent = Lithic::Models::BalanceUpdatedWebhookEvent + class BookTransferCreateParams = Lithic::Models::BookTransferCreateParams class BookTransferListParams = Lithic::Models::BookTransferListParams @@ -69,6 +83,10 @@ module Lithic class BookTransferReverseParams = Lithic::Models::BookTransferReverseParams + class BookTransferTransactionCreatedWebhookEvent = Lithic::Models::BookTransferTransactionCreatedWebhookEvent + + class BookTransferTransactionUpdatedWebhookEvent = Lithic::Models::BookTransferTransactionUpdatedWebhookEvent + class Card = Lithic::Models::Card class CardBulkOrder = Lithic::Models::CardBulkOrder @@ -81,8 +99,12 @@ module Lithic class CardBulkOrderUpdateParams = Lithic::Models::CardBulkOrderUpdateParams + class CardConvertedWebhookEvent = Lithic::Models::CardConvertedWebhookEvent + class CardConvertPhysicalParams = Lithic::Models::CardConvertPhysicalParams + class CardCreatedWebhookEvent = Lithic::Models::CardCreatedWebhookEvent + class CardCreateParams = Lithic::Models::CardCreateParams class CardEmbedParams = Lithic::Models::CardEmbedParams @@ -99,8 +121,12 @@ module Lithic class CardProvisionParams = Lithic::Models::CardProvisionParams + class CardReissuedWebhookEvent = Lithic::Models::CardReissuedWebhookEvent + class CardReissueParams = Lithic::Models::CardReissueParams + class CardRenewedWebhookEvent = Lithic::Models::CardRenewedWebhookEvent + class CardRenewParams = Lithic::Models::CardRenewParams class CardRetrieveParams = Lithic::Models::CardRetrieveParams @@ -111,8 +137,16 @@ module Lithic class CardSearchByPanParams = Lithic::Models::CardSearchByPanParams + class CardShippedWebhookEvent = Lithic::Models::CardShippedWebhookEvent + class CardSpendLimits = Lithic::Models::CardSpendLimits + class CardTransactionEnhancedDataCreatedWebhookEvent = Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent + + class CardTransactionEnhancedDataUpdatedWebhookEvent = Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent + + class CardTransactionUpdatedWebhookEvent = Lithic::Models::CardTransactionUpdatedWebhookEvent + class CardUpdateParams = Lithic::Models::CardUpdateParams class CardWebProvisionParams = Lithic::Models::CardWebProvisionParams @@ -135,6 +169,16 @@ module Lithic class DigitalCardArtRetrieveParams = Lithic::Models::DigitalCardArtRetrieveParams + class DigitalWalletTokenizationApprovalRequestWebhookEvent = Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent + + class DigitalWalletTokenizationResultWebhookEvent = Lithic::Models::DigitalWalletTokenizationResultWebhookEvent + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent = Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent = Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + + class DigitalWalletTokenizationUpdatedWebhookEvent = Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent + class DigitalWalletTokenMetadata = Lithic::Models::DigitalWalletTokenMetadata class Dispute = Lithic::Models::Dispute @@ -147,6 +191,8 @@ module Lithic class DisputeEvidence = Lithic::Models::DisputeEvidence + class DisputeEvidenceUploadFailedWebhookEvent = Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent + class DisputeInitiateEvidenceUploadParams = Lithic::Models::DisputeInitiateEvidenceUploadParams class DisputeListEvidencesParams = Lithic::Models::DisputeListEvidencesParams @@ -161,6 +207,12 @@ module Lithic class DisputesV2RetrieveParams = Lithic::Models::DisputesV2RetrieveParams + class DisputeTransactionCreatedWebhookEvent = Lithic::Models::DisputeTransactionCreatedWebhookEvent + + class DisputeTransactionUpdatedWebhookEvent = Lithic::Models::DisputeTransactionUpdatedWebhookEvent + + class DisputeUpdatedWebhookEvent = Lithic::Models::DisputeUpdatedWebhookEvent + class DisputeUpdateParams = Lithic::Models::DisputeUpdateParams class DisputeV2 = Lithic::Models::DisputeV2 @@ -183,6 +235,8 @@ module Lithic class ExternalBankAccountAddress = Lithic::Models::ExternalBankAccountAddress + class ExternalBankAccountCreatedWebhookEvent = Lithic::Models::ExternalBankAccountCreatedWebhookEvent + class ExternalBankAccountCreateParams = Lithic::Models::ExternalBankAccountCreateParams class ExternalBankAccountListParams = Lithic::Models::ExternalBankAccountListParams @@ -197,12 +251,16 @@ module Lithic class ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams + class ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent + class ExternalBankAccountUpdateParams = Lithic::Models::ExternalBankAccountUpdateParams class ExternalPayment = Lithic::Models::ExternalPayment class ExternalPaymentCancelParams = Lithic::Models::ExternalPaymentCancelParams + class ExternalPaymentCreatedWebhookEvent = Lithic::Models::ExternalPaymentCreatedWebhookEvent + class ExternalPaymentCreateParams = Lithic::Models::ExternalPaymentCreateParams class ExternalPaymentListParams = Lithic::Models::ExternalPaymentListParams @@ -215,6 +273,8 @@ module Lithic class ExternalPaymentSettleParams = Lithic::Models::ExternalPaymentSettleParams + class ExternalPaymentUpdatedWebhookEvent = Lithic::Models::ExternalPaymentUpdatedWebhookEvent + class ExternalResource = Lithic::Models::ExternalResource module ExternalResourceType = Lithic::Models::ExternalResourceType @@ -223,6 +283,8 @@ module Lithic class FinancialAccountBalance = Lithic::Models::FinancialAccountBalance + class FinancialAccountCreatedWebhookEvent = Lithic::Models::FinancialAccountCreatedWebhookEvent + class FinancialAccountCreateParams = Lithic::Models::FinancialAccountCreateParams class FinancialAccountListParams = Lithic::Models::FinancialAccountListParams @@ -233,6 +295,8 @@ module Lithic module FinancialAccounts = Lithic::Models::FinancialAccounts + class FinancialAccountUpdatedWebhookEvent = Lithic::Models::FinancialAccountUpdatedWebhookEvent + class FinancialAccountUpdateParams = Lithic::Models::FinancialAccountUpdateParams class FinancialAccountUpdateStatusParams = Lithic::Models::FinancialAccountUpdateStatusParams @@ -245,6 +309,8 @@ module Lithic class FundingEvent = Lithic::Models::FundingEvent + class FundingEventCreatedWebhookEvent = Lithic::Models::FundingEventCreatedWebhookEvent + class FundingEventListParams = Lithic::Models::FundingEventListParams class FundingEventRetrieveDetailsParams = Lithic::Models::FundingEventRetrieveDetailsParams @@ -255,6 +321,10 @@ module Lithic class InternalTransactionAPI = Lithic::Models::InternalTransactionAPI + class InternalTransactionCreatedWebhookEvent = Lithic::Models::InternalTransactionCreatedWebhookEvent + + class InternalTransactionUpdatedWebhookEvent = Lithic::Models::InternalTransactionUpdatedWebhookEvent + class KYB = Lithic::Models::KYB class KYBBusinessEntity = Lithic::Models::KYBBusinessEntity @@ -263,6 +333,12 @@ module Lithic class KYCExempt = Lithic::Models::KYCExempt + class LoanTapeCreatedWebhookEvent = Lithic::Models::LoanTapeCreatedWebhookEvent + + class LoanTapeUpdatedWebhookEvent = Lithic::Models::LoanTapeUpdatedWebhookEvent + + class ManagementOperationCreatedWebhookEvent = Lithic::Models::ManagementOperationCreatedWebhookEvent + class ManagementOperationCreateParams = Lithic::Models::ManagementOperationCreateParams class ManagementOperationListParams = Lithic::Models::ManagementOperationListParams @@ -273,6 +349,8 @@ module Lithic class ManagementOperationTransaction = Lithic::Models::ManagementOperationTransaction + class ManagementOperationUpdatedWebhookEvent = Lithic::Models::ManagementOperationUpdatedWebhookEvent + class Merchant = Lithic::Models::Merchant class MessageAttempt = Lithic::Models::MessageAttempt @@ -285,10 +363,16 @@ module Lithic class NetworkTotal = Lithic::Models::NetworkTotal + class NetworkTotalCreatedWebhookEvent = Lithic::Models::NetworkTotalCreatedWebhookEvent + + class NetworkTotalUpdatedWebhookEvent = Lithic::Models::NetworkTotalUpdatedWebhookEvent + class NonPCICard = Lithic::Models::NonPCICard module OwnerType = Lithic::Models::OwnerType + module ParsedWebhookEvent = Lithic::Models::ParsedWebhookEvent + class Payment = Lithic::Models::Payment class PaymentCreateParams = Lithic::Models::PaymentCreateParams @@ -309,6 +393,10 @@ module Lithic class PaymentSimulateReturnParams = Lithic::Models::PaymentSimulateReturnParams + class PaymentTransactionCreatedWebhookEvent = Lithic::Models::PaymentTransactionCreatedWebhookEvent + + class PaymentTransactionUpdatedWebhookEvent = Lithic::Models::PaymentTransactionUpdatedWebhookEvent + class ProvisionResponse = Lithic::Models::ProvisionResponse module Reports = Lithic::Models::Reports @@ -327,26 +415,40 @@ module Lithic class SettlementReport = Lithic::Models::SettlementReport + class SettlementReportUpdatedWebhookEvent = Lithic::Models::SettlementReportUpdatedWebhookEvent + class SettlementSummaryDetails = Lithic::Models::SettlementSummaryDetails class ShippingAddress = Lithic::Models::ShippingAddress module SpendLimitDuration = Lithic::Models::SpendLimitDuration + class StatementsCreatedWebhookEvent = Lithic::Models::StatementsCreatedWebhookEvent + class StatementTotals = Lithic::Models::StatementTotals module ThreeDS = Lithic::Models::ThreeDS class ThreeDSAuthentication = Lithic::Models::ThreeDSAuthentication + class ThreeDSAuthenticationChallengeWebhookEvent = Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent + + class ThreeDSAuthenticationCreatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent + + class ThreeDSAuthenticationUpdatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent + class TokenInfo = Lithic::Models::TokenInfo class Tokenization = Lithic::Models::Tokenization class TokenizationActivateParams = Lithic::Models::TokenizationActivateParams + class TokenizationApprovalRequestWebhookEvent = Lithic::Models::TokenizationApprovalRequestWebhookEvent + class TokenizationDeactivateParams = Lithic::Models::TokenizationDeactivateParams + class TokenizationDecisioningRequestWebhookEvent = Lithic::Models::TokenizationDecisioningRequestWebhookEvent + class TokenizationDecisioningRetrieveSecretParams = Lithic::Models::TokenizationDecisioningRetrieveSecretParams class TokenizationDecisioningRotateSecretParams = Lithic::Models::TokenizationDecisioningRotateSecretParams @@ -359,6 +461,8 @@ module Lithic class TokenizationResendActivationCodeParams = Lithic::Models::TokenizationResendActivationCodeParams + class TokenizationResultWebhookEvent = Lithic::Models::TokenizationResultWebhookEvent + class TokenizationRetrieveParams = Lithic::Models::TokenizationRetrieveParams class TokenizationRuleResult = Lithic::Models::TokenizationRuleResult @@ -369,10 +473,16 @@ module Lithic module TokenizationTfaReason = Lithic::Models::TokenizationTfaReason + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent = Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + class TokenizationTwoFactorAuthenticationCodeWebhookEvent = Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent + class TokenizationUnpauseParams = Lithic::Models::TokenizationUnpauseParams class TokenizationUpdateDigitalCardArtParams = Lithic::Models::TokenizationUpdateDigitalCardArtParams + class TokenizationUpdatedWebhookEvent = Lithic::Models::TokenizationUpdatedWebhookEvent + class Transaction = Lithic::Models::Transaction class TransactionExpireAuthorizationParams = Lithic::Models::TransactionExpireAuthorizationParams @@ -405,5 +515,7 @@ module Lithic class WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo + class WebhookParsedParams = Lithic::Models::WebhookParsedParams + class WirePartyDetails = Lithic::Models::WirePartyDetails end diff --git a/sig/lithic/models/account_holder_created_webhook_event.rbs b/sig/lithic/models/account_holder_created_webhook_event.rbs new file mode 100644 index 00000000..3d1a5e66 --- /dev/null +++ b/sig/lithic/models/account_holder_created_webhook_event.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + type account_holder_created_webhook_event = + { + event_type: :"account_holder.created", + token: String, + account_token: String, + created: Time, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderCreatedWebhookEvent::status, + status_reason: ::Array[String] + } + + class AccountHolderCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"account_holder.created" + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader required_documents: ::Array[Lithic::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::RequiredDocument] + ) -> ::Array[Lithic::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolderCreatedWebhookEvent::status? + + def status=: ( + Lithic::Models::AccountHolderCreatedWebhookEvent::status + ) -> Lithic::Models::AccountHolderCreatedWebhookEvent::status + + attr_reader status_reason: ::Array[String]? + + def status_reason=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?token: String, + ?account_token: String, + ?created: Time, + ?required_documents: ::Array[Lithic::RequiredDocument], + ?status: Lithic::Models::AccountHolderCreatedWebhookEvent::status, + ?status_reason: ::Array[String], + ?event_type: :"account_holder.created" + ) -> void + + def to_hash: -> { + event_type: :"account_holder.created", + token: String, + account_token: String, + created: Time, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderCreatedWebhookEvent::status, + status_reason: ::Array[String] + } + + type status = :ACCEPTED | :PENDING_REVIEW + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreatedWebhookEvent::status] + end + end + end +end diff --git a/sig/lithic/models/account_holder_document_updated_webhook_event.rbs b/sig/lithic/models/account_holder_document_updated_webhook_event.rbs new file mode 100644 index 00000000..8bfaaf36 --- /dev/null +++ b/sig/lithic/models/account_holder_document_updated_webhook_event.rbs @@ -0,0 +1,219 @@ +module Lithic + module Models + type account_holder_document_updated_webhook_event = + { + event_type: :"account_holder_document.updated", + token: String, + account_holder_token: String, + created: Time, + document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + } + + class AccountHolderDocumentUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"account_holder_document.updated" + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_holder_token: String? + + def account_holder_token=: (String) -> String + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type? + + def document_type=: ( + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type + ) -> Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type + + attr_reader entity_token: String? + + def entity_token=: (String) -> String + + attr_reader required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload]? + + def required_document_uploads=: ( + ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + ) -> ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + + def initialize: ( + ?token: String, + ?account_holder_token: String, + ?created: Time, + ?document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type, + ?entity_token: String, + ?required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload], + ?event_type: :"account_holder_document.updated" + ) -> void + + def to_hash: -> { + event_type: :"account_holder_document.updated", + token: String, + account_holder_token: String, + created: Time, + document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + } + + type document_type = + :DRIVERS_LICENSE + | :PASSPORT + | :PASSPORT_CARD + | :EIN_LETTER + | :TAX_RETURN + | :OPERATING_AGREEMENT + | :CERTIFICATE_OF_FORMATION + | :CERTIFICATE_OF_GOOD_STANDING + | :ARTICLES_OF_INCORPORATION + | :ARTICLES_OF_ORGANIZATION + | :BYLAWS + | :GOVERNMENT_BUSINESS_LICENSE + | :PARTNERSHIP_AGREEMENT + | :SS4_FORM + | :BANK_STATEMENT + | :UTILITY_BILL_STATEMENT + | :SSN_CARD + | :ITIN_LETTER + | :FINCEN_BOI_REPORT + + module DocumentType + extend Lithic::Internal::Type::Enum + + DRIVERS_LICENSE: :DRIVERS_LICENSE + PASSPORT: :PASSPORT + PASSPORT_CARD: :PASSPORT_CARD + EIN_LETTER: :EIN_LETTER + TAX_RETURN: :TAX_RETURN + OPERATING_AGREEMENT: :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION: :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING: :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION: :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION: :ARTICLES_OF_ORGANIZATION + BYLAWS: :BYLAWS + GOVERNMENT_BUSINESS_LICENSE: :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT: :PARTNERSHIP_AGREEMENT + SS4_FORM: :SS4_FORM + BANK_STATEMENT: :BANK_STATEMENT + UTILITY_BILL_STATEMENT: :UTILITY_BILL_STATEMENT + SSN_CARD: :SSN_CARD + ITIN_LETTER: :ITIN_LETTER + FINCEN_BOI_REPORT: :FINCEN_BOI_REPORT + + def self?.values: -> ::Array[Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type] + end + + type required_document_upload = + { + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status, + status_reasons: ::Array[String], + updated: Time + } + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader accepted_entity_status_reasons: ::Array[String]? + + def accepted_entity_status_reasons=: ( + ::Array[String] + ) -> ::Array[String] + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type? + + def image_type=: ( + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type + ) -> Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type + + attr_reader rejected_entity_status_reasons: ::Array[String]? + + def rejected_entity_status_reasons=: ( + ::Array[String] + ) -> ::Array[String] + + attr_reader status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status? + + def status=: ( + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status + ) -> Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status + + attr_reader status_reasons: ::Array[String]? + + def status_reasons=: (::Array[String]) -> ::Array[String] + + attr_reader updated: Time? + + def updated=: (Time) -> Time + + def initialize: ( + ?token: String, + ?accepted_entity_status_reasons: ::Array[String], + ?created: Time, + ?image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type, + ?rejected_entity_status_reasons: ::Array[String], + ?status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status, + ?status_reasons: ::Array[String], + ?updated: Time + ) -> void + + def to_hash: -> { + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status, + status_reasons: ::Array[String], + updated: Time + } + + type image_type = :FRONT | :BACK + + module ImageType + extend Lithic::Internal::Type::Enum + + FRONT: :FRONT + BACK: :BACK + + def self?.values: -> ::Array[Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type] + end + + type status = + :ACCEPTED + | :REJECTED + | :PENDING_UPLOAD + | :UPLOADED + | :PARTIAL_APPROVAL + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + PENDING_UPLOAD: :PENDING_UPLOAD + UPLOADED: :UPLOADED + PARTIAL_APPROVAL: :PARTIAL_APPROVAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status] + end + end + end + end +end diff --git a/sig/lithic/models/account_holder_updated_webhook_event.rbs b/sig/lithic/models/account_holder_updated_webhook_event.rbs new file mode 100644 index 00000000..752443f0 --- /dev/null +++ b/sig/lithic/models/account_holder_updated_webhook_event.rbs @@ -0,0 +1,587 @@ +module Lithic + module Models + type account_holder_updated_webhook_event = + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload + | Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload + | Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload + + module AccountHolderUpdatedWebhookEvent + extend Lithic::Internal::Type::Union + + type kyb_payload = + { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type, + external_id: String, + nature_of_business: String, + website_url: String + } + + class KYBPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type? + + def event_type=: ( + Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type + ) -> Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + ?event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type, + ?external_id: String, + ?nature_of_business: String, + ?website_url: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type, + external_id: String, + nature_of_business: String, + website_url: String + } + + type update_request = + { + beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity], + beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity]? + + def beneficial_owner_entities=: ( + ::Array[Lithic::KYBBusinessEntity] + ) -> ::Array[Lithic::KYBBusinessEntity] + + attr_reader beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + + attr_reader business_entity: Lithic::KYBBusinessEntity? + + def business_entity=: ( + Lithic::KYBBusinessEntity + ) -> Lithic::KYBBusinessEntity + + attr_reader control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson? + + def control_person=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + + def initialize: ( + ?beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity], + ?beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + ?business_entity: Lithic::KYBBusinessEntity, + ?control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> void + + def to_hash: -> { + beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity], + beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + type beneficial_owner_individual = + { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type control_person = + { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address? + + def address=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type] + end + end + + type kyc_payload = + { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + class KYCPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type? + + def event_type=: ( + Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type + ) -> Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + ?event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type, + ?external_id: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + type update_request = + { + individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual? + + def individual=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + + def initialize: ( + ?individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> void + + def to_hash: -> { + individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + type individual = + { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address? + + def address=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type] + end + end + + type legacy_payload = + { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + class LegacyPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor business_account_token: String? + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type? + + def event_type=: ( + Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type + ) -> Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type + + attr_accessor external_id: String? + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + token: String, + ?business_account_token: String?, + ?created: Time, + ?email: String, + ?event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type, + ?external_id: String?, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type] + end + end + + def self?.variants: -> ::Array[Lithic::Models::account_holder_updated_webhook_event] + end + end +end diff --git a/sig/lithic/models/account_holder_verification_webhook_event.rbs b/sig/lithic/models/account_holder_verification_webhook_event.rbs new file mode 100644 index 00000000..998a344d --- /dev/null +++ b/sig/lithic/models/account_holder_verification_webhook_event.rbs @@ -0,0 +1,69 @@ +module Lithic + module Models + type account_holder_verification_webhook_event = + { + event_type: :"account_holder.verification", + token: String, + account_token: String, + created: Time, + status: Lithic::Models::AccountHolderVerificationWebhookEvent::status, + status_reasons: ::Array[String] + } + + class AccountHolderVerificationWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"account_holder.verification" + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader status: Lithic::Models::AccountHolderVerificationWebhookEvent::status? + + def status=: ( + Lithic::Models::AccountHolderVerificationWebhookEvent::status + ) -> Lithic::Models::AccountHolderVerificationWebhookEvent::status + + attr_reader status_reasons: ::Array[String]? + + def status_reasons=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?token: String, + ?account_token: String, + ?created: Time, + ?status: Lithic::Models::AccountHolderVerificationWebhookEvent::status, + ?status_reasons: ::Array[String], + ?event_type: :"account_holder.verification" + ) -> void + + def to_hash: -> { + event_type: :"account_holder.verification", + token: String, + account_token: String, + created: Time, + status: Lithic::Models::AccountHolderVerificationWebhookEvent::status, + status_reasons: ::Array[String] + } + + type status = :ACCEPTED | :PENDING_REVIEW | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderVerificationWebhookEvent::status] + end + end + end +end diff --git a/sig/lithic/models/asa_request_webhook_event.rbs b/sig/lithic/models/asa_request_webhook_event.rbs new file mode 100644 index 00000000..fdf3f042 --- /dev/null +++ b/sig/lithic/models/asa_request_webhook_event.rbs @@ -0,0 +1,881 @@ +module Lithic + module Models + type asa_request_webhook_event = + { + token: String, + acquirer_fee: Integer, + amount: Integer, + authorization_amount: Integer, + avs: Lithic::AsaRequestWebhookEvent::Avs, + card: Lithic::AsaRequestWebhookEvent::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::Merchant, + merchant_amount: Integer, + merchant_currency: String, + settled_amount: Integer, + status: Lithic::Models::AsaRequestWebhookEvent::status, + transaction_initiator: Lithic::Models::AsaRequestWebhookEvent::transaction_initiator, + account_type: Lithic::Models::AsaRequestWebhookEvent::account_type, + cardholder_authentication: Lithic::CardholderAuthentication, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: Lithic::AsaRequestWebhookEvent::FleetInfo?, + latest_challenge: Lithic::AsaRequestWebhookEvent::LatestChallenge, + network: Lithic::Models::AsaRequestWebhookEvent::network, + network_risk_score: Integer?, + network_specific_data: Lithic::AsaRequestWebhookEvent::NetworkSpecificData?, + pos: Lithic::AsaRequestWebhookEvent::Pos, + token_info: Lithic::TokenInfo?, + ttl: Time + } + + class AsaRequestWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor acquirer_fee: Integer + + attr_accessor amount: Integer + + attr_accessor authorization_amount: Integer + + attr_accessor avs: Lithic::AsaRequestWebhookEvent::Avs + + attr_accessor card: Lithic::AsaRequestWebhookEvent::Card + + attr_accessor cardholder_currency: String + + attr_accessor cash_amount: Integer + + attr_accessor created: Time + + attr_accessor merchant: Lithic::Merchant + + attr_accessor merchant_amount: Integer + + attr_accessor merchant_currency: String + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::AsaRequestWebhookEvent::status + + attr_accessor transaction_initiator: Lithic::Models::AsaRequestWebhookEvent::transaction_initiator + + attr_reader account_type: Lithic::Models::AsaRequestWebhookEvent::account_type? + + def account_type=: ( + Lithic::Models::AsaRequestWebhookEvent::account_type + ) -> Lithic::Models::AsaRequestWebhookEvent::account_type + + attr_reader cardholder_authentication: Lithic::CardholderAuthentication? + + def cardholder_authentication=: ( + Lithic::CardholderAuthentication + ) -> Lithic::CardholderAuthentication + + attr_reader cashback: Integer? + + def cashback=: (Integer) -> Integer + + attr_reader conversion_rate: Float? + + def conversion_rate=: (Float) -> Float + + attr_reader event_token: String? + + def event_token=: (String) -> String + + attr_accessor fleet_info: Lithic::AsaRequestWebhookEvent::FleetInfo? + + attr_reader latest_challenge: Lithic::AsaRequestWebhookEvent::LatestChallenge? + + def latest_challenge=: ( + Lithic::AsaRequestWebhookEvent::LatestChallenge + ) -> Lithic::AsaRequestWebhookEvent::LatestChallenge + + attr_reader network: Lithic::Models::AsaRequestWebhookEvent::network? + + def network=: ( + Lithic::Models::AsaRequestWebhookEvent::network + ) -> Lithic::Models::AsaRequestWebhookEvent::network + + attr_accessor network_risk_score: Integer? + + attr_accessor network_specific_data: Lithic::AsaRequestWebhookEvent::NetworkSpecificData? + + attr_reader pos: Lithic::AsaRequestWebhookEvent::Pos? + + def pos=: ( + Lithic::AsaRequestWebhookEvent::Pos + ) -> Lithic::AsaRequestWebhookEvent::Pos + + attr_accessor token_info: Lithic::TokenInfo? + + attr_reader ttl: Time? + + def ttl=: (Time) -> Time + + def initialize: ( + token: String, + acquirer_fee: Integer, + amount: Integer, + authorization_amount: Integer, + avs: Lithic::AsaRequestWebhookEvent::Avs, + card: Lithic::AsaRequestWebhookEvent::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::Merchant, + merchant_amount: Integer, + merchant_currency: String, + settled_amount: Integer, + status: Lithic::Models::AsaRequestWebhookEvent::status, + transaction_initiator: Lithic::Models::AsaRequestWebhookEvent::transaction_initiator, + ?account_type: Lithic::Models::AsaRequestWebhookEvent::account_type, + ?cardholder_authentication: Lithic::CardholderAuthentication, + ?cashback: Integer, + ?conversion_rate: Float, + ?event_token: String, + ?fleet_info: Lithic::AsaRequestWebhookEvent::FleetInfo?, + ?latest_challenge: Lithic::AsaRequestWebhookEvent::LatestChallenge, + ?network: Lithic::Models::AsaRequestWebhookEvent::network, + ?network_risk_score: Integer?, + ?network_specific_data: Lithic::AsaRequestWebhookEvent::NetworkSpecificData?, + ?pos: Lithic::AsaRequestWebhookEvent::Pos, + ?token_info: Lithic::TokenInfo?, + ?ttl: Time + ) -> void + + def to_hash: -> { + token: String, + acquirer_fee: Integer, + amount: Integer, + authorization_amount: Integer, + avs: Lithic::AsaRequestWebhookEvent::Avs, + card: Lithic::AsaRequestWebhookEvent::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::Merchant, + merchant_amount: Integer, + merchant_currency: String, + settled_amount: Integer, + status: Lithic::Models::AsaRequestWebhookEvent::status, + transaction_initiator: Lithic::Models::AsaRequestWebhookEvent::transaction_initiator, + account_type: Lithic::Models::AsaRequestWebhookEvent::account_type, + cardholder_authentication: Lithic::CardholderAuthentication, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: Lithic::AsaRequestWebhookEvent::FleetInfo?, + latest_challenge: Lithic::AsaRequestWebhookEvent::LatestChallenge, + network: Lithic::Models::AsaRequestWebhookEvent::network, + network_risk_score: Integer?, + network_specific_data: Lithic::AsaRequestWebhookEvent::NetworkSpecificData?, + pos: Lithic::AsaRequestWebhookEvent::Pos, + token_info: Lithic::TokenInfo?, + ttl: Time + } + + type avs = + { + address: String, + address_on_file_match: Lithic::Models::AsaRequestWebhookEvent::Avs::address_on_file_match, + zipcode: String + } + + class Avs < Lithic::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor address_on_file_match: Lithic::Models::AsaRequestWebhookEvent::Avs::address_on_file_match + + attr_accessor zipcode: String + + def initialize: ( + address: String, + address_on_file_match: Lithic::Models::AsaRequestWebhookEvent::Avs::address_on_file_match, + zipcode: String + ) -> void + + def to_hash: -> { + address: String, + address_on_file_match: Lithic::Models::AsaRequestWebhookEvent::Avs::address_on_file_match, + zipcode: String + } + + type address_on_file_match = + :MATCH + | :MATCH_ADDRESS_ONLY + | :MATCH_ZIP_ONLY + | :MISMATCH + | :NOT_PRESENT + + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + MATCH: :MATCH + MATCH_ADDRESS_ONLY: :MATCH_ADDRESS_ONLY + MATCH_ZIP_ONLY: :MATCH_ZIP_ONLY + MISMATCH: :MISMATCH + NOT_PRESENT: :NOT_PRESENT + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Avs::address_on_file_match] + end + end + + type card = + { + token: String, + hostname: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::AsaRequestWebhookEvent::Card::spend_limit_duration, + state: Lithic::Models::AsaRequestWebhookEvent::Card::state, + type: Lithic::Models::AsaRequestWebhookEvent::Card::type_ + } + + class Card < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader hostname: String? + + def hostname=: (String) -> String + + attr_reader last_four: String? + + def last_four=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader spend_limit: Integer? + + def spend_limit=: (Integer) -> Integer + + attr_reader spend_limit_duration: Lithic::Models::AsaRequestWebhookEvent::Card::spend_limit_duration? + + def spend_limit_duration=: ( + Lithic::Models::AsaRequestWebhookEvent::Card::spend_limit_duration + ) -> Lithic::Models::AsaRequestWebhookEvent::Card::spend_limit_duration + + attr_reader state: Lithic::Models::AsaRequestWebhookEvent::Card::state? + + def state=: ( + Lithic::Models::AsaRequestWebhookEvent::Card::state + ) -> Lithic::Models::AsaRequestWebhookEvent::Card::state + + attr_reader type: Lithic::Models::AsaRequestWebhookEvent::Card::type_? + + def type=: ( + Lithic::Models::AsaRequestWebhookEvent::Card::type_ + ) -> Lithic::Models::AsaRequestWebhookEvent::Card::type_ + + def initialize: ( + ?token: String, + ?hostname: String, + ?last_four: String, + ?memo: String, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::AsaRequestWebhookEvent::Card::spend_limit_duration, + ?state: Lithic::Models::AsaRequestWebhookEvent::Card::state, + ?type: Lithic::Models::AsaRequestWebhookEvent::Card::type_ + ) -> void + + def to_hash: -> { + token: String, + hostname: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::AsaRequestWebhookEvent::Card::spend_limit_duration, + state: Lithic::Models::AsaRequestWebhookEvent::Card::state, + type: Lithic::Models::AsaRequestWebhookEvent::Card::type_ + } + + type spend_limit_duration = + :ANNUALLY | :FOREVER | :MONTHLY | :TRANSACTION + + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + ANNUALLY: :ANNUALLY + FOREVER: :FOREVER + MONTHLY: :MONTHLY + TRANSACTION: :TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Card::spend_limit_duration] + end + + type state = + :CLOSED | :OPEN | :PAUSED | :PENDING_ACTIVATION | :PENDING_FULFILLMENT + + module State + extend Lithic::Internal::Type::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + PENDING_ACTIVATION: :PENDING_ACTIVATION + PENDING_FULFILLMENT: :PENDING_FULFILLMENT + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Card::state] + end + + type type_ = + :SINGLE_USE + | :MERCHANT_LOCKED + | :UNLOCKED + | :PHYSICAL + | :DIGITAL_WALLET + | :VIRTUAL + + module Type + extend Lithic::Internal::Type::Enum + + SINGLE_USE: :SINGLE_USE + MERCHANT_LOCKED: :MERCHANT_LOCKED + UNLOCKED: :UNLOCKED + PHYSICAL: :PHYSICAL + DIGITAL_WALLET: :DIGITAL_WALLET + VIRTUAL: :VIRTUAL + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Card::type_] + end + end + + type status = + :AUTHORIZATION + | :CREDIT_AUTHORIZATION + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :BALANCE_INQUIRY + + module Status + extend Lithic::Internal::Type::Enum + + AUTHORIZATION: :AUTHORIZATION + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + BALANCE_INQUIRY: :BALANCE_INQUIRY + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::status] + end + + type transaction_initiator = :CARDHOLDER | :MERCHANT | :UNKNOWN + + module TransactionInitiator + extend Lithic::Internal::Type::Enum + + CARDHOLDER: :CARDHOLDER + MERCHANT: :MERCHANT + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::transaction_initiator] + end + + type account_type = :CHECKING | :SAVINGS + + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::account_type] + end + + type fleet_info = + { + fleet_prompt_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_prompt_code, + fleet_restriction_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_restriction_code, + driver_number: String?, + vehicle_number: String? + } + + class FleetInfo < Lithic::Internal::Type::BaseModel + attr_accessor fleet_prompt_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_prompt_code + + attr_accessor fleet_restriction_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_restriction_code + + attr_accessor driver_number: String? + + attr_accessor vehicle_number: String? + + def initialize: ( + fleet_prompt_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_prompt_code, + fleet_restriction_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_restriction_code, + ?driver_number: String?, + ?vehicle_number: String? + ) -> void + + def to_hash: -> { + fleet_prompt_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_prompt_code, + fleet_restriction_code: Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_restriction_code, + driver_number: String?, + vehicle_number: String? + } + + type fleet_prompt_code = :NO_PROMPT | :VEHICLE_NUMBER | :DRIVER_NUMBER + + module FleetPromptCode + extend Lithic::Internal::Type::Enum + + NO_PROMPT: :NO_PROMPT + VEHICLE_NUMBER: :VEHICLE_NUMBER + DRIVER_NUMBER: :DRIVER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_prompt_code] + end + + type fleet_restriction_code = :NO_RESTRICTIONS | :FUEL_ONLY + + module FleetRestrictionCode + extend Lithic::Internal::Type::Enum + + NO_RESTRICTIONS: :NO_RESTRICTIONS + FUEL_ONLY: :FUEL_ONLY + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::FleetInfo::fleet_restriction_code] + end + end + + type latest_challenge = + { + phone_number: String, + status: Lithic::Models::AsaRequestWebhookEvent::LatestChallenge::status, + completed_at: Time + } + + class LatestChallenge < Lithic::Internal::Type::BaseModel + attr_accessor phone_number: String + + attr_accessor status: Lithic::Models::AsaRequestWebhookEvent::LatestChallenge::status + + attr_reader completed_at: Time? + + def completed_at=: (Time) -> Time + + def initialize: ( + phone_number: String, + status: Lithic::Models::AsaRequestWebhookEvent::LatestChallenge::status, + ?completed_at: Time + ) -> void + + def to_hash: -> { + phone_number: String, + status: Lithic::Models::AsaRequestWebhookEvent::LatestChallenge::status, + completed_at: Time + } + + type status = :COMPLETED | :PENDING | :EXPIRED | :ERROR + + module Status + extend Lithic::Internal::Type::Enum + + COMPLETED: :COMPLETED + PENDING: :PENDING + EXPIRED: :EXPIRED + ERROR: :ERROR + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::LatestChallenge::status] + end + end + + type network = + :AMEX | :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Internal::Type::Enum + + AMEX: :AMEX + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::network] + end + + type network_specific_data = + { + mastercard: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard?, + visa: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa? + } + + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + attr_accessor mastercard: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard? + + attr_accessor visa: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa? + + def initialize: ( + ?mastercard: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard?, + ?visa: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa? + ) -> void + + def to_hash: -> { + mastercard: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard?, + visa: Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Visa? + } + + type mastercard = + { + ecommerce_security_level_indicator: String?, + on_behalf_service_result: ::Array[Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + transaction_type_identifier: String? + } + + class Mastercard < Lithic::Internal::Type::BaseModel + attr_accessor ecommerce_security_level_indicator: String? + + attr_accessor on_behalf_service_result: ::Array[Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult]? + + attr_accessor transaction_type_identifier: String? + + def initialize: ( + ?ecommerce_security_level_indicator: String?, + ?on_behalf_service_result: ::Array[Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + ?transaction_type_identifier: String? + ) -> void + + def to_hash: -> { + ecommerce_security_level_indicator: String?, + on_behalf_service_result: ::Array[Lithic::AsaRequestWebhookEvent::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + transaction_type_identifier: String? + } + + type on_behalf_service_result = + { :result_1 => String, :result_2 => String, service: String } + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + attr_accessor result_1: String + + attr_accessor result_2: String + + attr_accessor service: String + + def initialize: ( + result_1: String, + result_2: String, + service: String + ) -> void + + def to_hash: -> { + :result_1 => String, + :result_2 => String, + service: String + } + end + end + + type visa = { business_application_identifier: String? } + + class Visa < Lithic::Internal::Type::BaseModel + attr_accessor business_application_identifier: String? + + def initialize: (?business_application_identifier: String?) -> void + + def to_hash: -> { business_application_identifier: String? } + end + end + + type pos = + { + entry_mode: Lithic::AsaRequestWebhookEvent::Pos::EntryMode, + terminal: Lithic::AsaRequestWebhookEvent::Pos::Terminal + } + + class Pos < Lithic::Internal::Type::BaseModel + attr_reader entry_mode: Lithic::AsaRequestWebhookEvent::Pos::EntryMode? + + def entry_mode=: ( + Lithic::AsaRequestWebhookEvent::Pos::EntryMode + ) -> Lithic::AsaRequestWebhookEvent::Pos::EntryMode + + attr_reader terminal: Lithic::AsaRequestWebhookEvent::Pos::Terminal? + + def terminal=: ( + Lithic::AsaRequestWebhookEvent::Pos::Terminal + ) -> Lithic::AsaRequestWebhookEvent::Pos::Terminal + + def initialize: ( + ?entry_mode: Lithic::AsaRequestWebhookEvent::Pos::EntryMode, + ?terminal: Lithic::AsaRequestWebhookEvent::Pos::Terminal + ) -> void + + def to_hash: -> { + entry_mode: Lithic::AsaRequestWebhookEvent::Pos::EntryMode, + terminal: Lithic::AsaRequestWebhookEvent::Pos::Terminal + } + + type entry_mode = + { + card: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::card, + cardholder: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::cardholder, + pan: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::pan, + pin_entered: bool + } + + class EntryMode < Lithic::Internal::Type::BaseModel + attr_reader card: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::card? + + def card=: ( + Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::card + ) -> Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::card + + attr_reader cardholder: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::cardholder? + + def cardholder=: ( + Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::cardholder + ) -> Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::cardholder + + attr_reader pan: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::pan? + + def pan=: ( + Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::pan + ) -> Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::pan + + attr_reader pin_entered: bool? + + def pin_entered=: (bool) -> bool + + def initialize: ( + ?card: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::card, + ?cardholder: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::cardholder, + ?pan: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::pan, + ?pin_entered: bool + ) -> void + + def to_hash: -> { + card: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::card, + cardholder: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::cardholder, + pan: Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::pan, + pin_entered: bool + } + + type card = :PRESENT | :NOT_PRESENT | :UNKNOWN + + module Card + extend Lithic::Internal::Type::Enum + + PRESENT: :PRESENT + NOT_PRESENT: :NOT_PRESENT + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::card] + end + + type cardholder = + :DEFERRED_BILLING + | :ELECTRONIC_ORDER + | :INSTALLMENT + | :MAIL_ORDER + | :NOT_PRESENT + | :PRESENT + | :REOCCURRING + | :TELEPHONE_ORDER + | :UNKNOWN + + module Cardholder + extend Lithic::Internal::Type::Enum + + DEFERRED_BILLING: :DEFERRED_BILLING + ELECTRONIC_ORDER: :ELECTRONIC_ORDER + INSTALLMENT: :INSTALLMENT + MAIL_ORDER: :MAIL_ORDER + NOT_PRESENT: :NOT_PRESENT + PRESENT: :PRESENT + REOCCURRING: :REOCCURRING + TELEPHONE_ORDER: :TELEPHONE_ORDER + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::cardholder] + end + + type pan = + :AUTO_ENTRY + | :BAR_CODE + | :CONTACTLESS + | :ECOMMERCE + | :ERROR_KEYED + | :ERROR_MAGNETIC_STRIPE + | :ICC + | :KEY_ENTERED + | :MAGNETIC_STRIPE + | :MANUAL + | :OCR + | :SECURE_CARDLESS + | :UNSPECIFIED + | :UNKNOWN + | :CREDENTIAL_ON_FILE + + module Pan + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY: :AUTO_ENTRY + BAR_CODE: :BAR_CODE + CONTACTLESS: :CONTACTLESS + ECOMMERCE: :ECOMMERCE + ERROR_KEYED: :ERROR_KEYED + ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE + ICC: :ICC + KEY_ENTERED: :KEY_ENTERED + MAGNETIC_STRIPE: :MAGNETIC_STRIPE + MANUAL: :MANUAL + OCR: :OCR + SECURE_CARDLESS: :SECURE_CARDLESS + UNSPECIFIED: :UNSPECIFIED + UNKNOWN: :UNKNOWN + CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Pos::EntryMode::pan] + end + end + + type terminal = + { + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::pin_capability, + type: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::type_, + acceptor_terminal_id: String? + } + + class Terminal < Lithic::Internal::Type::BaseModel + attr_accessor attended: bool + + attr_accessor card_retention_capable: bool + + attr_accessor on_premise: bool + + attr_accessor operator: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::operator + + attr_accessor partial_approval_capable: bool + + attr_accessor pin_capability: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::pin_capability + + attr_accessor type: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::type_ + + attr_accessor acceptor_terminal_id: String? + + def initialize: ( + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::pin_capability, + type: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::type_, + ?acceptor_terminal_id: String? + ) -> void + + def to_hash: -> { + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::pin_capability, + type: Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::type_, + acceptor_terminal_id: String? + } + + type operator = + :ADMINISTRATIVE | :CARDHOLDER | :CARD_ACCEPTOR | :UNKNOWN + + module Operator + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + CARDHOLDER: :CARDHOLDER + CARD_ACCEPTOR: :CARD_ACCEPTOR + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::operator] + end + + type pin_capability = + :CAPABLE | :INOPERATIVE | :NOT_CAPABLE | :UNSPECIFIED + + module PinCapability + extend Lithic::Internal::Type::Enum + + CAPABLE: :CAPABLE + INOPERATIVE: :INOPERATIVE + NOT_CAPABLE: :NOT_CAPABLE + UNSPECIFIED: :UNSPECIFIED + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::pin_capability] + end + + type type_ = + :ADMINISTRATIVE + | :ATM + | :AUTHORIZATION + | :COUPON_MACHINE + | :DIAL_TERMINAL + | :ECOMMERCE + | :ECR + | :FUEL_MACHINE + | :HOME_TERMINAL + | :MICR + | :OFF_PREMISE + | :PAYMENT + | :PDA + | :PHONE + | :POINT + | :POS_TERMINAL + | :PUBLIC_UTILITY + | :SELF_SERVICE + | :TELEVISION + | :TELLER + | :TRAVELERS_CHECK_MACHINE + | :VENDING + | :VOICE + | :UNKNOWN + + module Type + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + ATM: :ATM + AUTHORIZATION: :AUTHORIZATION + COUPON_MACHINE: :COUPON_MACHINE + DIAL_TERMINAL: :DIAL_TERMINAL + ECOMMERCE: :ECOMMERCE + ECR: :ECR + FUEL_MACHINE: :FUEL_MACHINE + HOME_TERMINAL: :HOME_TERMINAL + MICR: :MICR + OFF_PREMISE: :OFF_PREMISE + PAYMENT: :PAYMENT + PDA: :PDA + PHONE: :PHONE + POINT: :POINT + POS_TERMINAL: :POS_TERMINAL + PUBLIC_UTILITY: :PUBLIC_UTILITY + SELF_SERVICE: :SELF_SERVICE + TELEVISION: :TELEVISION + TELLER: :TELLER + TRAVELERS_CHECK_MACHINE: :TRAVELERS_CHECK_MACHINE + VENDING: :VENDING + VOICE: :VOICE + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::AsaRequestWebhookEvent::Pos::Terminal::type_] + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules_backtest_report_created_webhook_event.rbs b/sig/lithic/models/auth_rules_backtest_report_created_webhook_event.rbs new file mode 100644 index 00000000..8a19ae16 --- /dev/null +++ b/sig/lithic/models/auth_rules_backtest_report_created_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type auth_rules_backtest_report_created_webhook_event = + { event_type: :"auth_rules.backtest_report.created" } + + class AuthRulesBacktestReportCreatedWebhookEvent < Lithic::Models::AuthRules::V2::BacktestResults + def event_type: -> :"auth_rules.backtest_report.created" + + def event_type=: ( + :"auth_rules.backtest_report.created" _ + ) -> :"auth_rules.backtest_report.created" + + def initialize: ( + ?event_type: :"auth_rules.backtest_report.created" + ) -> void + + def to_hash: -> { event_type: :"auth_rules.backtest_report.created" } + end + end +end diff --git a/sig/lithic/models/balance_updated_webhook_event.rbs b/sig/lithic/models/balance_updated_webhook_event.rbs new file mode 100644 index 00000000..06f87b68 --- /dev/null +++ b/sig/lithic/models/balance_updated_webhook_event.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + type balance_updated_webhook_event = + { + data: ::Array[Lithic::FinancialAccountBalance], + event_type: :"balance.updated" + } + + class BalanceUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::FinancialAccountBalance] + + attr_accessor event_type: :"balance.updated" + + def initialize: ( + data: ::Array[Lithic::FinancialAccountBalance], + ?event_type: :"balance.updated" + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::FinancialAccountBalance], + event_type: :"balance.updated" + } + end + end +end diff --git a/sig/lithic/models/book_transfer_transaction_created_webhook_event.rbs b/sig/lithic/models/book_transfer_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..064be529 --- /dev/null +++ b/sig/lithic/models/book_transfer_transaction_created_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type book_transfer_transaction_created_webhook_event = + { event_type: :"book_transfer_transaction.created" } + + class BookTransferTransactionCreatedWebhookEvent < Lithic::Models::BookTransferResponse + def event_type: -> :"book_transfer_transaction.created" + + def event_type=: ( + :"book_transfer_transaction.created" _ + ) -> :"book_transfer_transaction.created" + + def initialize: ( + ?event_type: :"book_transfer_transaction.created" + ) -> void + + def to_hash: -> { event_type: :"book_transfer_transaction.created" } + end + end +end diff --git a/sig/lithic/models/book_transfer_transaction_updated_webhook_event.rbs b/sig/lithic/models/book_transfer_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..40577f02 --- /dev/null +++ b/sig/lithic/models/book_transfer_transaction_updated_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type book_transfer_transaction_updated_webhook_event = + { event_type: :"book_transfer_transaction.updated" } + + class BookTransferTransactionUpdatedWebhookEvent < Lithic::Models::BookTransferResponse + def event_type: -> :"book_transfer_transaction.updated" + + def event_type=: ( + :"book_transfer_transaction.updated" _ + ) -> :"book_transfer_transaction.updated" + + def initialize: ( + ?event_type: :"book_transfer_transaction.updated" + ) -> void + + def to_hash: -> { event_type: :"book_transfer_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/card_converted_webhook_event.rbs b/sig/lithic/models/card_converted_webhook_event.rbs new file mode 100644 index 00000000..c14d7313 --- /dev/null +++ b/sig/lithic/models/card_converted_webhook_event.rbs @@ -0,0 +1,19 @@ +module Lithic + module Models + type card_converted_webhook_event = + { card_token: String, event_type: :"card.converted" } + + class CardConvertedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String + + attr_accessor event_type: :"card.converted" + + def initialize: ( + card_token: String, + ?event_type: :"card.converted" + ) -> void + + def to_hash: -> { card_token: String, event_type: :"card.converted" } + end + end +end diff --git a/sig/lithic/models/card_created_webhook_event.rbs b/sig/lithic/models/card_created_webhook_event.rbs new file mode 100644 index 00000000..f14db820 --- /dev/null +++ b/sig/lithic/models/card_created_webhook_event.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type card_created_webhook_event = + { + card_token: String, + event_type: :"card.created", + replacement_for: String? + } + + class CardCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String + + attr_accessor event_type: :"card.created" + + attr_accessor replacement_for: String? + + def initialize: ( + card_token: String, + ?replacement_for: String?, + ?event_type: :"card.created" + ) -> void + + def to_hash: -> { + card_token: String, + event_type: :"card.created", + replacement_for: String? + } + end + end +end diff --git a/sig/lithic/models/card_reissued_webhook_event.rbs b/sig/lithic/models/card_reissued_webhook_event.rbs new file mode 100644 index 00000000..67836f80 --- /dev/null +++ b/sig/lithic/models/card_reissued_webhook_event.rbs @@ -0,0 +1,21 @@ +module Lithic + module Models + type card_reissued_webhook_event = + { event_type: :"card.reissued", card_token: String } + + class CardReissuedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"card.reissued" + + attr_reader card_token: String? + + def card_token=: (String) -> String + + def initialize: ( + ?card_token: String, + ?event_type: :"card.reissued" + ) -> void + + def to_hash: -> { event_type: :"card.reissued", card_token: String } + end + end +end diff --git a/sig/lithic/models/card_renewed_webhook_event.rbs b/sig/lithic/models/card_renewed_webhook_event.rbs new file mode 100644 index 00000000..927d18c2 --- /dev/null +++ b/sig/lithic/models/card_renewed_webhook_event.rbs @@ -0,0 +1,55 @@ +module Lithic + module Models + type card_renewed_webhook_event = + { + event_type: :"card.renewed", + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String + } + + class CardRenewedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"card.renewed" + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader previous_exp_month: String? + + def previous_exp_month=: (String) -> String + + attr_reader previous_exp_year: String? + + def previous_exp_year=: (String) -> String + + def initialize: ( + ?card_token: String, + ?exp_month: String, + ?exp_year: String, + ?previous_exp_month: String, + ?previous_exp_year: String, + ?event_type: :"card.renewed" + ) -> void + + def to_hash: -> { + event_type: :"card.renewed", + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String + } + end + end +end diff --git a/sig/lithic/models/card_shipped_webhook_event.rbs b/sig/lithic/models/card_shipped_webhook_event.rbs new file mode 100644 index 00000000..25a9e73c --- /dev/null +++ b/sig/lithic/models/card_shipped_webhook_event.rbs @@ -0,0 +1,71 @@ +module Lithic + module Models + type card_shipped_webhook_event = + { + bulk_order_token: String?, + card_token: String, + event_type: :"card.shipped", + shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method, + tracking_number: String? + } + + class CardShippedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor bulk_order_token: String? + + attr_accessor card_token: String + + attr_accessor event_type: :"card.shipped" + + attr_accessor shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method + + attr_accessor tracking_number: String? + + def initialize: ( + bulk_order_token: String?, + card_token: String, + shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method, + tracking_number: String?, + ?event_type: :"card.shipped" + ) -> void + + def to_hash: -> { + bulk_order_token: String?, + card_token: String, + event_type: :"card.shipped", + shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method, + tracking_number: String? + } + + type shipping_method = + :"Ex-US expedited with tracking" + | :"Ex-US standard with tracking" + | :"Ex-US standard without tracking" + | :"FedEx 2 days" + | :"FedEx express" + | :"FedEx overnight" + | :"USPS priority" + | :"USPS with tracking" + | :"USPS without tracking envelope" + | :"USPS without tracking envelope non-machine" + | :"USPS without tracking flat" + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + EX_US_EXPEDITED_WITH_TRACKING: :"Ex-US expedited with tracking" + EX_US_STANDARD_WITH_TRACKING: :"Ex-US standard with tracking" + EX_US_STANDARD_WITHOUT_TRACKING: :"Ex-US standard without tracking" + FED_EX_2_DAYS: :"FedEx 2 days" + FED_EX_EXPRESS: :"FedEx express" + FED_EX_OVERNIGHT: :"FedEx overnight" + USPS_PRIORITY: :"USPS priority" + USPS_WITH_TRACKING: :"USPS with tracking" + USPS_WITHOUT_TRACKING_ENVELOPE: :"USPS without tracking envelope" + USPS_WITHOUT_TRACKING_ENVELOPE_NON_MACHINE: :"USPS without tracking envelope non-machine" + USPS_WITHOUT_TRACKING_FLAT: :"USPS without tracking flat" + + def self?.values: -> ::Array[Lithic::Models::CardShippedWebhookEvent::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbs b/sig/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbs new file mode 100644 index 00000000..d3124b15 --- /dev/null +++ b/sig/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type card_transaction_enhanced_data_created_webhook_event = + { event_type: :"card_transaction.enhanced_data.created" } + + class CardTransactionEnhancedDataCreatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + def event_type: -> :"card_transaction.enhanced_data.created" + + def event_type=: ( + :"card_transaction.enhanced_data.created" _ + ) -> :"card_transaction.enhanced_data.created" + + def initialize: ( + ?event_type: :"card_transaction.enhanced_data.created" + ) -> void + + def to_hash: -> { event_type: :"card_transaction.enhanced_data.created" } + end + end +end diff --git a/sig/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbs b/sig/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbs new file mode 100644 index 00000000..2948d8dd --- /dev/null +++ b/sig/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type card_transaction_enhanced_data_updated_webhook_event = + { event_type: :"card_transaction.enhanced_data.updated" } + + class CardTransactionEnhancedDataUpdatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + def event_type: -> :"card_transaction.enhanced_data.updated" + + def event_type=: ( + :"card_transaction.enhanced_data.updated" _ + ) -> :"card_transaction.enhanced_data.updated" + + def initialize: ( + ?event_type: :"card_transaction.enhanced_data.updated" + ) -> void + + def to_hash: -> { event_type: :"card_transaction.enhanced_data.updated" } + end + end +end diff --git a/sig/lithic/models/card_transaction_updated_webhook_event.rbs b/sig/lithic/models/card_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..2b9b9ec9 --- /dev/null +++ b/sig/lithic/models/card_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type card_transaction_updated_webhook_event = + { event_type: :"card_transaction.updated" } + + class CardTransactionUpdatedWebhookEvent < Lithic::Models::Transaction + def event_type: -> :"card_transaction.updated" + + def event_type=: ( + :"card_transaction.updated" _ + ) -> :"card_transaction.updated" + + def initialize: (?event_type: :"card_transaction.updated") -> void + + def to_hash: -> { event_type: :"card_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs new file mode 100644 index 00000000..d9691dcf --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs @@ -0,0 +1,223 @@ +module Lithic + module Models + type digital_wallet_tokenization_approval_request_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + class DigitalWalletTokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision? + + attr_accessor event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type + + attr_accessor issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision + + attr_accessor tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel + + attr_accessor tokenization_token: String + + attr_accessor wallet_decisioning_info: Lithic::WalletDecisioningInfo + + attr_reader device: Lithic::Device? + + def device=: (Lithic::Device) -> Lithic::Device + + attr_reader digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata? + + def digital_wallet_token_metadata=: ( + Lithic::DigitalWalletTokenMetadata + ) -> Lithic::DigitalWalletTokenMetadata + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_reader tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason]? + + def tokenization_decline_reasons=: ( + ::Array[Lithic::Models::tokenization_decline_reason] + ) -> ::Array[Lithic::Models::tokenization_decline_reason] + + attr_reader tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source? + + def tokenization_source=: ( + Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source + ) -> Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + ?device: Lithic::Device, + ?digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + ?tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + type customer_tokenization_decision = + { + outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + attr_accessor outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome + + attr_accessor responder_url: String + + attr_reader latency: String? + + def latency=: (String) -> String + + attr_reader response_code: String? + + def response_code=: (String) -> String + + def initialize: ( + outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + ?latency: String, + ?response_code: String + ) -> void + + def to_hash: -> { + outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + type outcome = + :APPROVED + | :DECLINED + | :ERROR + | :INVALID_RESPONSE + | :REQUIRE_ADDITIONAL_AUTHENTICATION + | :TIMEOUT + + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + ERROR: :ERROR + INVALID_RESPONSE: :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT: :TIMEOUT + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome] + end + end + + type event_type = :"digital_wallet.tokenization_approval_request" + + module EventType + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type] + end + + type issuer_decision = :APPROVED | :DENIED | :VERIFICATION_REQUIRED + + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DENIED: :DENIED + VERIFICATION_REQUIRED: :VERIFICATION_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision] + end + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT + + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel] + end + + type tokenization_source = + :ACCOUNT_ON_FILE + | :CONTACTLESS_TAP + | :MANUAL_PROVISION + | :PUSH_PROVISION + | :TOKEN + | :UNKNOWN + + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE: :ACCOUNT_ON_FILE + CONTACTLESS_TAP: :CONTACTLESS_TAP + MANUAL_PROVISION: :MANUAL_PROVISION + PUSH_PROVISION: :PUSH_PROVISION + TOKEN: :TOKEN + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source] + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_result_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_result_webhook_event.rbs new file mode 100644 index 00000000..75fb9f5d --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_result_webhook_event.rbs @@ -0,0 +1,133 @@ +module Lithic + module Models + type digital_wallet_tokenization_result_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_result", + tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + class DigitalWalletTokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_result" + + attr_accessor tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String, + ?event_type: :"digital_wallet.tokenization_result" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_result", + tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + type tokenization_result_details = + { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + attr_accessor issuer_decision: String + + attr_accessor tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + + attr_accessor customer_decision: String? + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_accessor token_activated_date_time: Time? + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + attr_accessor wallet_decision: String? + + def initialize: ( + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + ?customer_decision: String?, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?token_activated_date_time: Time?, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + ?wallet_decision: String? + ) -> void + + def to_hash: -> { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + type tokenization_decline_reason = + :ACCOUNT_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :CVC_MISMATCH + | :DEVICE_SCORE_1 + | :GENERIC_DECLINE + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :WALLET_RECOMMENDED_DECISION_RED + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + CVC_MISMATCH: :CVC_MISMATCH + DEVICE_SCORE_1: :DEVICE_SCORE_1 + GENERIC_DECLINE: :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + end + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbs new file mode 100644 index 00000000..36252a45 --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event = + { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent", + tokenization_token: String + } + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbs new file mode 100644 index 00000000..359c1202 --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type digital_wallet_tokenization_two_factor_authentication_code_webhook_event = + { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code", + tokenization_token: String + } + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + + attr_accessor authentication_code: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_two_factor_authentication_code" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"digital_wallet.tokenization_two_factor_authentication_code" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbs new file mode 100644 index 00000000..3efeb386 --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + type digital_wallet_tokenization_updated_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_updated", + tokenization: Lithic::Tokenization + } + + class DigitalWalletTokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_updated" + + attr_accessor tokenization: Lithic::Tokenization + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization, + ?event_type: :"digital_wallet.tokenization_updated" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_updated", + tokenization: Lithic::Tokenization + } + end + end +end diff --git a/sig/lithic/models/dispute_evidence_upload_failed_webhook_event.rbs b/sig/lithic/models/dispute_evidence_upload_failed_webhook_event.rbs new file mode 100644 index 00000000..08e1b740 --- /dev/null +++ b/sig/lithic/models/dispute_evidence_upload_failed_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type dispute_evidence_upload_failed_webhook_event = + { event_type: :"dispute_evidence.upload_failed" } + + class DisputeEvidenceUploadFailedWebhookEvent < Lithic::Models::DisputeEvidence + def event_type: -> :"dispute_evidence.upload_failed" + + def event_type=: ( + :"dispute_evidence.upload_failed" _ + ) -> :"dispute_evidence.upload_failed" + + def initialize: (?event_type: :"dispute_evidence.upload_failed") -> void + + def to_hash: -> { event_type: :"dispute_evidence.upload_failed" } + end + end +end diff --git a/sig/lithic/models/dispute_transaction_created_webhook_event.rbs b/sig/lithic/models/dispute_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..0d240cfd --- /dev/null +++ b/sig/lithic/models/dispute_transaction_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type dispute_transaction_created_webhook_event = + { event_type: :"dispute_transaction.created" } + + class DisputeTransactionCreatedWebhookEvent < Lithic::Models::DisputeV2 + def event_type: -> :"dispute_transaction.created" + + def event_type=: ( + :"dispute_transaction.created" _ + ) -> :"dispute_transaction.created" + + def initialize: (?event_type: :"dispute_transaction.created") -> void + + def to_hash: -> { event_type: :"dispute_transaction.created" } + end + end +end diff --git a/sig/lithic/models/dispute_transaction_updated_webhook_event.rbs b/sig/lithic/models/dispute_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..4083d03b --- /dev/null +++ b/sig/lithic/models/dispute_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type dispute_transaction_updated_webhook_event = + { event_type: :"dispute_transaction.updated" } + + class DisputeTransactionUpdatedWebhookEvent < Lithic::Models::DisputeV2 + def event_type: -> :"dispute_transaction.updated" + + def event_type=: ( + :"dispute_transaction.updated" _ + ) -> :"dispute_transaction.updated" + + def initialize: (?event_type: :"dispute_transaction.updated") -> void + + def to_hash: -> { event_type: :"dispute_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/dispute_updated_webhook_event.rbs b/sig/lithic/models/dispute_updated_webhook_event.rbs new file mode 100644 index 00000000..3c3cc55f --- /dev/null +++ b/sig/lithic/models/dispute_updated_webhook_event.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type dispute_updated_webhook_event = { event_type: :"dispute.updated" } + + class DisputeUpdatedWebhookEvent < Lithic::Models::Dispute + def event_type: -> :"dispute.updated" + + def event_type=: (:"dispute.updated" _) -> :"dispute.updated" + + def initialize: (?event_type: :"dispute.updated") -> void + + def to_hash: -> { event_type: :"dispute.updated" } + end + end +end diff --git a/sig/lithic/models/external_bank_account_created_webhook_event.rbs b/sig/lithic/models/external_bank_account_created_webhook_event.rbs new file mode 100644 index 00000000..1415cfb7 --- /dev/null +++ b/sig/lithic/models/external_bank_account_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_bank_account_created_webhook_event = + { event_type: :"external_bank_account.created" } + + class ExternalBankAccountCreatedWebhookEvent < Lithic::Models::ExternalBankAccount + def event_type: -> :"external_bank_account.created" + + def event_type=: ( + :"external_bank_account.created" _ + ) -> :"external_bank_account.created" + + def initialize: (?event_type: :"external_bank_account.created") -> void + + def to_hash: -> { event_type: :"external_bank_account.created" } + end + end +end diff --git a/sig/lithic/models/external_bank_account_updated_webhook_event.rbs b/sig/lithic/models/external_bank_account_updated_webhook_event.rbs new file mode 100644 index 00000000..54c7e2a7 --- /dev/null +++ b/sig/lithic/models/external_bank_account_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_bank_account_updated_webhook_event = + { event_type: :"external_bank_account.updated" } + + class ExternalBankAccountUpdatedWebhookEvent < Lithic::Models::ExternalBankAccount + def event_type: -> :"external_bank_account.updated" + + def event_type=: ( + :"external_bank_account.updated" _ + ) -> :"external_bank_account.updated" + + def initialize: (?event_type: :"external_bank_account.updated") -> void + + def to_hash: -> { event_type: :"external_bank_account.updated" } + end + end +end diff --git a/sig/lithic/models/external_payment_created_webhook_event.rbs b/sig/lithic/models/external_payment_created_webhook_event.rbs new file mode 100644 index 00000000..c03b11b5 --- /dev/null +++ b/sig/lithic/models/external_payment_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_payment_created_webhook_event = + { event_type: :"external_payment.created" } + + class ExternalPaymentCreatedWebhookEvent < Lithic::Models::ExternalPayment + def event_type: -> :"external_payment.created" + + def event_type=: ( + :"external_payment.created" _ + ) -> :"external_payment.created" + + def initialize: (?event_type: :"external_payment.created") -> void + + def to_hash: -> { event_type: :"external_payment.created" } + end + end +end diff --git a/sig/lithic/models/external_payment_updated_webhook_event.rbs b/sig/lithic/models/external_payment_updated_webhook_event.rbs new file mode 100644 index 00000000..d26e5151 --- /dev/null +++ b/sig/lithic/models/external_payment_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_payment_updated_webhook_event = + { event_type: :"external_payment.updated" } + + class ExternalPaymentUpdatedWebhookEvent < Lithic::Models::ExternalPayment + def event_type: -> :"external_payment.updated" + + def event_type=: ( + :"external_payment.updated" _ + ) -> :"external_payment.updated" + + def initialize: (?event_type: :"external_payment.updated") -> void + + def to_hash: -> { event_type: :"external_payment.updated" } + end + end +end diff --git a/sig/lithic/models/financial_account_created_webhook_event.rbs b/sig/lithic/models/financial_account_created_webhook_event.rbs new file mode 100644 index 00000000..6c63f311 --- /dev/null +++ b/sig/lithic/models/financial_account_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type financial_account_created_webhook_event = + { event_type: :"financial_account.created" } + + class FinancialAccountCreatedWebhookEvent < Lithic::Models::FinancialAccount + def event_type: -> :"financial_account.created" + + def event_type=: ( + :"financial_account.created" _ + ) -> :"financial_account.created" + + def initialize: (?event_type: :"financial_account.created") -> void + + def to_hash: -> { event_type: :"financial_account.created" } + end + end +end diff --git a/sig/lithic/models/financial_account_updated_webhook_event.rbs b/sig/lithic/models/financial_account_updated_webhook_event.rbs new file mode 100644 index 00000000..acee43b0 --- /dev/null +++ b/sig/lithic/models/financial_account_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type financial_account_updated_webhook_event = + { event_type: :"financial_account.updated" } + + class FinancialAccountUpdatedWebhookEvent < Lithic::Models::FinancialAccount + def event_type: -> :"financial_account.updated" + + def event_type=: ( + :"financial_account.updated" _ + ) -> :"financial_account.updated" + + def initialize: (?event_type: :"financial_account.updated") -> void + + def to_hash: -> { event_type: :"financial_account.updated" } + end + end +end diff --git a/sig/lithic/models/funding_event_created_webhook_event.rbs b/sig/lithic/models/funding_event_created_webhook_event.rbs new file mode 100644 index 00000000..732170d8 --- /dev/null +++ b/sig/lithic/models/funding_event_created_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type funding_event_created_webhook_event = + { event_type: :"funding_event.created" } + + class FundingEventCreatedWebhookEvent < Lithic::Models::FundingEvent + def event_type: -> :"funding_event.created" + + def event_type=: (:"funding_event.created" _) -> :"funding_event.created" + + def initialize: (?event_type: :"funding_event.created") -> void + + def to_hash: -> { event_type: :"funding_event.created" } + end + end +end diff --git a/sig/lithic/models/internal_transaction_created_webhook_event.rbs b/sig/lithic/models/internal_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..20e6061d --- /dev/null +++ b/sig/lithic/models/internal_transaction_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type internal_transaction_created_webhook_event = + { event_type: :"internal_transaction.created" } + + class InternalTransactionCreatedWebhookEvent < Lithic::Models::InternalTransactionAPI + def event_type: -> :"internal_transaction.created" + + def event_type=: ( + :"internal_transaction.created" _ + ) -> :"internal_transaction.created" + + def initialize: (?event_type: :"internal_transaction.created") -> void + + def to_hash: -> { event_type: :"internal_transaction.created" } + end + end +end diff --git a/sig/lithic/models/internal_transaction_updated_webhook_event.rbs b/sig/lithic/models/internal_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..45bc3e5b --- /dev/null +++ b/sig/lithic/models/internal_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type internal_transaction_updated_webhook_event = + { event_type: :"internal_transaction.updated" } + + class InternalTransactionUpdatedWebhookEvent < Lithic::Models::InternalTransactionAPI + def event_type: -> :"internal_transaction.updated" + + def event_type=: ( + :"internal_transaction.updated" _ + ) -> :"internal_transaction.updated" + + def initialize: (?event_type: :"internal_transaction.updated") -> void + + def to_hash: -> { event_type: :"internal_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/loan_tape_created_webhook_event.rbs b/sig/lithic/models/loan_tape_created_webhook_event.rbs new file mode 100644 index 00000000..d172f3b9 --- /dev/null +++ b/sig/lithic/models/loan_tape_created_webhook_event.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type loan_tape_created_webhook_event = { event_type: :"loan_tape.created" } + + class LoanTapeCreatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + def event_type: -> :"loan_tape.created" + + def event_type=: (:"loan_tape.created" _) -> :"loan_tape.created" + + def initialize: (?event_type: :"loan_tape.created") -> void + + def to_hash: -> { event_type: :"loan_tape.created" } + end + end +end diff --git a/sig/lithic/models/loan_tape_updated_webhook_event.rbs b/sig/lithic/models/loan_tape_updated_webhook_event.rbs new file mode 100644 index 00000000..48116fb0 --- /dev/null +++ b/sig/lithic/models/loan_tape_updated_webhook_event.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type loan_tape_updated_webhook_event = { event_type: :"loan_tape.updated" } + + class LoanTapeUpdatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + def event_type: -> :"loan_tape.updated" + + def event_type=: (:"loan_tape.updated" _) -> :"loan_tape.updated" + + def initialize: (?event_type: :"loan_tape.updated") -> void + + def to_hash: -> { event_type: :"loan_tape.updated" } + end + end +end diff --git a/sig/lithic/models/management_operation_created_webhook_event.rbs b/sig/lithic/models/management_operation_created_webhook_event.rbs new file mode 100644 index 00000000..c07f1dcb --- /dev/null +++ b/sig/lithic/models/management_operation_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type management_operation_created_webhook_event = + { event_type: :"management_operation.created" } + + class ManagementOperationCreatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + def event_type: -> :"management_operation.created" + + def event_type=: ( + :"management_operation.created" _ + ) -> :"management_operation.created" + + def initialize: (?event_type: :"management_operation.created") -> void + + def to_hash: -> { event_type: :"management_operation.created" } + end + end +end diff --git a/sig/lithic/models/management_operation_updated_webhook_event.rbs b/sig/lithic/models/management_operation_updated_webhook_event.rbs new file mode 100644 index 00000000..bad1acfd --- /dev/null +++ b/sig/lithic/models/management_operation_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type management_operation_updated_webhook_event = + { event_type: :"management_operation.updated" } + + class ManagementOperationUpdatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + def event_type: -> :"management_operation.updated" + + def event_type=: ( + :"management_operation.updated" _ + ) -> :"management_operation.updated" + + def initialize: (?event_type: :"management_operation.updated") -> void + + def to_hash: -> { event_type: :"management_operation.updated" } + end + end +end diff --git a/sig/lithic/models/network_total_created_webhook_event.rbs b/sig/lithic/models/network_total_created_webhook_event.rbs new file mode 100644 index 00000000..bb7818a4 --- /dev/null +++ b/sig/lithic/models/network_total_created_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type network_total_created_webhook_event = + { event_type: :"network_total.created" } + + class NetworkTotalCreatedWebhookEvent < Lithic::Models::NetworkTotal + def event_type: -> :"network_total.created" + + def event_type=: (:"network_total.created" _) -> :"network_total.created" + + def initialize: (?event_type: :"network_total.created") -> void + + def to_hash: -> { event_type: :"network_total.created" } + end + end +end diff --git a/sig/lithic/models/network_total_updated_webhook_event.rbs b/sig/lithic/models/network_total_updated_webhook_event.rbs new file mode 100644 index 00000000..552b76fa --- /dev/null +++ b/sig/lithic/models/network_total_updated_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type network_total_updated_webhook_event = + { event_type: :"network_total.updated" } + + class NetworkTotalUpdatedWebhookEvent < Lithic::Models::NetworkTotal + def event_type: -> :"network_total.updated" + + def event_type=: (:"network_total.updated" _) -> :"network_total.updated" + + def initialize: (?event_type: :"network_total.updated") -> void + + def to_hash: -> { event_type: :"network_total.updated" } + end + end +end diff --git a/sig/lithic/models/parsed_webhook_event.rbs b/sig/lithic/models/parsed_webhook_event.rbs new file mode 100644 index 00000000..55da08e7 --- /dev/null +++ b/sig/lithic/models/parsed_webhook_event.rbs @@ -0,0 +1,641 @@ +module Lithic + module Models + type parsed_webhook_event = + Lithic::AccountHolderCreatedWebhookEvent + | Lithic::ParsedWebhookEvent::KYBPayload + | Lithic::ParsedWebhookEvent::KYCPayload + | Lithic::ParsedWebhookEvent::LegacyPayload + | Lithic::AccountHolderVerificationWebhookEvent + | Lithic::AccountHolderDocumentUpdatedWebhookEvent + | Lithic::AsaRequestWebhookEvent + | Lithic::TokenizationDecisioningRequestWebhookEvent + | Lithic::AuthRulesBacktestReportCreatedWebhookEvent + | Lithic::BalanceUpdatedWebhookEvent + | Lithic::BookTransferTransactionCreatedWebhookEvent + | Lithic::BookTransferTransactionUpdatedWebhookEvent + | Lithic::CardCreatedWebhookEvent + | Lithic::CardConvertedWebhookEvent + | Lithic::CardRenewedWebhookEvent + | Lithic::CardReissuedWebhookEvent + | Lithic::CardShippedWebhookEvent + | Lithic::CardTransactionUpdatedWebhookEvent + | Lithic::CardTransactionEnhancedDataCreatedWebhookEvent + | Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent + | Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent + | Lithic::DigitalWalletTokenizationResultWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::DigitalWalletTokenizationUpdatedWebhookEvent + | Lithic::DisputeUpdatedWebhookEvent + | Lithic::DisputeEvidenceUploadFailedWebhookEvent + | Lithic::ExternalBankAccountCreatedWebhookEvent + | Lithic::ExternalBankAccountUpdatedWebhookEvent + | Lithic::ExternalPaymentCreatedWebhookEvent + | Lithic::ExternalPaymentUpdatedWebhookEvent + | Lithic::FinancialAccountCreatedWebhookEvent + | Lithic::FinancialAccountUpdatedWebhookEvent + | Lithic::FundingEventCreatedWebhookEvent + | Lithic::LoanTapeCreatedWebhookEvent + | Lithic::LoanTapeUpdatedWebhookEvent + | Lithic::ManagementOperationCreatedWebhookEvent + | Lithic::ManagementOperationUpdatedWebhookEvent + | Lithic::InternalTransactionCreatedWebhookEvent + | Lithic::InternalTransactionUpdatedWebhookEvent + | Lithic::NetworkTotalCreatedWebhookEvent + | Lithic::NetworkTotalUpdatedWebhookEvent + | Lithic::PaymentTransactionCreatedWebhookEvent + | Lithic::PaymentTransactionUpdatedWebhookEvent + | Lithic::SettlementReportUpdatedWebhookEvent + | Lithic::StatementsCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationChallengeWebhookEvent + | Lithic::TokenizationApprovalRequestWebhookEvent + | Lithic::TokenizationResultWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::TokenizationUpdatedWebhookEvent + | Lithic::ThreeDSAuthentication + | Lithic::DisputeTransactionCreatedWebhookEvent + | Lithic::DisputeTransactionUpdatedWebhookEvent + + module ParsedWebhookEvent + extend Lithic::Internal::Type::Union + + type kyb_payload = + { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type, + external_id: String, + nature_of_business: String, + website_url: String + } + + class KYBPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type? + + def event_type=: ( + Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type + ) -> Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + ?event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type, + ?external_id: String, + ?nature_of_business: String, + ?website_url: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type, + external_id: String, + nature_of_business: String, + website_url: String + } + + type update_request = + { + beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity], + beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity]? + + def beneficial_owner_entities=: ( + ::Array[Lithic::KYBBusinessEntity] + ) -> ::Array[Lithic::KYBBusinessEntity] + + attr_reader beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + + attr_reader business_entity: Lithic::KYBBusinessEntity? + + def business_entity=: ( + Lithic::KYBBusinessEntity + ) -> Lithic::KYBBusinessEntity + + attr_reader control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson? + + def control_person=: ( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + + def initialize: ( + ?beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity], + ?beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + ?business_entity: Lithic::KYBBusinessEntity, + ?control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> void + + def to_hash: -> { + beneficial_owner_entities: ::Array[Lithic::KYBBusinessEntity], + beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + type beneficial_owner_individual = + { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) -> Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type control_person = + { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address? + + def address=: ( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) -> Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type] + end + end + + type kyc_payload = + { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + class KYCPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type? + + def event_type=: ( + Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type + ) -> Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + ?event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type, + ?external_id: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + type update_request = + { + individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual? + + def individual=: ( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + + def initialize: ( + ?individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> void + + def to_hash: -> { + individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + type individual = + { + address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address? + + def address=: ( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) -> Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type] + end + end + + type legacy_payload = + { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + class LegacyPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor business_account_token: String? + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type? + + def event_type=: ( + Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type + ) -> Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type + + attr_accessor external_id: String? + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + token: String, + ?business_account_token: String?, + ?created: Time, + ?email: String, + ?event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type, + ?external_id: String?, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type] + end + end + + def self?.variants: -> ::Array[Lithic::Models::parsed_webhook_event] + end + end +end diff --git a/sig/lithic/models/payment_transaction_created_webhook_event.rbs b/sig/lithic/models/payment_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..2c754cf8 --- /dev/null +++ b/sig/lithic/models/payment_transaction_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type payment_transaction_created_webhook_event = + { event_type: :"payment_transaction.created" } + + class PaymentTransactionCreatedWebhookEvent < Lithic::Models::Payment + def event_type: -> :"payment_transaction.created" + + def event_type=: ( + :"payment_transaction.created" _ + ) -> :"payment_transaction.created" + + def initialize: (?event_type: :"payment_transaction.created") -> void + + def to_hash: -> { event_type: :"payment_transaction.created" } + end + end +end diff --git a/sig/lithic/models/payment_transaction_updated_webhook_event.rbs b/sig/lithic/models/payment_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..eef7f4db --- /dev/null +++ b/sig/lithic/models/payment_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type payment_transaction_updated_webhook_event = + { event_type: :"payment_transaction.updated" } + + class PaymentTransactionUpdatedWebhookEvent < Lithic::Models::Payment + def event_type: -> :"payment_transaction.updated" + + def event_type=: ( + :"payment_transaction.updated" _ + ) -> :"payment_transaction.updated" + + def initialize: (?event_type: :"payment_transaction.updated") -> void + + def to_hash: -> { event_type: :"payment_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/settlement_report_updated_webhook_event.rbs b/sig/lithic/models/settlement_report_updated_webhook_event.rbs new file mode 100644 index 00000000..1d947673 --- /dev/null +++ b/sig/lithic/models/settlement_report_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type settlement_report_updated_webhook_event = + { event_type: :"settlement_report.updated" } + + class SettlementReportUpdatedWebhookEvent < Lithic::Models::SettlementReport + def event_type: -> :"settlement_report.updated" + + def event_type=: ( + :"settlement_report.updated" _ + ) -> :"settlement_report.updated" + + def initialize: (?event_type: :"settlement_report.updated") -> void + + def to_hash: -> { event_type: :"settlement_report.updated" } + end + end +end diff --git a/sig/lithic/models/statements_created_webhook_event.rbs b/sig/lithic/models/statements_created_webhook_event.rbs new file mode 100644 index 00000000..118b50c5 --- /dev/null +++ b/sig/lithic/models/statements_created_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type statements_created_webhook_event = + { event_type: :"statements.created" } + + class StatementsCreatedWebhookEvent < Lithic::Models::FinancialAccounts::Statement + def event_type: -> :"statements.created" + + def event_type=: (:"statements.created" _) -> :"statements.created" + + def initialize: (?event_type: :"statements.created") -> void + + def to_hash: -> { event_type: :"statements.created" } + end + end +end diff --git a/sig/lithic/models/three_ds_authentication_challenge_webhook_event.rbs b/sig/lithic/models/three_ds_authentication_challenge_webhook_event.rbs new file mode 100644 index 00000000..7b686c7c --- /dev/null +++ b/sig/lithic/models/three_ds_authentication_challenge_webhook_event.rbs @@ -0,0 +1,72 @@ +module Lithic + module Models + type three_ds_authentication_challenge_webhook_event = + { + authentication_object: Lithic::ThreeDSAuthentication, + challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + event_type: :"three_ds_authentication.challenge" + } + + class ThreeDSAuthenticationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor authentication_object: Lithic::ThreeDSAuthentication + + attr_accessor challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge + + attr_accessor event_type: :"three_ds_authentication.challenge" + + def initialize: ( + authentication_object: Lithic::ThreeDSAuthentication, + challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + ?event_type: :"three_ds_authentication.challenge" + ) -> void + + def to_hash: -> { + authentication_object: Lithic::ThreeDSAuthentication, + challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + event_type: :"three_ds_authentication.challenge" + } + + type challenge = + { + challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type, + expiry_time: Time, + start_time: Time, + app_requestor_url: String? + } + + class Challenge < Lithic::Internal::Type::BaseModel + attr_accessor challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type + + attr_accessor expiry_time: Time + + attr_accessor start_time: Time + + attr_accessor app_requestor_url: String? + + def initialize: ( + challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type, + expiry_time: Time, + start_time: Time, + ?app_requestor_url: String? + ) -> void + + def to_hash: -> { + challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type, + expiry_time: Time, + start_time: Time, + app_requestor_url: String? + } + + type challenge_method_type = :OUT_OF_BAND + + module ChallengeMethodType + extend Lithic::Internal::Type::Enum + + OUT_OF_BAND: :OUT_OF_BAND + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type] + end + end + end + end +end diff --git a/sig/lithic/models/three_ds_authentication_created_webhook_event.rbs b/sig/lithic/models/three_ds_authentication_created_webhook_event.rbs new file mode 100644 index 00000000..29da370f --- /dev/null +++ b/sig/lithic/models/three_ds_authentication_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type three_ds_authentication_created_webhook_event = + { event_type: :"three_ds_authentication.created" } + + class ThreeDSAuthenticationCreatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + def event_type: -> :"three_ds_authentication.created" + + def event_type=: ( + :"three_ds_authentication.created" _ + ) -> :"three_ds_authentication.created" + + def initialize: (?event_type: :"three_ds_authentication.created") -> void + + def to_hash: -> { event_type: :"three_ds_authentication.created" } + end + end +end diff --git a/sig/lithic/models/three_ds_authentication_updated_webhook_event.rbs b/sig/lithic/models/three_ds_authentication_updated_webhook_event.rbs new file mode 100644 index 00000000..cece2538 --- /dev/null +++ b/sig/lithic/models/three_ds_authentication_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type three_ds_authentication_updated_webhook_event = + { event_type: :"three_ds_authentication.updated" } + + class ThreeDSAuthenticationUpdatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + def event_type: -> :"three_ds_authentication.updated" + + def event_type=: ( + :"three_ds_authentication.updated" _ + ) -> :"three_ds_authentication.updated" + + def initialize: (?event_type: :"three_ds_authentication.updated") -> void + + def to_hash: -> { event_type: :"three_ds_authentication.updated" } + end + end +end diff --git a/sig/lithic/models/tokenization_approval_request_webhook_event.rbs b/sig/lithic/models/tokenization_approval_request_webhook_event.rbs new file mode 100644 index 00000000..6fbf2224 --- /dev/null +++ b/sig/lithic/models/tokenization_approval_request_webhook_event.rbs @@ -0,0 +1,223 @@ +module Lithic + module Models + type tokenization_approval_request_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + class TokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision? + + attr_accessor event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type + + attr_accessor issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision + + attr_accessor tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel + + attr_accessor tokenization_token: String + + attr_accessor wallet_decisioning_info: Lithic::WalletDecisioningInfo + + attr_reader device: Lithic::Device? + + def device=: (Lithic::Device) -> Lithic::Device + + attr_reader digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata? + + def digital_wallet_token_metadata=: ( + Lithic::DigitalWalletTokenMetadata + ) -> Lithic::DigitalWalletTokenMetadata + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_reader tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason]? + + def tokenization_decline_reasons=: ( + ::Array[Lithic::Models::tokenization_decline_reason] + ) -> ::Array[Lithic::Models::tokenization_decline_reason] + + attr_reader tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source? + + def tokenization_source=: ( + Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source + ) -> Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + ?device: Lithic::Device, + ?digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + ?tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + type customer_tokenization_decision = + { + outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + attr_accessor outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome + + attr_accessor responder_url: String + + attr_reader latency: String? + + def latency=: (String) -> String + + attr_reader response_code: String? + + def response_code=: (String) -> String + + def initialize: ( + outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + ?latency: String, + ?response_code: String + ) -> void + + def to_hash: -> { + outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + type outcome = + :APPROVED + | :DECLINED + | :ERROR + | :INVALID_RESPONSE + | :REQUIRE_ADDITIONAL_AUTHENTICATION + | :TIMEOUT + + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + ERROR: :ERROR + INVALID_RESPONSE: :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT: :TIMEOUT + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome] + end + end + + type event_type = :"tokenization.approval_request" + + module EventType + extend Lithic::Internal::Type::Enum + + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type] + end + + type issuer_decision = :APPROVED | :DENIED | :VERIFICATION_REQUIRED + + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DENIED: :DENIED + VERIFICATION_REQUIRED: :VERIFICATION_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision] + end + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT + + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel] + end + + type tokenization_source = + :ACCOUNT_ON_FILE + | :CONTACTLESS_TAP + | :MANUAL_PROVISION + | :PUSH_PROVISION + | :TOKEN + | :UNKNOWN + + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE: :ACCOUNT_ON_FILE + CONTACTLESS_TAP: :CONTACTLESS_TAP + MANUAL_PROVISION: :MANUAL_PROVISION + PUSH_PROVISION: :PUSH_PROVISION + TOKEN: :TOKEN + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source] + end + end + end +end diff --git a/sig/lithic/models/tokenization_decisioning_request_webhook_event.rbs b/sig/lithic/models/tokenization_decisioning_request_webhook_event.rbs new file mode 100644 index 00000000..cd7c4bd1 --- /dev/null +++ b/sig/lithic/models/tokenization_decisioning_request_webhook_event.rbs @@ -0,0 +1,134 @@ +module Lithic + module Models + type tokenization_decisioning_request_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + tokenization_source: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_source + } + + class TokenizationDecisioningRequestWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::event_type + + attr_accessor issuer_decision: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::issuer_decision + + attr_accessor tokenization_channel: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_channel + + attr_accessor tokenization_token: String + + attr_accessor wallet_decisioning_info: Lithic::WalletDecisioningInfo + + attr_reader device: Lithic::Device? + + def device=: (Lithic::Device) -> Lithic::Device + + attr_reader digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata? + + def digital_wallet_token_metadata=: ( + Lithic::DigitalWalletTokenMetadata + ) -> Lithic::DigitalWalletTokenMetadata + + attr_reader tokenization_source: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_source? + + def tokenization_source=: ( + Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_source + ) -> Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_source + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + event_type: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + ?device: Lithic::Device, + ?digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + ?tokenization_source: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_source + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + digital_wallet_token_metadata: Lithic::DigitalWalletTokenMetadata, + tokenization_source: Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_source + } + + type event_type = :"digital_wallet.tokenization_approval_request" + + module EventType + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + + def self?.values: -> ::Array[Lithic::Models::TokenizationDecisioningRequestWebhookEvent::event_type] + end + + type issuer_decision = :APPROVED | :DENIED | :VERIFICATION_REQUIRED + + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DENIED: :DENIED + VERIFICATION_REQUIRED: :VERIFICATION_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::TokenizationDecisioningRequestWebhookEvent::issuer_decision] + end + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT + + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_channel] + end + + type tokenization_source = + :ACCOUNT_ON_FILE + | :CONTACTLESS_TAP + | :MANUAL_PROVISION + | :PUSH_PROVISION + | :TOKEN + | :UNKNOWN + + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE: :ACCOUNT_ON_FILE + CONTACTLESS_TAP: :CONTACTLESS_TAP + MANUAL_PROVISION: :MANUAL_PROVISION + PUSH_PROVISION: :PUSH_PROVISION + TOKEN: :TOKEN + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::TokenizationDecisioningRequestWebhookEvent::tokenization_source] + end + end + end +end diff --git a/sig/lithic/models/tokenization_result_webhook_event.rbs b/sig/lithic/models/tokenization_result_webhook_event.rbs new file mode 100644 index 00000000..5f033d0d --- /dev/null +++ b/sig/lithic/models/tokenization_result_webhook_event.rbs @@ -0,0 +1,133 @@ +module Lithic + module Models + type tokenization_result_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.result", + tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + class TokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.result" + + attr_accessor tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String, + ?event_type: :"tokenization.result" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.result", + tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + type tokenization_result_details = + { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + attr_accessor issuer_decision: String + + attr_accessor tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + + attr_accessor customer_decision: String? + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_accessor token_activated_date_time: Time? + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + attr_accessor wallet_decision: String? + + def initialize: ( + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + ?customer_decision: String?, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?token_activated_date_time: Time?, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + ?wallet_decision: String? + ) -> void + + def to_hash: -> { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + type tokenization_decline_reason = + :ACCOUNT_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :CVC_MISMATCH + | :DEVICE_SCORE_1 + | :GENERIC_DECLINE + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :WALLET_RECOMMENDED_DECISION_RED + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + CVC_MISMATCH: :CVC_MISMATCH + DEVICE_SCORE_1: :DEVICE_SCORE_1 + GENERIC_DECLINE: :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + + def self?.values: -> ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbs b/sig/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbs new file mode 100644 index 00000000..f2faccb7 --- /dev/null +++ b/sig/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type tokenization_two_factor_authentication_code_sent_webhook_event = + { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code_sent", + tokenization_token: String + } + + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.two_factor_authentication_code_sent" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"tokenization.two_factor_authentication_code_sent" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code_sent", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbs b/sig/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbs new file mode 100644 index 00000000..983d3b10 --- /dev/null +++ b/sig/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type tokenization_two_factor_authentication_code_webhook_event = + { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code", + tokenization_token: String + } + + class TokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + + attr_accessor authentication_code: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.two_factor_authentication_code" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"tokenization.two_factor_authentication_code" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_updated_webhook_event.rbs b/sig/lithic/models/tokenization_updated_webhook_event.rbs new file mode 100644 index 00000000..d9a70820 --- /dev/null +++ b/sig/lithic/models/tokenization_updated_webhook_event.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + type tokenization_updated_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.updated", + tokenization: Lithic::Tokenization + } + + class TokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.updated" + + attr_accessor tokenization: Lithic::Tokenization + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization, + ?event_type: :"tokenization.updated" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.updated", + tokenization: Lithic::Tokenization + } + end + end +end diff --git a/sig/lithic/models/webhook_parsed_params.rbs b/sig/lithic/models/webhook_parsed_params.rbs new file mode 100644 index 00000000..33f55329 --- /dev/null +++ b/sig/lithic/models/webhook_parsed_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type webhook_parsed_params = + { } & Lithic::Internal::Type::request_parameters + + class WebhookParsedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/resources/webhooks.rbs b/sig/lithic/resources/webhooks.rbs new file mode 100644 index 00000000..910b38bc --- /dev/null +++ b/sig/lithic/resources/webhooks.rbs @@ -0,0 +1,135 @@ +module Lithic + module Resources + class Webhooks + def parse: ( + String payload, + headers: Hash[String, String], + ?secret: String? + ) -> (Lithic::AccountHolderCreatedWebhookEvent + | Lithic::ParsedWebhookEvent::KYBPayload + | Lithic::ParsedWebhookEvent::KYCPayload + | Lithic::ParsedWebhookEvent::LegacyPayload + | Lithic::AccountHolderVerificationWebhookEvent + | Lithic::AccountHolderDocumentUpdatedWebhookEvent + | Lithic::AsaRequestWebhookEvent + | Lithic::TokenizationDecisioningRequestWebhookEvent + | Lithic::AuthRulesBacktestReportCreatedWebhookEvent + | Lithic::BalanceUpdatedWebhookEvent + | Lithic::BookTransferTransactionCreatedWebhookEvent + | Lithic::BookTransferTransactionUpdatedWebhookEvent + | Lithic::CardCreatedWebhookEvent + | Lithic::CardConvertedWebhookEvent + | Lithic::CardRenewedWebhookEvent + | Lithic::CardReissuedWebhookEvent + | Lithic::CardShippedWebhookEvent + | Lithic::CardTransactionUpdatedWebhookEvent + | Lithic::CardTransactionEnhancedDataCreatedWebhookEvent + | Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent + | Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent + | Lithic::DigitalWalletTokenizationResultWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::DigitalWalletTokenizationUpdatedWebhookEvent + | Lithic::DisputeUpdatedWebhookEvent + | Lithic::DisputeEvidenceUploadFailedWebhookEvent + | Lithic::ExternalBankAccountCreatedWebhookEvent + | Lithic::ExternalBankAccountUpdatedWebhookEvent + | Lithic::ExternalPaymentCreatedWebhookEvent + | Lithic::ExternalPaymentUpdatedWebhookEvent + | Lithic::FinancialAccountCreatedWebhookEvent + | Lithic::FinancialAccountUpdatedWebhookEvent + | Lithic::FundingEventCreatedWebhookEvent + | Lithic::LoanTapeCreatedWebhookEvent + | Lithic::LoanTapeUpdatedWebhookEvent + | Lithic::ManagementOperationCreatedWebhookEvent + | Lithic::ManagementOperationUpdatedWebhookEvent + | Lithic::InternalTransactionCreatedWebhookEvent + | Lithic::InternalTransactionUpdatedWebhookEvent + | Lithic::NetworkTotalCreatedWebhookEvent + | Lithic::NetworkTotalUpdatedWebhookEvent + | Lithic::PaymentTransactionCreatedWebhookEvent + | Lithic::PaymentTransactionUpdatedWebhookEvent + | Lithic::SettlementReportUpdatedWebhookEvent + | Lithic::StatementsCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationChallengeWebhookEvent + | Lithic::TokenizationApprovalRequestWebhookEvent + | Lithic::TokenizationResultWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::TokenizationUpdatedWebhookEvent + | Lithic::ThreeDSAuthentication + | Lithic::DisputeTransactionCreatedWebhookEvent + | Lithic::DisputeTransactionUpdatedWebhookEvent) + + def parse_unsafe: ( + String payload + ) -> (Lithic::AccountHolderCreatedWebhookEvent + | Lithic::ParsedWebhookEvent::KYBPayload + | Lithic::ParsedWebhookEvent::KYCPayload + | Lithic::ParsedWebhookEvent::LegacyPayload + | Lithic::AccountHolderVerificationWebhookEvent + | Lithic::AccountHolderDocumentUpdatedWebhookEvent + | Lithic::AsaRequestWebhookEvent + | Lithic::TokenizationDecisioningRequestWebhookEvent + | Lithic::AuthRulesBacktestReportCreatedWebhookEvent + | Lithic::BalanceUpdatedWebhookEvent + | Lithic::BookTransferTransactionCreatedWebhookEvent + | Lithic::BookTransferTransactionUpdatedWebhookEvent + | Lithic::CardCreatedWebhookEvent + | Lithic::CardConvertedWebhookEvent + | Lithic::CardRenewedWebhookEvent + | Lithic::CardReissuedWebhookEvent + | Lithic::CardShippedWebhookEvent + | Lithic::CardTransactionUpdatedWebhookEvent + | Lithic::CardTransactionEnhancedDataCreatedWebhookEvent + | Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent + | Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent + | Lithic::DigitalWalletTokenizationResultWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::DigitalWalletTokenizationUpdatedWebhookEvent + | Lithic::DisputeUpdatedWebhookEvent + | Lithic::DisputeEvidenceUploadFailedWebhookEvent + | Lithic::ExternalBankAccountCreatedWebhookEvent + | Lithic::ExternalBankAccountUpdatedWebhookEvent + | Lithic::ExternalPaymentCreatedWebhookEvent + | Lithic::ExternalPaymentUpdatedWebhookEvent + | Lithic::FinancialAccountCreatedWebhookEvent + | Lithic::FinancialAccountUpdatedWebhookEvent + | Lithic::FundingEventCreatedWebhookEvent + | Lithic::LoanTapeCreatedWebhookEvent + | Lithic::LoanTapeUpdatedWebhookEvent + | Lithic::ManagementOperationCreatedWebhookEvent + | Lithic::ManagementOperationUpdatedWebhookEvent + | Lithic::InternalTransactionCreatedWebhookEvent + | Lithic::InternalTransactionUpdatedWebhookEvent + | Lithic::NetworkTotalCreatedWebhookEvent + | Lithic::NetworkTotalUpdatedWebhookEvent + | Lithic::PaymentTransactionCreatedWebhookEvent + | Lithic::PaymentTransactionUpdatedWebhookEvent + | Lithic::SettlementReportUpdatedWebhookEvent + | Lithic::StatementsCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationChallengeWebhookEvent + | Lithic::TokenizationApprovalRequestWebhookEvent + | Lithic::TokenizationResultWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::TokenizationUpdatedWebhookEvent + | Lithic::ThreeDSAuthentication + | Lithic::DisputeTransactionCreatedWebhookEvent + | Lithic::DisputeTransactionUpdatedWebhookEvent) + + def verify_signature: ( + payload: String, + headers: Hash[String, String], + ?secret: String? + ) -> Hash[Symbol, untyped] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/test/lithic/resources/webhooks_test.rb b/test/lithic/resources/webhooks_test.rb new file mode 100644 index 00000000..175be07c --- /dev/null +++ b/test/lithic/resources/webhooks_test.rb @@ -0,0 +1,197 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::WebhooksTest < Lithic::Test::ResourceTest + def test_parse_unsafe_webhook_payload + payload = { + event_type: "card.created", + data: { + token: "test_token", + type: "SINGLE_USE", + state: "OPEN" + } + }.to_json + + event = @lithic.webhooks.parse_unsafe(payload) + # Verify the event was parsed successfully + assert(event) + assert_equal("card.created", event.event_type) + end + + def test_parse_with_valid_signature + skip("standardwebhooks gem not installed") unless gem_installed?("standardwebhooks") + + require("standardwebhooks") + + secret = "whsec_test_secret" + payload = '{"event_type":"card.created","card_token":"test_card_token_123"}' + timestamp = Time.now.to_i.to_s + + # Generate a valid signature + wh = StandardWebhooks::Webhook.new(secret) + signature = wh.sign("test_msg_id", timestamp, payload) + + headers = { + "webhook-id" => "test_msg_id", + "webhook-timestamp" => timestamp, + "webhook-signature" => signature + } + + # Should verify and return typed event + event = @lithic.webhooks.parse(payload, headers: headers, secret: secret) + assert(event) + assert_equal(:"card.created", event.event_type) + + # Verify we can pattern match on the typed event + case event + when Lithic::Models::CardCreatedWebhookEvent + assert_equal("test_card_token_123", event.card_token) + else + flunk("Expected CardCreatedWebhookEvent, got #{event.class}") + end + end + + def test_parse_with_env_var_secret + skip("standardwebhooks gem not installed") unless gem_installed?("standardwebhooks") + + require("standardwebhooks") + + secret = "whsec_test_secret" + payload = '{"event_type":"card.created","data":{"token":"test_token"}}' + timestamp = Time.now.to_i.to_s + + # Generate a valid signature + wh = StandardWebhooks::Webhook.new(secret) + signature = wh.sign("test_msg_id", timestamp, payload) + + headers = { + "webhook-id" => "test_msg_id", + "webhook-timestamp" => timestamp, + "webhook-signature" => signature + } + + # Set env var + ENV["LITHIC_WEBHOOK_SECRET"] = secret + begin + # Should use env var when secret not provided + event = @lithic.webhooks.parse(payload, headers: headers) + assert(event) + assert_equal("card.created", event.event_type) + ensure + ENV.delete("LITHIC_WEBHOOK_SECRET") + end + end + + def test_parse_raises_when_secret_missing + skip("standardwebhooks gem not installed") unless gem_installed?("standardwebhooks") + + payload = '{"event_type":"card.created"}' + headers = { + "webhook-id" => "test_msg_id", + "webhook-timestamp" => Time.now.to_i.to_s, + "webhook-signature" => "v1,invalid" + } + + # Ensure env var is not set + ENV.delete("LITHIC_WEBHOOK_SECRET") + + error = assert_raises(ArgumentError) do + @lithic.webhooks.parse(payload, headers: headers) + end + + assert_match(/LITHIC_WEBHOOK_SECRET/, error.message) + end + + def test_verify_signature_with_valid_signature + skip("standardwebhooks gem not installed") unless gem_installed?("standardwebhooks") + + require("standardwebhooks") + + secret = "whsec_test_secret" + payload = '{"event_type":"card.created"}' + timestamp = Time.now.to_i.to_s + + # Generate a valid signature + wh = StandardWebhooks::Webhook.new(secret) + signature = wh.sign("test_msg_id", timestamp, payload) + + headers = { + "webhook-id" => "test_msg_id", + "webhook-timestamp" => timestamp, + "webhook-signature" => signature + } + + # Should not raise an error and returns the parsed JSON + result = @lithic.webhooks.verify_signature( + payload: payload, + headers: headers, + secret: secret + ) + + # verify returns the parsed JSON content with symbolized keys + assert_equal("card.created", result[:event_type]) + end + + def test_verify_signature_raises_on_invalid_signature + skip("standardwebhooks gem not installed") unless gem_installed?("standardwebhooks") + + require("standardwebhooks") + + secret = "whsec_test_secret" + payload = '{"event_type":"card.created"}' + + headers = { + "webhook-id" => "test_msg_id", + "webhook-timestamp" => Time.now.to_i.to_s, + "webhook-signature" => "v1,invalid_signature" + } + + assert_raises(StandardWebhooks::WebhookVerificationError) do + @lithic.webhooks.verify_signature( + payload: payload, + headers: headers, + secret: secret + ) + end + end + + def test_verify_signature_with_env_var + skip("standardwebhooks gem not installed") unless gem_installed?("standardwebhooks") + + require("standardwebhooks") + + secret = "whsec_test_secret" + payload = '{"event_type":"card.created"}' + timestamp = Time.now.to_i.to_s + + # Generate a valid signature + wh = StandardWebhooks::Webhook.new(secret) + signature = wh.sign("test_msg_id", timestamp, payload) + + headers = { + "webhook-id" => "test_msg_id", + "webhook-timestamp" => timestamp, + "webhook-signature" => signature + } + + # Set env var + ENV["LITHIC_WEBHOOK_SECRET"] = secret + begin + # Should use env var when secret not provided + result = @lithic.webhooks.verify_signature(payload: payload, headers: headers) + assert_equal("card.created", result[:event_type]) + ensure + ENV.delete("LITHIC_WEBHOOK_SECRET") + end + end + + private + + def gem_installed?(gem_name) + require(gem_name) + true + rescue LoadError + false + end +end From b5c33b4d052b55a9310fa96a0fe03ecd84eb0ad5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:32:52 +0000 Subject: [PATCH 2/2] release: 0.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/lithic/version.rb | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3d2ac0bd..10f30916 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.2.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e0095b8b..2468db0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.2.0 (2025-12-10) + +Full Changelog: [v0.1.0...v0.2.0](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0...v0.2.0) + +### Features + +* **api:** add webhook schemas to SDKs - add parse and parse_unsafe ([c40835b](https://github.com/lithic-com/lithic-ruby/commit/c40835b8afae6973e80baccab4017a99d15b4ac4)) + + +### Chores + +* replace custom webhook signature verification with standardwebhooks ([c40835b](https://github.com/lithic-com/lithic-ruby/commit/c40835b8afae6973e80baccab4017a99d15b4ac4)) + ## 0.1.0 (2025-12-09) Full Changelog: [v0.1.0-alpha.56...v0.1.0](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.56...v0.1.0) diff --git a/Gemfile.lock b/Gemfile.lock index aa37a26e..1c2f037c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GIT PATH remote: . specs: - lithic (0.1.0) + lithic (0.2.0) connection_pool GEM diff --git a/README.md b/README.md index 9231a939..e5d25e76 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "lithic", "~> 0.1.0" +gem "lithic", "~> 0.2.0" ``` diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index 980aa94d..11e5674a 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.1.0" + VERSION = "0.2.0" end