Skip to content

PSP-Events

PspFunding Events

Cards Events

1. ExternalCardUpdatedEvent

Published whenever we have any change in the card data( status , preferred value , fingerprint. etc...)

There is another event named ExternalCardUpdatedCompensationEvent. It has the same properties always. The compensation event is used when we need to send out external card updating information to do backfill (in Data Warehouse and risk)

ExternalCardUpdatedEvent definition
/// <summary>
///     PSP funding external card updated event.
///     Triggers every time an external card is created or updated.
/// </summary>
[Message("psp-external-card", "ExternalCardUpdatedEvent", true)]
[Message("psp-external-card-updated", "ExternalCardUpdatedEvent")]
[Kpi("psp-external-card-updated", KpiStats.Increment)]
public class ExternalCardUpdatedEvent : ExternalCardUpdatedEventBillingAddress
{
    [KpiTag]
    [JsonProperty("avsCheck")]
    public bool? AvsCheck { get; set; }

    [JsonProperty("bin")]
    public string Bin { get; set; }

    [JsonProperty("cardDataSource")]
    [EnumDataType(typeof(CardDataSource))]
    public CardDataSource CardDataSource { get; set; } = CardDataSource.Manual;

    [JsonProperty("cardId")]
    public Guid CardId { get; set; }

    [JsonProperty("declienErrorCodes")]
    public string DeclineErrorCodes { get; set; }

    [JsonProperty("declineReason")]
    [EnumDataType(typeof(DeclineReason))]
    public DeclineReason? DeclineReason { get; set; }

    [JsonProperty("description")]
    public string Description { get; set; }

    [JsonProperty("expirationDate")]
    public DateTime? ExpirationDate { get; set; }

    [JsonProperty("externalBlockingIdentifier")]
    public Guid? ExternalBlockingIdentifier { get; set; }

    [KpiTag]
    [JsonProperty("externalCardGatewayId")]
    [EnumDataType(typeof(ExternalCardGateway))]
    public ExternalCardGateway ExternalCardGatewayId { get; set; }

    [JsonProperty("fingerprint")]
    public string Fingerprint { get; set; }

    [JsonProperty("first6Digits")]
    public string First6Digits { get; set; }

    [JsonProperty("isPreferred")]
    public bool IsPreferred { get; set; }

    [JsonProperty("last4Digits")]
    public string Last4Digits { get; set; }

    [JsonProperty("methodName")]
    public string MethodName { get; set; }

    [JsonProperty("methodType")]
    public string MethodType { get; set; }

    [JsonProperty("mitSchemeTransactionId")]
    public string MitSchemeTransactionId { get; set; }

    [JsonProperty("nameValidationAlgorithmVersion")]
    public string NameValidationAlgorithmVersion { get; set; }

    [JsonProperty("nameValidationSucceeded")]
    public bool NameValidationSucceeded { get; set; }

    [KpiTag]
    [JsonProperty("status")]
    [EnumDataType(typeof(CardStatus))]
    public CardStatus Status { get; set; }

    [JsonProperty("subStatus")]
    [EnumDataType(typeof(CardSubStatus))]
    public CardSubStatus SubStatus { get; set; } = CardSubStatus.None;

    [JsonProperty("timestampUtc")]
    public DateTime TimestampUtc { get; set; }

    [JsonProperty("userId")]
    public Guid UserId { get; set; }
}

2. Deprecated: PspFundingExternalCardRemovedMessage

This event has been replaced by ExternalCardUpdatedEvent which Status== CardStatus.Removed. The events have been sent out to DW are still in DW.

Published when we remove an external card.

PspFundingExternalCardRemovedMessage definition
[Message("psp-funding-external-card-removed-message", "PspFundingExternalCardRemovedMessage")]
public sealed class PspFundingExternalCardRemovedMessage
{
    [JsonProperty("cardId")]
    public Guid CardId { get; set; }

    [JsonProperty("cardStatus")]
    public CardStatus CardStatus { get; set; }

    [JsonProperty("fingerprint")]
    public string Fingerprint { get; set; }

