From ec84fa6daf7f6ea5d9307d47abfc72d62ec6a29f Mon Sep 17 00:00:00 2001 From: axshani Date: Sun, 17 Apr 2022 17:37:04 +0300 Subject: [PATCH 1/2] new events to be added to the sdk --- types/events.ts | 139 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 120 insertions(+), 19 deletions(-) diff --git a/types/events.ts b/types/events.ts index cb27fb4d..6eae5d14 100644 --- a/types/events.ts +++ b/types/events.ts @@ -1,24 +1,10 @@ -import {Relationship, Tags, UnimplementedFields, UnimplementedRelationships} from "./common" +import { Relationship, Tags, UnimplementedFields, UnimplementedRelationships } from "./common" export type UnitEvent = - AccountClosed | - AccountFrozen | - AccountReopened | - AccountUnfrozen | - ApplicationDenied | - ApplicationAwaitingDocuments | - ApplicationPendingReview | - AuthorizationCreated | - CardActivated | - CardStatusChanged | - CustomerCreated | - DocumentApproved | - DocumentRejected | - PaymentClearing | - PaymentReturned | - PaymentSent | - StatementsCreated | - TransactionCreated + AccountClosed | AccountFrozen | AccountReopened | AccountUnfrozen | ApplicationDenied | ApplicationAwaitingDocuments | ApplicationPendingReview | + AuthorizationCreated | CardActivated | CardStatusChanged | CustomerCreated | DocumentApproved | DocumentRejected | PaymentClearing | PaymentReturned | + PaymentSent | StatementsCreated | TransactionCreated | ReceivedPaymentCreated | ReceivedPaymentAdvanced | ReceivedPaymentCompleted | ReceivedPaymentReturned | + ChargeBackCreated | RewardCreated | RewardSent | RewardRejected export interface BaseEvent { id: string @@ -218,3 +204,118 @@ export type TransactionCreated = BaseEvent & { } } +export type TransactionUpdated = BaseEvent & { + type: "transaction.updated" + attributes: { + interchange: number + } + relationships: { + transaction: Relationship + } +} + +export type ReceivedPaymentCreated = BaseEvent & { + type: "receivedPayment.created" + attributes: { + status: string + type: string + amount: number + completionDate: string + companyName: string + counterpartyRoutingNumber: string + description: string + traceNumber: string + secCode: string + addenda: string + } + relationships: { + receivedPayment: Relationship + account: Relationship + customer: Relationship + } +} + +export type ReceivedPaymentAdvanced = BaseEvent & { + type: "receivedPayment.advanced" + attributes: { + previousStatus: string + wasAdvanced: boolean + } + relationships: { + receivedPayment: Relationship + account: Relationship + customer: Relationship + } +} + +export type ReceivedPaymentCompleted = BaseEvent & { + type: "receivedPayment.completed" + attributes: { + previousStatus: string + wasAdvanced: boolean + } + relationships: { + receivedPayment: Relationship + account: Relationship + customer: Relationship + } +} + +export type ReceivedPaymentReturned = BaseEvent & { + type: "receivedPayment.returned" + attributes: { + previousStatus: string + wasAdvanced: boolean + } + relationships: { + receivedPayment: Relationship + account: Relationship + customer: Relationship + } +} + +export type ChargeBackCreated = BaseEvent & { + type: "chargeback.created" + attributes: { + amount: number + description: string + } + relationships: { + chargeback: Relationship + account: Relationship + customer: Relationship + counterpartyAccount: Relationship + transaction: Relationship + } +} + +export type RewardCreated = BaseEvent & { + type: "reward.created" + relationships: { + reward: Relationship + fundingAccount: Relationship + receivingAccount: Relationship + customer: Relationship + } +} + +export type RewardSent = BaseEvent & { + type: "reward.sent" + relationships: { + reward: Relationship + fundingAccount: Relationship + receivingAccount: Relationship + customer: Relationship + } +} + +export type RewardRejected = BaseEvent & { + type: "reward.rejected" + relationships: { + reward: Relationship + fundingAccount: Relationship + receivingAccount: Relationship + customer: Relationship + } +} + From f269501cd7869735d5e31ee1b155b25adb9bba45 Mon Sep 17 00:00:00 2001 From: axshani Date: Mon, 9 May 2022 15:17:06 +0300 Subject: [PATCH 2/2] no reward created --- types/events.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/types/events.ts b/types/events.ts index 6eae5d14..12738d99 100644 --- a/types/events.ts +++ b/types/events.ts @@ -4,7 +4,7 @@ export type UnitEvent = AccountClosed | AccountFrozen | AccountReopened | AccountUnfrozen | ApplicationDenied | ApplicationAwaitingDocuments | ApplicationPendingReview | AuthorizationCreated | CardActivated | CardStatusChanged | CustomerCreated | DocumentApproved | DocumentRejected | PaymentClearing | PaymentReturned | PaymentSent | StatementsCreated | TransactionCreated | ReceivedPaymentCreated | ReceivedPaymentAdvanced | ReceivedPaymentCompleted | ReceivedPaymentReturned | - ChargeBackCreated | RewardCreated | RewardSent | RewardRejected + ChargeBackCreated | RewardSent | RewardRejected export interface BaseEvent { id: string @@ -289,16 +289,6 @@ export type ChargeBackCreated = BaseEvent & { } } -export type RewardCreated = BaseEvent & { - type: "reward.created" - relationships: { - reward: Relationship - fundingAccount: Relationship - receivingAccount: Relationship - customer: Relationship - } -} - export type RewardSent = BaseEvent & { type: "reward.sent" relationships: {