Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#704)
Browse files Browse the repository at this point in the history
Co-authored-by: rebilly-machine-user <[email protected]>
  • Loading branch information
rebilly-machine-user and rebilly-machine-user authored Jun 25, 2024
1 parent 6ce55d9 commit 95e8a29
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-crabs-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

SDK Generator updated
2 changes: 1 addition & 1 deletion src/Model/CustomerDefaultPaymentInstrumentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CustomerDefaultPaymentInstrumentFactory
public static function from(array $data = []): CustomerDefaultPaymentInstrument
{
if (isset($data['paymentInstrumentId'])) {
return new VaultedInstrument($data);
return VaultedInstrument::from($data);
}

return match ($data['method']) {
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GatewayAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ abstract class GatewayAccount implements JsonSerializable

public const ACQUIRER_NAME_IPAY_OPTIONS = 'Ipay Options';

public const ACQUIRER_NAME_B_S = 'B+S';
public const ACQUIRER_NAME_B_PLUS_S = 'B+S';

public const ACQUIRER_NAME_BAMBORA = 'Bambora';

Expand Down
6 changes: 3 additions & 3 deletions src/Model/PaymentInstructionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class PaymentInstructionFactory
public static function from(array $data = []): PaymentInstruction
{
if (isset($data['paymentInstrumentId'])) {
return new PaymentInstructionInstrument($data);
return PaymentInstructionInstrument::from($data);
}
if (isset($data['methods'])) {
return new PaymentInstructionMethods($data);
return PaymentInstructionMethods::from($data);
}
if (isset($data['token'])) {
return new PaymentInstructionToken($data);
return PaymentInstructionToken::from($data);
}

return match ($data['method']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa

public const ACQUIRER_NAME_IPAY_OPTIONS = 'Ipay Options';

public const ACQUIRER_NAME_B_S = 'B+S';
public const ACQUIRER_NAME_B_PLUS_S = 'B+S';

public const ACQUIRER_NAME_BAMBORA = 'Bambora';

Expand Down
4 changes: 2 additions & 2 deletions src/Model/PostFileRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class PostFileRequestFactory
public static function from(array $data = []): PostFileRequest
{
if (isset($data['file'])) {
return new FileCreateFromInline($data);
return FileCreateFromInline::from($data);
}
if (isset($data['url'])) {
return new FileCreateFromUrl($data);
return FileCreateFromUrl::from($data);
}

throw new UnknownDiscriminatorValueException();
Expand Down
2 changes: 1 addition & 1 deletion src/Model/PostPaymentInstrumentRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PostPaymentInstrumentRequestFactory
public static function from(array $data = []): PostPaymentInstrumentRequest
{
if (isset($data['token'])) {
return new PaymentInstrumentCreateToken($data);
return PaymentInstrumentCreateToken::from($data);
}

return match ($data['method']) {
Expand Down
4 changes: 2 additions & 2 deletions src/Model/PostReadyToPayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class PostReadyToPayFactory
public static function from(array $data = []): PostReadyToPay
{
if (isset($data['amount']) || isset($data['currency'])) {
return new ReadyToPayAmount($data);
return ReadyToPayAmount::from($data);
}
if (isset($data['items'])) {
return new ReadyToPayItems($data);
return ReadyToPayItems::from($data);
}

throw new UnknownDiscriminatorValueException();
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ class Transaction implements JsonSerializable

public const ACQUIRER_NAME_IPAY_OPTIONS = 'Ipay Options';

public const ACQUIRER_NAME_B_S = 'B+S';
public const ACQUIRER_NAME_B_PLUS_S = 'B+S';

public const ACQUIRER_NAME_BAMBORA = 'Bambora';

Expand Down
2 changes: 1 addition & 1 deletion src/Model/TransactionPaymentInstrumentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TransactionPaymentInstrumentFactory
public static function from(array $data = []): TransactionPaymentInstrument
{
if (isset($data['paymentInstrumentId'])) {
return new VaultedInstrument($data);
return VaultedInstrument::from($data);
}

return match ($data['method']) {
Expand Down

0 comments on commit 95e8a29

Please sign in to comment.