    [JsonProperty("userId")]
    public Guid UserId { get; set; }
}

3. Deprecated: PspFundingCardAddFailedEvent

This event has been replaced by ExternalCardUpdatedEvent with Status in [CardStatus.InvalidCvv, CardStatus.InvalidCardData, CardStatus.InvalidExpirationDate, CardStatus.FailedUnableToAddCard]. But the events have been sent to Dataware house are still there.

Published when we fail to add an external card (e.g. invalid cvv/ expirtation date)

PspFundingCardAddFailedEvent definition
[Message("psp-funding-account", "PspFundingCardAddFailedEvent")]
public sealed class PspFundingCardAddFailedEvent
{
    [JsonProperty("cardId")]
    public Guid CardId { get; set; }

    [JsonProperty("externalCardGateway")]
    public ExternalCardGateway ExternalCardGateway { get; set; }

    [JsonProperty("fingerprint")]
    public string Fingerprint { get; set; }

    [JsonProperty("userId")]
    public Guid UserId { get; set; }
}

4. Deprecated: PspFundingUnverifiedExternalCardAddedMessage

This event has been replaced by ExternalCardUpdatedEvent with Status == CardStatus.Unverified. But events have been sent to Data warehouse are still there.

Published when we add a fiserv card (we still dont know if the card will succefully added or not)

PspFundingUnverifiedExternalCardAddedMessage definition
public sealed class PspFundingUnverifiedExternalCardAddedMessage
{
    [Required]
    [JsonProperty(PropertyName = "address1")]
    public string Address1 { get; set; }

    [JsonProperty(PropertyName = "address2")]
    public string Address2 { get; set; }

    [JsonProperty("cardBrand")]
    [EnumDataType(typeof(CardBrand))]
    public CardBrand CardBrand { get; set; }

    [FullName]
    [JsonProperty(PropertyName = "cardHolderName")]
    public string CardHolderName { get; set; }

    [JsonProperty("cardId")]
    public Guid CardId { get; set; }

    [Required]
    [JsonProperty(PropertyName = "city")]
    public string City { get; set; }

    [Required]
    [JsonProperty(PropertyName = "country")]
    public string Country { get; set; }

    [JsonProperty("description")]
    public string Description { get; set; }

    [JsonProperty("expirationDate")]
    public DateTime? ExpirationDate { get; set; }

    [JsonProperty("fingerprint")]
    public string Fingerprint { get; set; }

    [JsonProperty(PropertyName = "region")]
    public string Region { get; set; }

    [JsonProperty("userId")]
    public Guid UserId { get; set; }

    [Required]
    [JsonProperty(PropertyName = "zip")]
    public string Zip { get; set; }

}

5. Deprecated: PspFundingExternalCardVerifiedMessage

This event has been replaced by ExternalCardUpdatedEvent with Status == CardStatus.Active. But events have been sent to Data warehouse are kept in Data warehouse.

Publish when we succeed to add and external card

PspFundingExternalCardVerifiedMessage definition
public class PspFundingExternalCardVerifiedMessage
{
    [Required]
    [JsonProperty(PropertyName = "address1")]
    public string Address1 { get; set; }

    [JsonProperty(PropertyName = "address2")]
    public string Address2 { get; set; }

    [JsonProperty("cardBrand")]
    [EnumDataType(typeof(CardBrand))]
    public CardBrand CardBrand { get; set; }

    [FullName]
    [JsonProperty(PropertyName = "cardHolderName")]
    public string CardHolderName { get; set; }

    [JsonProperty("cardId")]
    public Guid CardId { get; set; }

    [Required]
    [JsonProperty(PropertyName = "city")]
    public string City { get; set; }

    [Required]
    [JsonProperty(PropertyName = "country")]
    public string Country { get; set; }

    [JsonProperty("description")]
    public string Description { get; set; }

    [JsonProperty("expirationDate")]
    public DateTime? ExpirationDate { get; set; }

    [JsonProperty("fingerprint")]
    public string Fingerprint { get; set; }

    [JsonProperty(PropertyName = "region")]
    public string Region { get; set; }

