Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BlindPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BlindPay implements ApiClientInterface
{
private const BASE_URL = 'https://api.blindpay.com/v1/';

private const VERSION = '3.3.0';
private const VERSION = '3.4.0';

private Client $httpClient;

Expand Down
6 changes: 4 additions & 2 deletions src/Resources/BankAccounts/BankAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function __construct(
public ?Country $swiftIntermediaryBankCountry,
public ?string $tronWalletHash,
public ?array $offrampWallets,
public DateTimeImmutable $createdAt,
public ?DateTimeImmutable $createdAt,
public ?string $tedBankCode = null,
public ?string $tedBranchCode = null,
public ?string $tedCpfCnpj = null,
Expand Down Expand Up @@ -152,7 +152,9 @@ public static function fromArray(array $data): self
swiftIntermediaryBankCountry: isset($data['swift_intermediary_bank_country']) ? Country::from($data['swift_intermediary_bank_country']) : null,
tronWalletHash: $data['tron_wallet_hash'] ?? null,
offrampWallets: $data['offramp_wallets'] ?? null,
createdAt: new DateTimeImmutable($data['created_at']),
createdAt: isset($data['created_at'])
? new DateTimeImmutable($data['created_at'])
: null,
tedBankCode: $data['ted_bank_code'] ?? null,
tedBranchCode: $data['ted_branch_code'] ?? null,
tedCpfCnpj: $data['ted_cpf_cnpj'] ?? null,
Expand Down
10 changes: 6 additions & 4 deletions src/Resources/CustodialWallets/CustodialWallets.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public function __construct(
public string $customerId,
public string $instanceId,
public Network $network,
public string $address,
public DateTimeImmutable $createdAt
public ?string $address,
public ?DateTimeImmutable $createdAt
) {}

public static function fromArray(array $data): self
Expand All @@ -27,8 +27,10 @@ public static function fromArray(array $data): self
customerId: $data['customer_id'],
instanceId: $data['instance_id'],
network: Network::from($data['network']),
address: $data['address'],
createdAt: new DateTimeImmutable($data['created_at'])
address: $data['address'] ?? null,
createdAt: isset($data['created_at'])
? new DateTimeImmutable($data['created_at'])
: null
);
}
}
Expand Down
38 changes: 21 additions & 17 deletions src/Resources/Customers/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1185,13 +1185,13 @@ public function __construct(
public string $id,
public string $customerId,
public LimitIncreaseRequestStatus $status,
public float $daily,
public float $monthly,
public float $perTransaction,
public string $supportingDocumentFile,
public LimitIncreaseRequestSupportingDocumentType $supportingDocumentType,
public DateTimeImmutable $createdAt,
public DateTimeImmutable $updatedAt,
public ?float $daily,
public ?float $monthly,
public ?float $perTransaction,
public ?string $supportingDocumentFile,
public ?LimitIncreaseRequestSupportingDocumentType $supportingDocumentType,
public ?DateTimeImmutable $createdAt,
public ?DateTimeImmutable $updatedAt,
public ?int $approvedPerTransaction = null,
public ?int $approvedDaily = null,
public ?int $approvedMonthly = null
Expand All @@ -1203,13 +1203,17 @@ public static function fromArray(array $data): self
id: $data['id'],
customerId: $data['customer_id'],
status: LimitIncreaseRequestStatus::from($data['status']),
daily: (float) $data['daily'],
monthly: (float) $data['monthly'],
perTransaction: (float) $data['per_transaction'],
supportingDocumentFile: $data['supporting_document_file'],
supportingDocumentType: LimitIncreaseRequestSupportingDocumentType::from($data['supporting_document_type']),
createdAt: new DateTimeImmutable($data['created_at']),
updatedAt: new DateTimeImmutable($data['updated_at']),
daily: isset($data['daily']) ? (float) $data['daily'] : null,
monthly: isset($data['monthly']) ? (float) $data['monthly'] : null,
perTransaction: isset($data['per_transaction']) ? (float) $data['per_transaction'] : null,
supportingDocumentFile: $data['supporting_document_file'] ?? null,
supportingDocumentType: isset($data['supporting_document_type']) ? LimitIncreaseRequestSupportingDocumentType::from($data['supporting_document_type']) : null,
createdAt: isset($data['created_at'])
? new DateTimeImmutable($data['created_at'])
: null,
updatedAt: isset($data['updated_at'])
? new DateTimeImmutable($data['updated_at'])
: null,
approvedPerTransaction: isset($data['approved_per_transaction']) ? (int) $data['approved_per_transaction'] : null,
approvedDaily: isset($data['approved_daily']) ? (int) $data['approved_daily'] : null,
approvedMonthly: isset($data['approved_monthly']) ? (int) $data['approved_monthly'] : null
Expand All @@ -1221,9 +1225,9 @@ public static function fromArray(array $data): self
{
public function __construct(
public string $customerId,
public float $daily,
public float $monthly,
public float $perTransaction,
public ?float $daily,
public ?float $monthly,
public ?float $perTransaction,
public string $supportingDocumentFile,
public LimitIncreaseRequestSupportingDocumentType $supportingDocumentType
) {}
Expand Down
70 changes: 37 additions & 33 deletions src/Resources/Payins/Payins.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ public function __construct(
public string $routingNumber,
public string $accountNumber,
public string $accountType,
public string $swiftBicCode,
public BankAch $ach,
public BankWire $wire,
public BankRtp $rtp,
public ?string $swiftBicCode,
public ?BankAch $ach,
public ?BankWire $wire,
public ?BankRtp $rtp,
public BankBeneficiary $beneficiary,
public BankReceivingBank $receivingBank,
public ?string $swiftAccountNumber = null,
Expand All @@ -165,10 +165,10 @@ public static function fromArray(array $data): self
routingNumber: $data['routing_number'],
accountNumber: $data['account_number'],
accountType: $data['account_type'],
swiftBicCode: $data['swift_bic_code'],
ach: BankAch::fromArray($data['ach']),
wire: BankWire::fromArray($data['wire']),
rtp: BankRtp::fromArray($data['rtp']),
swiftBicCode: $data['swift_bic_code'] ?? null,
ach: isset($data['ach']) ? BankAch::fromArray($data['ach']) : null,
wire: isset($data['wire']) ? BankWire::fromArray($data['wire']) : null,
rtp: isset($data['rtp']) ? BankRtp::fromArray($data['rtp']) : null,
beneficiary: BankBeneficiary::fromArray($data['beneficiary']),
receivingBank: BankReceivingBank::fromArray($data['receiving_bank']),
swiftAccountNumber: $data['swift_account_number'] ?? null,
Expand All @@ -183,9 +183,9 @@ public function toArray(): array
'account_number' => $this->accountNumber,
'account_type' => $this->accountType,
'swift_bic_code' => $this->swiftBicCode,
'ach' => $this->ach->toArray(),
'wire' => $this->wire->toArray(),
'rtp' => $this->rtp->toArray(),
'ach' => $this->ach?->toArray(),
'wire' => $this->wire?->toArray(),
'rtp' => $this->rtp?->toArray(),
'beneficiary' => $this->beneficiary->toArray(),
'receiving_bank' => $this->receivingBank->toArray(),
'swift_account_number' => $this->swiftAccountNumber,
Expand All @@ -202,21 +202,21 @@ public function __construct(
public TransactionStatus $status,
public string $payinQuoteId,
public string $instanceId,
public DateTimeImmutable $createdAt,
public DateTimeImmutable $updatedAt,
public ?DateTimeImmutable $createdAt,
public ?DateTimeImmutable $updatedAt,
public string $type,
public string $paymentMethod,
public float $senderAmount,
public float $receiverAmount,
public ?float $senderAmount,
public ?float $receiverAmount,
public StablecoinToken $token,
public float $partnerFeeAmount,
public float $totalFeeAmount,
public float $commercialQuotation,
public float $blindpayQuotation,
public ?float $partnerFeeAmount,
public ?float $totalFeeAmount,
public ?float $commercialQuotation,
public ?float $blindpayQuotation,
public string $currency,
public float $billingFee,
public string $name,
public string $address,
public ?string $address,
public Network $network,
public BankDetails $BankDetails,
public ?string $pixCode = null,
Expand Down Expand Up @@ -248,21 +248,25 @@ public static function fromArray(array $data): self
status: TransactionStatus::from($data['status']),
payinQuoteId: $data['payin_quote_id'],
instanceId: $data['instance_id'],
createdAt: new DateTimeImmutable($data['created_at']),
updatedAt: new DateTimeImmutable($data['updated_at']),
createdAt: isset($data['created_at'])
? new DateTimeImmutable($data['created_at'])
: null,
updatedAt: isset($data['updated_at'])
? new DateTimeImmutable($data['updated_at'])
: null,
type: $data['type'],
paymentMethod: $data['payment_method'],
senderAmount: (float) $data['sender_amount'],
receiverAmount: (float) $data['receiver_amount'],
senderAmount: isset($data['sender_amount']) ? (float) $data['sender_amount'] : null,
receiverAmount: isset($data['receiver_amount']) ? (float) $data['receiver_amount'] : null,
token: StablecoinToken::from($data['token']),
partnerFeeAmount: (float) $data['partner_fee_amount'],
totalFeeAmount: (float) $data['total_fee_amount'],
commercialQuotation: (float) $data['commercial_quotation'],
blindpayQuotation: (float) $data['blindpay_quotation'],
partnerFeeAmount: isset($data['partner_fee_amount']) ? (float) $data['partner_fee_amount'] : null,
totalFeeAmount: isset($data['total_fee_amount']) ? (float) $data['total_fee_amount'] : null,
commercialQuotation: isset($data['commercial_quotation']) ? (float) $data['commercial_quotation'] : null,
blindpayQuotation: isset($data['blindpay_quotation']) ? (float) $data['blindpay_quotation'] : null,
currency: $data['currency'],
billingFee: (float) $data['billing_fee'],
name: $data['name'],
address: $data['address'],
address: $data['address'] ?? null,
network: Network::from($data['network']),
BankDetails: BankDetails::fromArray($data['blindpay_bank_details']),
pixCode: $data['pix_code'] ?? null,
Expand Down Expand Up @@ -372,8 +376,8 @@ public function toQueryString(): string
public function __construct(
public string $id,
public TransactionStatus $status,
public string $customerId,
public float $receiverAmount,
public ?string $customerId,
public ?float $receiverAmount,
public BankDetails $BankDetails,
public ?string $pixCode = null,
public ?string $memoCode = null,
Expand All @@ -389,8 +393,8 @@ public static function fromArray(array $data): self
return new self(
id: $data['id'],
status: TransactionStatus::from($data['status']),
customerId: $data['customer_id'],
receiverAmount: (float) $data['receiver_amount'],
customerId: $data['customer_id'] ?? null,
receiverAmount: isset($data['receiver_amount']) ? (float) $data['receiver_amount'] : null,
BankDetails: BankDetails::fromArray($data['blindpay_bank_details']),
pixCode: $data['pix_code'] ?? null,
memoCode: $data['memo_code'] ?? null,
Expand Down
28 changes: 14 additions & 14 deletions src/Resources/Payins/Quotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum PaymentMethod: string
readonly class PayerRules
{
public function __construct(
public array $pixAllowedTaxIds,
public ?array $pixAllowedTaxIds,
public ?string $transfersAllowedTaxId = null,
public ?array $pseAllowedTaxIds = null,
public ?string $pseFullName = null,
Expand Down Expand Up @@ -50,7 +50,7 @@ public function toArray(): array
public static function fromArray(array $data): self
{
return new self(
pixAllowedTaxIds: $data['pix_allowed_tax_ids'] ?? [],
pixAllowedTaxIds: $data['pix_allowed_tax_ids'] ?? null,
transfersAllowedTaxId: $data['transfers_allowed_tax_id'] ?? null,
pseAllowedTaxIds: $data['pse_allowed_tax_ids'] ?? null,
pseFullName: $data['pse_full_name'] ?? null,
Expand All @@ -66,13 +66,13 @@ public static function fromArray(array $data): self
readonly class CreatePayinQuoteInput
{
public function __construct(
public string $blockchainWalletId,
public ?string $blockchainWalletId,
public CurrencyType $currencyType,
public PaymentMethod $paymentMethod,
public float $requestAmount,
public StablecoinToken $token,
public bool $coverFees,
public PayerRules $payerRules,
public ?bool $coverFees,
public ?PayerRules $payerRules,
public ?string $partnerFeeId = null,
public ?bool $isOtc = null,
public ?string $walletId = null
Expand All @@ -87,7 +87,7 @@ public function toArray(): array
'request_amount' => $this->requestAmount,
'token' => $this->token->value,
'cover_fees' => $this->coverFees,
'payer_rules' => $this->payerRules->toArray(),
'payer_rules' => $this->payerRules?->toArray(),
];

if ($this->partnerFeeId !== null) {
Expand All @@ -111,10 +111,10 @@ public function toArray(): array
public function __construct(
public string $id,
public int $expiresAt,
public float $commercialQuotation,
public float $blindpayQuotation,
public float $receiverAmount,
public float $senderAmount,
public ?float $commercialQuotation,
public ?float $blindpayQuotation,
public ?float $receiverAmount,
public ?float $senderAmount,
public ?float $partnerFeeAmount = null,
public ?float $flatFee = null
) {}
Expand All @@ -124,10 +124,10 @@ public static function fromArray(array $data): self
return new self(
id: $data['id'],
expiresAt: (int) $data['expires_at'],
commercialQuotation: (float) $data['commercial_quotation'],
blindpayQuotation: (float) $data['blindpay_quotation'],
receiverAmount: (float) $data['receiver_amount'],
senderAmount: (float) $data['sender_amount'],
commercialQuotation: isset($data['commercial_quotation']) ? (float) $data['commercial_quotation'] : null,
blindpayQuotation: isset($data['blindpay_quotation']) ? (float) $data['blindpay_quotation'] : null,
receiverAmount: isset($data['receiver_amount']) ? (float) $data['receiver_amount'] : null,
senderAmount: isset($data['sender_amount']) ? (float) $data['sender_amount'] : null,
partnerFeeAmount: isset($data['partner_fee_amount']) ? (float) $data['partner_fee_amount'] : null,
flatFee: isset($data['flat_fee']) ? (float) $data['flat_fee'] : null
);
Expand Down
Loading
Loading