Skip to content

Commit

Permalink
Make CardUniqueReference nullable on webhook events
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Nikolaou committed Apr 28, 2023
1 parent a6a0a95 commit f9c8b34
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ All notable changes to `sebdesign/laravel-viva-payments` will be documented in t
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.0.1] - 2023-04-28

### Fixed

- Make `CardUniqueReference` nullable on webhook events

## [6.0.0] - 2023-04-01

### Added
### Fixed

- Fix webhook events

Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ parameters:

typeAliases:
RecurringTransactionArray: 'array{Emv:?string, Amount:float, StatusId:string, RedirectUrl:?string, CurrencyCode:string, TransactionId:string, TransactionTypeId:int, ReferenceNumber:int, IssuerMessage:?string, AuthorizationId:string, IssuerMessageControl:mixed, Ctap:mixed, RetrievalReferenceNumber:string, Loyalty:?string, CartesBancaires:?string, ThreeDSecureStatusId:int, ErrorCode:int, ErrorText:?string, TimeStamp:string, CorrelationId:?string, EventId:int, Success:bool}'
TransactionFailedArray: 'array{Moto:bool, Email:string, Phone:?string, BankId:string, Systemic:bool, Switching:bool, ParentId:?string, Amount:float, ChannelId:string, TerminalId:int, MerchantId:string, OrderCode:string, ProductId:?string, StatusId:string, FullName:string, ResellerId:?string, InsDate:string, TotalFee:float, CardUniqueReference:string, CardToken:string, CardNumber:string, TipAmount:float, SourceCode:string, SourceName:string, Latitude:?float, Longitude:?float, CompanyName:?String, TransactionId:string, CompanyTitle:?string, PanEntryMode:string, ReferenceNumber:int, ResponseCode:?string, CurrencyCode:string, OrderCulture:string, MerchantTrns:?string, CustomerTrns:string, IsManualRefund:bool, TargetPersonId:?string, TargetWalletId:?string, LoyaltyTriggered:bool, TransactionTypeId:int, TotalInstallments:int, CardCountryCode:?string, CardIssuingBank:?string, RedeemedAmount:int, ClearanceDate:?int, CurrentInstallment:?int, Tags:string[], BillId:?string, ResellerSourceCode:?string, ResellerSourceName:?string, ResellerCompanyName:?string, ResellerSourceAddress:?string, CardExpirationDate:string, RetrievalReferenceNumber:?string, AssignedMerchantUsers:string[], AssignedResellerUsers:string[], CardTypeId:int, DigitalWalletId:?int, ResponseEventId:?string, ElectronicCommerceIndicator:?string}'
TransactionPaymentCreatedArray: 'array{Moto:bool, Email:string, Phone:?string, BankId:string, Systemic:bool, Switching:bool, ParentId:?string, Amount:float, ChannelId:string, TerminalId:int, MerchantId:string, OrderCode:string, ProductId:?string, StatusId:string, FullName:string, ResellerId:?string, InsDate:string, TotalFee:float, CardUniqueReference:string, CardToken:string, CardNumber:string, TipAmount:float, SourceCode:string, SourceName:string, Latitude:?float, Longitude:?float, CompanyName:?String, TransactionId:string, CompanyTitle:?string, PanEntryMode:string, ReferenceNumber:int, ResponseCode:?string, CurrencyCode:string, OrderCulture:string, MerchantTrns:?string, CustomerTrns:string, IsManualRefund:bool, TargetPersonId:?string, TargetWalletId:?string, LoyaltyTriggered:bool, TransactionTypeId:int, TotalInstallments:int, CardCountryCode:?string, CardIssuingBank:?string, RedeemedAmount:int, ClearanceDate:?int, CurrentInstallment:?int, Tags:string[], BillId:?string, ResellerSourceCode:?string, ResellerSourceName:?string, ResellerCompanyName:?string, ResellerSourceAddress:?string, CardExpirationDate:string, RetrievalReferenceNumber:?string, AssignedMerchantUsers:string[], AssignedResellerUsers:string[], CardTypeId:int, DigitalWalletId:?int, ResponseEventId:?string, ElectronicCommerceIndicator:?string, BinId:?string, Ucaf:?string, DualMessage:?string, AcquirerApproved:?string, AuthorizationId:?string, OrderServiceId:?string, ConnectedAccountId:?string}'
TransactionFailedArray: 'array{Moto:bool, Email:string, Phone:?string, BankId:string, Systemic:bool, Switching:bool, ParentId:?string, Amount:float, ChannelId:string, TerminalId:int, MerchantId:string, OrderCode:string, ProductId:?string, StatusId:string, FullName:string, ResellerId:?string, InsDate:string, TotalFee:float, CardUniqueReference:?string, CardToken:string, CardNumber:string, TipAmount:float, SourceCode:string, SourceName:string, Latitude:?float, Longitude:?float, CompanyName:?String, TransactionId:string, CompanyTitle:?string, PanEntryMode:string, ReferenceNumber:int, ResponseCode:?string, CurrencyCode:string, OrderCulture:string, MerchantTrns:?string, CustomerTrns:string, IsManualRefund:bool, TargetPersonId:?string, TargetWalletId:?string, LoyaltyTriggered:bool, TransactionTypeId:int, TotalInstallments:int, CardCountryCode:?string, CardIssuingBank:?string, RedeemedAmount:int, ClearanceDate:?int, CurrentInstallment:?int, Tags:string[], BillId:?string, ResellerSourceCode:?string, ResellerSourceName:?string, ResellerCompanyName:?string, ResellerSourceAddress:?string, CardExpirationDate:string, RetrievalReferenceNumber:?string, AssignedMerchantUsers:string[], AssignedResellerUsers:string[], CardTypeId:int, DigitalWalletId:?int, ResponseEventId:?string, ElectronicCommerceIndicator:?string}'
TransactionPaymentCreatedArray: 'array{Moto:bool, Email:string, Phone:?string, BankId:string, Systemic:bool, Switching:bool, ParentId:?string, Amount:float, ChannelId:string, TerminalId:int, MerchantId:string, OrderCode:string, ProductId:?string, StatusId:string, FullName:string, ResellerId:?string, InsDate:string, TotalFee:float, CardUniqueReference:?string, CardToken:string, CardNumber:string, TipAmount:float, SourceCode:string, SourceName:string, Latitude:?float, Longitude:?float, CompanyName:?String, TransactionId:string, CompanyTitle:?string, PanEntryMode:string, ReferenceNumber:int, ResponseCode:?string, CurrencyCode:string, OrderCulture:string, MerchantTrns:?string, CustomerTrns:string, IsManualRefund:bool, TargetPersonId:?string, TargetWalletId:?string, LoyaltyTriggered:bool, TransactionTypeId:int, TotalInstallments:int, CardCountryCode:?string, CardIssuingBank:?string, RedeemedAmount:int, ClearanceDate:?int, CurrentInstallment:?int, Tags:string[], BillId:?string, ResellerSourceCode:?string, ResellerSourceName:?string, ResellerCompanyName:?string, ResellerSourceAddress:?string, CardExpirationDate:string, RetrievalReferenceNumber:?string, AssignedMerchantUsers:string[], AssignedResellerUsers:string[], CardTypeId:int, DigitalWalletId:?int, ResponseEventId:?string, ElectronicCommerceIndicator:?string, BinId:?string, Ucaf:?string, DualMessage:?string, AcquirerApproved:?string, AuthorizationId:?string, OrderServiceId:?string, ConnectedAccountId:?string}'
TransactionArray: 'array{email:string, amount:int, orderCode:string, statusId:string, fullName:string, insDate:string, cardNumber:string, currencyCode:string, customerTrns:string, merchantTrns:?string, transactionTypeId:int, recurringSupport:bool, totalInstallments:int, cardCountryCode:?string, cardIssuingBank:?string, currentInstallment:int, cardUniqueReference:?string, cardTypeId:int, digitalWalletId:?int}'
WebhookEventDataArray: 'TransactionPaymentCreatedArray|TransactionFailedArray|array<string,mixed>'
WebhookEventArray: 'array{Url:string, EventData:WebhookEventDataArray, Created:string, CorrelationId:string, EventTypeId:int, Delay:?string, MessageId:string, RecipientId:string, MessageTypeId:int}'
Expand Down
4 changes: 2 additions & 2 deletions src/Events/TransactionFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
public readonly ?string $ResellerId,
public readonly string $InsDate,
public readonly float $TotalFee,
public readonly string $CardUniqueReference,
public readonly ?string $CardUniqueReference,
public readonly string $CardToken,
public readonly string $CardNumber,
public readonly float $TipAmount,
Expand Down Expand Up @@ -98,7 +98,7 @@ public static function create(array $attributes): self
ResellerId: $attributes['ResellerId'] ?? null,
InsDate: $attributes['InsDate'],
TotalFee: $attributes['TotalFee'],
CardUniqueReference: $attributes['CardUniqueReference'],
CardUniqueReference: $attributes['CardUniqueReference'] ?? null,
CardToken: $attributes['CardToken'],
CardNumber: $attributes['CardNumber'],
TipAmount: $attributes['TipAmount'],
Expand Down
2 changes: 1 addition & 1 deletion src/Events/TransactionPaymentCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
public readonly ?string $ResellerId,
public readonly string $InsDate,
public readonly float $TotalFee,
public readonly string $CardUniqueReference,
public readonly ?string $CardUniqueReference,
public readonly string $CardToken,
public readonly string $CardNumber,
public readonly float $TipAmount,
Expand Down

0 comments on commit f9c8b34

Please sign in to comment.