    [JsonProperty("userId")]
    public Guid UserId { get; set; }

    [Required]
    [JsonProperty(PropertyName = "zip")]
    public string Zip { get; set; }
}

Transaction Events

PspFundingTransactionUpdatedEvent

Communicates transaction changes such as status and payment status.

PspFundingTransactionUpdatedEvent definition
[Message("psp-transaction-updated", "PspTransactionUpdatedEvent")]
[Kpi("psp-transaction-updated", KpiStats.Increment)]
public sealed class PspFundingTransactionUpdatedEvent
{
    /// <summary>
    ///     Total transaction amount.
    /// </summary>
    [JsonProperty("amount")]
    public decimal Amount { get; set; }

    /// <summary>
    ///     Client IP address used when initiating the transaction.
    /// </summary>
    [JsonProperty("clientIp")]
    public string ClientIp { get; set; }

    /// <summary>
    ///     Transaction area UUID for credit transaction.
    /// </summary>
    [JsonProperty("creditFundTransactionId")]
    public Guid? CreditFundTransactionId { get; set; }

    /// <summary>
    ///     Transaction currency code iso-alpha-3.
    /// </summary>
    [JsonProperty("currencyId")]
    public string CurrencyId { get; set; }

    /// <summary>
    ///     Gateway identifier (ProcessOut, Majority).
    /// </summary>
    [KpiTag]
    [JsonProperty("externalCardGateway")]
    public ExternalCardGateway ExternalCardGateway { get; set; }

    /// <summary>
    ///     Transaction UUID.
    /// </summary>
    [JsonProperty("id")]
    public Guid Id { get; set; }

    /// <summary>
    ///     Ledger UUID.
    /// </summary>
    [JsonProperty("ledgerAccountId")]
    public Guid LedgerAccountId { get; set; }

    /// <summary>
    ///     Last modified date.
    /// </summary>
    [JsonProperty("modified")]
    public DateTime? Modified { get; set; }

    /// <summary>
    ///     Payment UUID.
    /// </summary>
    [JsonProperty("paymentId")]
    public Guid? PaymentId { get; set; }

    /// <summary>
    ///     Transaction status (InProgress, Successful, Denied, Failed, Cancelled, Refunded).
    /// </summary>
    [KpiTag]
    [JsonProperty("status")]
    public TransactionStatus Status { get; set; }

    /// <summary>
    ///     Transaction sub type (CardDeposit, AutoCardDeposit, SubscriptionRenewal).
    /// </summary>
    [JsonProperty("subType")]
    public TransactionSubType SubType { get; set; }

    /// <summary>
    ///     Transasaction type (CardDeposit).
    /// </summary>
    [JsonProperty("type")]
    public CreditTransactionType Type { get; set; }

    /// <summary>
    ///     User UUID.
    /// </summary>
    [JsonProperty("userId")]
    public Guid UserId { get; set; }
}

PspFundingTransactionRefundedEvent event

PspFundingTransactionRefundedEvent definition
[Message("psp-transaction-refunded", "PspFundingTransactionRefundedEvent")]
    [Kpi("psp-transaction-refunded", KpiStats.Increment)]
    public sealed class PspFundingTransactionRefundedEvent
    {
        [JsonProperty("created")]
        public DateTime Created { get; set; }

        [JsonProperty("debitFundsTransactionId")]
        public Guid? DebitFundsTransactionId { get; set; }

        [JsonProperty("disposableBalance")]
        public decimal DisposableBalance { get; set; }

        [JsonProperty("orderId")]
        public Guid OrderId { get; set; }

        [JsonProperty("overdraft")]
        public decimal Overdraft { get; set; }

        [JsonProperty("refundAmount")]
        public decimal RefundAmount { get; set; }

        [KpiTag]
        [JsonProperty("status")]
        public RefundStatus Status { get; set; }

        [JsonProperty("subType")]
        public TransactionSubType SubType { get; set; }

        [JsonProperty("type")]
        public DebitTransactionType Type { get; set; }

        [JsonProperty("userId")]
        public Guid UserId { get; set; }
    }

