Skip to content

Commit

Permalink
feat(api): updates (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jul 17, 2024
1 parent 987ef3c commit 89044e2
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 88 deletions.
17 changes: 16 additions & 1 deletion src/resources/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ export interface Event {
| 'payment_transaction.updated'
| 'settlement_report.updated'
| 'three_ds_authentication.created'
| 'transfer_transaction.created';
| 'transfer_transaction.created'
| 'tokenization.approval_request'
| 'tokenization.result'
| 'tokenization.two_factor_authentication_code'
| 'tokenization.two_factor_authentication_code_sent'
| 'tokenization.updated';

payload: Record<string, unknown>;
}
Expand Down Expand Up @@ -196,6 +201,11 @@ export interface EventSubscription {
| 'settlement_report.updated'
| 'three_ds_authentication.created'
| 'transfer_transaction.created'
| 'tokenization.approval_request'
| 'tokenization.result'
| 'tokenization.two_factor_authentication_code'
| 'tokenization.two_factor_authentication_code_sent'
| 'tokenization.updated'
> | null;
}

Expand Down Expand Up @@ -283,6 +293,11 @@ export interface EventListParams extends CursorPageParams {
| 'settlement_report.updated'
| 'three_ds_authentication.created'
| 'transfer_transaction.created'
| 'tokenization.approval_request'
| 'tokenization.result'
| 'tokenization.two_factor_authentication_code'
| 'tokenization.two_factor_authentication_code_sent'
| 'tokenization.updated'
>;

/**
Expand Down
17 changes: 16 additions & 1 deletion src/resources/events/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ export interface SubscriptionCreateParams {
| 'settlement_report.updated'
| 'three_ds_authentication.created'
| 'transfer_transaction.created'
| 'tokenization.approval_request'
| 'tokenization.result'
| 'tokenization.two_factor_authentication_code'
| 'tokenization.two_factor_authentication_code_sent'
| 'tokenization.updated'
>;
}

Expand Down Expand Up @@ -289,6 +294,11 @@ export interface SubscriptionUpdateParams {
| 'settlement_report.updated'
| 'three_ds_authentication.created'
| 'transfer_transaction.created'
| 'tokenization.approval_request'
| 'tokenization.result'
| 'tokenization.two_factor_authentication_code'
| 'tokenization.two_factor_authentication_code_sent'
| 'tokenization.updated'
>;
}

Expand Down Expand Up @@ -365,7 +375,12 @@ export interface SubscriptionSendSimulatedExampleParams {
| 'payment_transaction.updated'
| 'settlement_report.updated'
| 'three_ds_authentication.created'
| 'transfer_transaction.created';
| 'transfer_transaction.created'
| 'tokenization.approval_request'
| 'tokenization.result'
| 'tokenization.two_factor_authentication_code'
| 'tokenization.two_factor_authentication_code_sent'
| 'tokenization.updated';
}

export namespace Subscriptions {
Expand Down
83 changes: 41 additions & 42 deletions src/resources/financial-accounts/financial-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export interface FinancialAccount {
*/
created: string;

/**
* Whether the financial account holds funds for benefit of another party.
*/
is_for_benefit_of: boolean;

/**
* Type of financial account
*/
Expand Down Expand Up @@ -227,48 +232,37 @@ export namespace FinancialTransaction {
result?: 'APPROVED' | 'DECLINED';

/**
* Event types:
*
* - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending
* approval/release from an ACH hold.
* - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process.
* - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled.
* - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to
* the fed.
* - `ACH_ORIGINATION_SETTLED` - ACH origination has settled.
* - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to
* available balance.
* - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository
* Financial Institution.
* - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder.
* - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt.
* - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled.
* - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available
* balance.
* - `AUTHORIZATION` - Authorize a card transaction.
* - `AUTHORIZATION_ADVICE` - Advice on a card transaction.
* - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by
* Lithic.
* - `AUTHORIZATION_REVERSAL` - Card Authorization was reversed by the merchant.
* - `BALANCE_INQUIRY` - A card balance inquiry (typically a $0 authorization) has
* occurred on a card.
* - `CLEARING` - Card Transaction is settled.
* - `CORRECTION_DEBIT` - Manual card transaction correction (Debit).
* - `CORRECTION_CREDIT` - Manual card transaction correction (Credit).
* - `CREDIT_AUTHORIZATION` - A refund or credit card authorization from a
* merchant.
* - `CREDIT_AUTHORIZATION_ADVICE` - A credit card authorization was approved on
* your behalf by the network.
* - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit card funds
* without additional clearing.
* - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or
* credit card funds without additional clearing.
* - `RETURN` - A card refund has been processed on the transaction.
* - `RETURN_REVERSAL` - A card refund has been reversed (e.g., when a merchant
* reverses an incorrect refund).
* - `TRANSFER` - Successful internal transfer of funds between financial accounts.
* - `TRANSFER_INSUFFICIENT_FUNDS` - Declined internl transfer of funds due to
* insufficient balance of the sender.
* Event types: _ `ACH_ORIGINATION_INITIATED` - ACH origination received and
* pending approval/release from an ACH hold. _ `ACH_ORIGINATION_REVIEWED` - ACH
* origination has completed the review process. _ `ACH_ORIGINATION_CANCELLED` -
* ACH origination has been cancelled. _ `ACH_ORIGINATION_PROCESSED` - ACH
* origination has been processed and sent to the fed. _
* `ACH_ORIGINATION_SETTLED` - ACH origination has settled. _
* `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available
* balance. _ `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving
* Depository Financial Institution. _ `ACH_RECEIPT_PROCESSED` - ACH receipt
* pending release from an ACH holder. _ `ACH_RETURN_INITIATED` - ACH initiated
* return for a ACH receipt. _ `ACH_RECEIPT_SETTLED` - ACH receipt funds have
* settled. _ `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to
* available balance. _ `AUTHORIZATION` - Authorize a card transaction. _
* `AUTHORIZATION_ADVICE` - Advice on a card transaction. _
* `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic.
* _ `AUTHORIZATION_REVERSAL` - Card Authorization was reversed by the merchant. _
* `BALANCE_INQUIRY` - A card balance inquiry (typically a $0 authorization) has
* occurred on a card. _ `CLEARING` - Card Transaction is settled. _
* `CORRECTION_DEBIT` - Manual card transaction correction (Debit). _
* `CORRECTION_CREDIT` - Manual card transaction correction (Credit). _
* `CREDIT_AUTHORIZATION` - A refund or credit card authorization from a merchant.
* _ `CREDIT_AUTHORIZATION_ADVICE` - A credit card authorization was approved on
* your behalf by the network. _ `FINANCIAL_AUTHORIZATION` - A request from a
* merchant to debit card funds without additional clearing. _
* `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or credit
* card funds without additional clearing. _ `RETURN` - A card refund has been
* processed on the transaction. _ `RETURN_REVERSAL` - A card refund has been
* reversed (e.g., when a merchant reverses an incorrect refund). _ `TRANSFER` -
* Successful internal transfer of funds between financial accounts. \*
* `TRANSFER_INSUFFICIENT_FUNDS` - Declined internal transfer of funds due to
* insufficient balance of the sender.
*/
type?:
| 'ACH_ORIGINATION_CANCELLED'
Expand Down Expand Up @@ -316,6 +310,11 @@ export interface FinancialAccountCreateParams {
*/
account_token?: string;

/**
* Body param:
*/
is_for_benefit_of?: boolean;

/**
* Header param:
*/
Expand Down
24 changes: 22 additions & 2 deletions src/resources/tokenizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,18 @@ export interface Tokenization {
status: 'ACTIVE' | 'DEACTIVATED' | 'INACTIVE' | 'PAUSED' | 'PENDING_2FA' | 'PENDING_ACTIVATION' | 'UNKNOWN';

/**
* The entity that is requested the tokenization. Represents a Digital Wallet.
* The entity that requested the tokenization. Represents a Digital Wallet or
* merchant.
*/
token_requestor_name:
| 'AMAZON_ONE'
| 'ANDROID_PAY'
| 'APPLE_PAY'
| 'FACEBOOK'
| 'FITBIT_PAY'
| 'GARMIN_PAY'
| 'MICROSOFT_PAY'
| 'NETFLIX'
| 'SAMSUNG_PAY'
| 'UNKNOWN'
| 'VISA_CHECKOUT';
Expand All @@ -212,6 +215,11 @@ export interface Tokenization {
*/
token_unique_reference: string;

/**
* The channel through which the tokenization was made.
*/
tokenization_channel: 'DIGITAL_WALLET' | 'MERCHANT';

/**
* Latest date and time when the tokenization was updated. UTC time zone.
*/
Expand Down Expand Up @@ -303,6 +311,12 @@ export interface TokenizationListParams extends CursorPageParams {
* Filter for tokenizations created before this date.
*/
end?: string;

/**
* Filter for tokenizations by tokenization channel. If this is not specified, only
* DIGITAL_WALLET tokenizations will be returned.
*/
tokenization_channel?: 'DIGITAL_WALLET' | 'MERCHANT';
}

export interface TokenizationResendActivationCodeParams {
Expand Down Expand Up @@ -333,7 +347,7 @@ export interface TokenizationSimulateParams {
/**
* The source of the tokenization request.
*/
tokenization_source: 'APPLE_PAY' | 'GOOGLE' | 'SAMSUNG_PAY';
tokenization_source: 'APPLE_PAY' | 'GOOGLE' | 'SAMSUNG_PAY' | 'MERCHANT';

/**
* The account score (1-5) that represents how the Digital Wallet's view on how
Expand All @@ -347,6 +361,12 @@ export interface TokenizationSimulateParams {
*/
device_score?: number;

/**
* Optional field to specify the token requestor name for a merchant token
* simulation. Ignored when tokenization_source is not MERCHANT.
*/
entity?: string;

/**
* The decision that the Digital Wallet's recommend
*/
Expand Down
73 changes: 31 additions & 42 deletions src/resources/transfers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,48 +121,37 @@ export namespace Transfer {
result?: 'APPROVED' | 'DECLINED';

/**
* Event types:
*
* - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending
* approval/release from an ACH hold.
* - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process.
* - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled.
* - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to
* the fed.
* - `ACH_ORIGINATION_SETTLED` - ACH origination has settled.
* - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to
* available balance.
* - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository
* Financial Institution.
* - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder.
* - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt.
* - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled.
* - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available
* balance.
* - `AUTHORIZATION` - Authorize a card transaction.
* - `AUTHORIZATION_ADVICE` - Advice on a card transaction.
* - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by
* Lithic.
* - `AUTHORIZATION_REVERSAL` - Card Authorization was reversed by the merchant.
* - `BALANCE_INQUIRY` - A card balance inquiry (typically a $0 authorization) has
* occurred on a card.
* - `CLEARING` - Card Transaction is settled.
* - `CORRECTION_DEBIT` - Manual card transaction correction (Debit).
* - `CORRECTION_CREDIT` - Manual card transaction correction (Credit).
* - `CREDIT_AUTHORIZATION` - A refund or credit card authorization from a
* merchant.
* - `CREDIT_AUTHORIZATION_ADVICE` - A credit card authorization was approved on
* your behalf by the network.
* - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit card funds
* without additional clearing.
* - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or
* credit card funds without additional clearing.
* - `RETURN` - A card refund has been processed on the transaction.
* - `RETURN_REVERSAL` - A card refund has been reversed (e.g., when a merchant
* reverses an incorrect refund).
* - `TRANSFER` - Successful internal transfer of funds between financial accounts.
* - `TRANSFER_INSUFFICIENT_FUNDS` - Declined internl transfer of funds due to
* insufficient balance of the sender.
* Event types: _ `ACH_ORIGINATION_INITIATED` - ACH origination received and
* pending approval/release from an ACH hold. _ `ACH_ORIGINATION_REVIEWED` - ACH
* origination has completed the review process. _ `ACH_ORIGINATION_CANCELLED` -
* ACH origination has been cancelled. _ `ACH_ORIGINATION_PROCESSED` - ACH
* origination has been processed and sent to the fed. _
* `ACH_ORIGINATION_SETTLED` - ACH origination has settled. _
* `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available
* balance. _ `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving
* Depository Financial Institution. _ `ACH_RECEIPT_PROCESSED` - ACH receipt
* pending release from an ACH holder. _ `ACH_RETURN_INITIATED` - ACH initiated
* return for a ACH receipt. _ `ACH_RECEIPT_SETTLED` - ACH receipt funds have
* settled. _ `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to
* available balance. _ `AUTHORIZATION` - Authorize a card transaction. _
* `AUTHORIZATION_ADVICE` - Advice on a card transaction. _
* `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic.
* _ `AUTHORIZATION_REVERSAL` - Card Authorization was reversed by the merchant. _
* `BALANCE_INQUIRY` - A card balance inquiry (typically a $0 authorization) has
* occurred on a card. _ `CLEARING` - Card Transaction is settled. _
* `CORRECTION_DEBIT` - Manual card transaction correction (Debit). _
* `CORRECTION_CREDIT` - Manual card transaction correction (Credit). _
* `CREDIT_AUTHORIZATION` - A refund or credit card authorization from a merchant.
* _ `CREDIT_AUTHORIZATION_ADVICE` - A credit card authorization was approved on
* your behalf by the network. _ `FINANCIAL_AUTHORIZATION` - A request from a
* merchant to debit card funds without additional clearing. _
* `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or credit
* card funds without additional clearing. _ `RETURN` - A card refund has been
* processed on the transaction. _ `RETURN_REVERSAL` - A card refund has been
* reversed (e.g., when a merchant reverses an incorrect refund). _ `TRANSFER` -
* Successful internal transfer of funds between financial accounts. \*
* `TRANSFER_INSUFFICIENT_FUNDS` - Declined internal transfer of funds due to
* insufficient balance of the sender.
*/
type?:
| 'ACH_ORIGINATION_CANCELLED'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('resource financialAccounts', () => {
nickname: 'nickname',
type: 'OPERATING',
account_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
is_for_benefit_of: true,
'Idempotency-Key': '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
});
Expand Down
2 changes: 2 additions & 0 deletions tests/api-resources/tokenizations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe('resource tokenizations', () => {
ending_before: 'ending_before',
page_size: 1,
starting_after: 'starting_after',
tokenization_channel: 'DIGITAL_WALLET',
},
{ path: '/_stainless_unknown_path' },
),
Expand Down Expand Up @@ -180,6 +181,7 @@ describe('resource tokenizations', () => {
tokenization_source: 'APPLE_PAY',
account_score: 5,
device_score: 5,
entity: 'entity',
wallet_recommended_decision: 'APPROVED',
});
});
Expand Down

0 comments on commit 89044e2

Please sign in to comment.