PspFundingTransactionChargebackCompletedEvent

Published whenever a chargeback has been completed.

PspFundingTransactionChargebackCompletedEvent definition
 public sealed class PspFundingTransactionChargebackCompletedEvent
    {
        [JsonProperty("created")]
        public DateTime Created { get; set; }

        [JsonProperty("debitFundsTransactionId")]
        public Guid? DebitFundsTransactionId { get; set; }

        [JsonProperty("disposableBalance")]
        public decimal DisposableBalance { get; set; }

        [JsonProperty("disputeReason")]
        public string DisputeReason { get; set; }

        [JsonProperty("disputeReasonCode")]
        public string DisputeReasonCode { get; set; }

        [JsonProperty("invoiceNumber")]
        public Guid InvoiceNumber { get; set; }

        [JsonProperty("orderId")]
        public Guid OrderId { get; set; }

        [JsonProperty("overdraft")]
        public decimal Overdraft { get; set; }

        [JsonProperty("refundAmount")]
        public decimal RefundAmount { get; set; }

        [JsonProperty("status")]
        [JsonConverter(typeof(StringEnumConverter))]
        public RefundStatus Status { get; set; }

        [JsonProperty("subType")]
        public PspTransactionSubType SubType { get; set; }

        [JsonProperty("type")]
        public PspTransactionType Type { get; set; }

        [JsonProperty("userId")]
        public Guid UserId { get; set; }
    }

Payment event

PaymentCompletedEvent

Published when a payment has been completed on the payment service side ( money charged from the credit card but not yet credited to majority account)

PaymentCompletedEvent definition
 public class PaymentCompletedEvent
    {
        [Required]
        [JsonProperty(PropertyName = "paymentId")]
        public Guid PaymentId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "amount")]
        public decimal Amount { get; set; }

        [Required]
        [JsonProperty(PropertyName = "currencyId")]
        public string CurrencyId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "paymentStatusId")]
        public PaymentStatus PaymentStatusId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "isSuccessful")]
        public bool IsSuccessful { get; set; }

        [JsonProperty(PropertyName = "paymentAttempts")]
        public int PaymentAttempts { get; set; }

        [JsonProperty(PropertyName = "providerId")]
        public Provider ProviderId { get; set; }

        [JsonProperty(PropertyName = "providerTransactionId")]
        public string ProviderTransactionId { get; set; }

        [JsonProperty(PropertyName = "isRetry")]
        public bool IsRetry { get; set; }
    }

PaymentCreditMessage

Published when we inititate the payement

PaymentCreditMessage definition
public class PaymentCreditMessage
    {
        [Required]
        [JsonProperty(PropertyName = "paymentId")]
        public Guid PaymentId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "userId")]
        public Guid UserId { get; set; }

        [JsonProperty(PropertyName = "cardBrand")]
        public CardBrand CardBrand { get; set; }
    }

PaymentRefundInitiated

Published when we initiate the refund

PaymentRefundInitiated definition
public class PaymentRefundInitiated
    {
        [Required]
        [JsonProperty(PropertyName = "paymentId")]
        public Guid PaymentId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "refundId")]
        public Guid RefundId { get; set; }

    }

PaymentRefundedEvent

Published when the refund has been completed on the payment service ( money has been returned to the credit card but not yet debited from majority account)

PaymentRefundedEvent definition
 public class PaymentRefundedEvent
    {
        [Required]
        [JsonProperty(PropertyName = "paymentId")]
        public Guid PaymentId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "amount")]
        public decimal Amount { get; set; }

        [Required]
        [JsonProperty(PropertyName = "currencyId")]
        public string CurrencyId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "paymentStatusId")]
        public PaymentStatus PaymentStatusId { get; set; }

        [Required]
        [JsonProperty(PropertyName = "isSuccessful")]
        public bool IsSuccessful { get; set; }

        [JsonProperty(PropertyName = "refundId")]
        public Guid RefundId { get; set; }
    }

Provider specific area

ProviderCardVerifiedEvent

Published when we verify the card on provider (even if the verification has failed

ProviderCardVerifiedEvent definition
 public class ProviderCardVerifiedEvent
    {
        [JsonProperty("providerId")]
        [EnumDataType(typeof(Provider))]
        public Provider ProviderId {get;set;}

        [JsonProperty(PropertyName = "rawProviderResponse")]
        public string RawProviderResponse { get; set; }

        [JsonProperty(PropertyName = "cardId")]
        public Guid CardId { get; set; }

        [JsonProperty(PropertyName = "brand")]
        public string Brand { get; set; }

        [JsonProperty(PropertyName = "avsStreetMatch")]
        public string AvsStreetMatch { get; set; }

        [JsonProperty(PropertyName = "avsPostalCodeMatch")]
        public string AvsPostalCodeMatch { get; set; }

        [JsonProperty(PropertyName = "avsAssociationResponse")]
        public string AvsAssociationResponse { get; set; }

        [JsonProperty(PropertyName = "created")]
        public DateTime Created { get; set; }
    }

ProviderCreditEvent

Published when the attempt for the transaction (charge credit card) has been completed on Fiserv

ProviderCreditEvent definition
 public class ProviderCreditEvent
 {        
        [JsonProperty("providerId")]
        [EnumDataType(typeof(Provider))]
        public Provider ProviderId {get;set;}

        [JsonProperty(PropertyName = "rawProviderResponse")]
        public string RawProviderResponse { get; set; }

        [JsonProperty(PropertyName = "paymentId")]
        public Guid PaymentId { get; set; }

        [JsonProperty(PropertyName = "paymentStatusId")]
        public PaymentStatus PaymentStatusId { get; set; }

        [JsonProperty(PropertyName = "ipgTransactionId")]
        public string IpgTransactionId { get; set; }

        [JsonProperty(PropertyName = "orderId")]
        public string OrderId { get; set; }

        [JsonProperty(PropertyName = "amount")]
        public decimal? Amount { get; set; }

        [JsonProperty(PropertyName = "currency")]
        public string Currency { get; set; }

        [JsonProperty(PropertyName = "transactionType")]
        public string TransactionType { get; set; }

        [JsonProperty(PropertyName = "transactionOrigin")]
        public string TransactionOrigin { get; set; }

        [JsonProperty(PropertyName = "country")]
        public string Country { get; set; }

        [JsonProperty(PropertyName = "terminalId")]
        public string TerminalId { get; set; }

        [JsonProperty(PropertyName = "merchantId")]
        public string MerchantId { get; set; }

        [JsonProperty(PropertyName = "transactionStatus")]
        public string TransactionStatus { get; set; }

        [JsonProperty(PropertyName = "schemeTransactionId")]
        public string SchemeTransactionId { get; set; }

        [JsonProperty(PropertyName = "clientRequestId")]
        public string ClientRequestId { get; set; }

        [JsonProperty(PropertyName = "apiTraceId")]
        public string ApiTraceId { get; set; }

        [JsonProperty(PropertyName = "processorReferenceNumber")]
        public string ProcessorReferenceNumber { get; set; }

        [JsonProperty(PropertyName = "processorAuthorizationCode")]
        public string ProcessorAuthorizationCode { get; set; }

        [JsonProperty(PropertyName = "processorResponseCode")]
        public string ProcessorResponseCode { get; set; }

        [JsonProperty(PropertyName = "processorResponseMessage")]
        public string ProcessorResponseMessage { get; set; }

        [JsonProperty(PropertyName = "processorNetwork")]
        public string ProcessorNetwork { get; set; }

        [JsonProperty(PropertyName = "processorAssociationResponseCode")]
        public string ProcessorAssociationResponseCode { get; set; }

        [JsonProperty(PropertyName = "processorSecurityCodeResponse")]
        public string ProcessorSecurityCodeResponse { get; set; }

        [JsonProperty(PropertyName = "processorAvsStreetMatch")]
        public string ProcessorAvsStreetMatch { get; set; }

        [JsonProperty(PropertyName = "processorAvsPostalCodeMatch")]
        public string ProcessorAvsPostalCodeMatch { get; set; }

        [JsonProperty(PropertyName = "processorAvsAssociationResponse")]
        public string ProcessorAvsAssociationResponse { get; set; }

        [JsonProperty(PropertyName = "errorCode")]
        public string ErrorCode { get; set; }

        [JsonProperty(PropertyName = "errorMessage")]
        public string ErrorMessage { get; set; }

        [JsonProperty(PropertyName = "created")]
        public DateTime Created { get; set; }
    }

ProviderRefundEvent

Published when the refund has been done on Fiserv even if the attempt failed

ProviderRefundEvent
 public class ProviderRefundEvent
    {

        [JsonProperty("providerId")]
        [EnumDataType(typeof(Provider))]
        public Provider ProviderId {get;set;}

        [JsonProperty(PropertyName = "rawProviderResponse")]
        public string RawProviderResponse { get; set; }

        [JsonProperty(PropertyName = "paymentId")]
        public Guid PaymentId { get; set; }

        [JsonProperty(PropertyName = "paymentStatusId")]
        public PaymentStatus PaymentStatusId { get; set; }

        [JsonProperty(PropertyName = "ipgTransactionId")]
        public string IpgTransactionId { get; set; }

        [JsonProperty(PropertyName = "orderId")]
        public string OrderId { get; set; }

        [JsonProperty(PropertyName = "amount")]
        public decimal? Amount { get; set; }

        [JsonProperty(PropertyName = "currency")]
        public string Currency { get; set; }

        [JsonProperty(PropertyName = "transactionType")]
        public string TransactionType { get; set; }

        [JsonProperty(PropertyName = "transactionOrigin")]
        public string TransactionOrigin { get; set; }

        [JsonProperty(PropertyName = "country")]
        public string Country { get; set; }

        [JsonProperty(PropertyName = "terminalId")]
        public string TerminalId { get; set; }

        [JsonProperty(PropertyName = "merchantId")]
        public string MerchantId { get; set; }

        [JsonProperty(PropertyName = "transactionStatus")]
        public string TransactionStatus { get; set; }

        [JsonProperty(PropertyName = "schemeTransactionId")]
        public string SchemeTransactionId { get; set; }

        [JsonProperty(PropertyName = "clientRequestId")]
        public string ClientRequestId { get; set; }

        [JsonProperty(PropertyName = "apiTraceId")]
        public string ApiTraceId { get; set; }

        [JsonProperty(PropertyName = "processorReferenceNumber")]
        public string ProcessorReferenceNumber { get; set; }

        [JsonProperty(PropertyName = "processorAuthorizationCode")]
        public string ProcessorAuthorizationCode { get; set; }

        [JsonProperty(PropertyName = "processorResponseCode")]
        public string ProcessorResponseCode { get; set; }

        [JsonProperty(PropertyName = "processorResponseMessage")]
        public string ProcessorResponseMessage { get; set; }

        [JsonProperty(PropertyName = "processorNetwork")]
        public string ProcessorNetwork { get; set; }

        [JsonProperty(PropertyName = "processorAssociationResponseCode")]
        public string ProcessorAssociationResponseCode { get; set; }

        [JsonProperty(PropertyName = "processorSecurityCodeResponse")]
        public string ProcessorSecurityCodeResponse { get; set; }

        [JsonProperty(PropertyName = "processorAvsStreetMatch")]
        public string ProcessorAvsStreetMatch { get; set; }

        [JsonProperty(PropertyName = "processorAvsPostalCodeMatch")]
        public string ProcessorAvsPostalCodeMatch { get; set; }

        [JsonProperty(PropertyName = "processorAvsAssociationResponse")]
        public string ProcessorAvsAssociationResponse { get; set; }

        [JsonProperty(PropertyName = "errorCode")]
        public string ErrorCode { get; set; }

        [JsonProperty(PropertyName = "errorMessage")]
        public string ErrorMessage { get; set; }

        [JsonProperty(PropertyName = "created")]
        public DateTime Created { get; set; }
    }