diff --git a/README.md b/README.md index faa74bf..5c7b2ee 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Este SDK, não necessariamente, reflete todos dos recursos e funcionalidades dis - [Desvincular Token da Assinatura](#desvincular-token-da-assinatura) - [Quitar Parcela da Assinatura](#quitar-parcela-da-assinatura) - [Agendar Parcelamento da Assinatura](#agendar-parcelamento-da-assinatura) + - [Enviar Notificação de Assinatura](#enviar-notificação-de-assinatura) - [Transação (Transaction)](#transação-transaction) - [Obter Transação](#obter-transação) - [Listar Transações](#listar-transações) @@ -63,11 +64,15 @@ Este SDK, não necessariamente, reflete todos dos recursos e funcionalidades dis - [Token (Card Token)](#token-card-token) - [Novo Token](#novo-token) - [Obter Token](#obter-token) + - [Listar Tokens](#listar-tokens) - [Cobrança (Charge)](#cobrança-charge) - [Nova Cobrança](#nova-cobrança) - [Alterar Cobrança](#alterar-cobrança) - [Obter Cobrança](#obter-cobrança) - [Listar Cobranças](#listar-cobranças) + - [Enviar Notificação de Cobrança](#enviar-notificação-de-cobrança) +- [Conta (Account)](#conta-account) + - [Listar Taxas](#listar-taxas) - [Estabelecimento (Establishment)](#estabelecimento-establishment) - [Novo Estabelecimento](#novo-estabelecimento) - [Alterar Estabelecimento](#alterar-estabelecimento) @@ -77,6 +82,9 @@ Este SDK, não necessariamente, reflete todos dos recursos e funcionalidades dis - [Listar todas Transações dos Estabelecimentos](#listar-todas-transações-dos-estabelecimentos) - [Listar Transações dos Estabelecimentos](#listar-transações-dos-estabelecimentos) - [Obter Transação de um Estabelecimento](#obter-transação-de-um-estabelecimento) + - [Aplicar Disputas de Transações](#aplicar-disputas-de-transações) + - [Aplicar Chargebacks de Transações](#aplicar-chargebacks-de-transações) + - [Listar Disputas de um Estabelecimento](#listar-disputas-de-um-estabelecimento) - [Métodos de Pagamento (Payment Methods)](#métodos-de-pagamento-payment-methods) - [Configurar Métodos de Pagamento](#configurar-métodos-de-pagamento) - [Antifraudes (Antifraud)](#antifraudes-antifraud) @@ -101,10 +109,12 @@ Este SDK, não necessariamente, reflete todos dos recursos e funcionalidades dis - [Listar Lançamentos Futuros](#listar-lançamentos-futuros) - [Listar Lançamentos Futuros de Vendedor (Por Id)](#listar-lançamentos-futuros-de-vendedor-por-id) - [Listar Lançamentos Futuros de Vendedor (Por CPF/CNPJ)](#listar-lançamentos-futuros-de-vendedor-por-cpfcnpj) + - [Listar Recebíveis](#listar-recebíveis) - [Link de Pagamento (Payment Links)](#link-de-pagamento-payment-links) - [Novo Link de Pagamento](#novo-link-de-pagamento) - [Obter Link de Pagamento (Por Id)](#obter-link-de-pagamento-por-id) - [Obter Link de Pagamento (Por External Code)](#obter-link-de-pagamento-por-external-code) + - [Listar Links de pagamento](#listar-links-de-pagamento) - [Webhook](#webhook) - [Novo Webhook](#novo-webhook) - [Obter Webhook](#obter-webhook) @@ -112,6 +122,7 @@ Este SDK, não necessariamente, reflete todos dos recursos e funcionalidades dis - [Deletar Webhook](#deletar-webhook) - [Checkout](#checkout) - [Novo Checkout](#novo-checkout) + - [Obter Parcelamento](#obter-parcelamento) - [Voucher](#voucher) - [Novo Voucher](#novo-voucher) - [Helpers](#helpers) @@ -570,6 +581,12 @@ $responseSubscription = $ipagClient->subscription()->payOffInstallment($subscrip $responseSubscription = $ipagClient->subscription()->scheduleInstallmentPayment($subscriptionId, $invoiceNumber); ``` +### Enviar Notificação de Assinatura + +```php +$responseSubscriptionNotify = $ipagClient->subscriptionV2()->notify($subscriptionId); +``` + > Todos os exemplos: [examples/subscription/](https://github.com/ipagdevs/ipag-sdk-php/tree/master/examples/subscription/) # Transação (Transaction) @@ -660,6 +677,14 @@ $responseToken = $ipagClient->token()->create($token); $responseToken = $ipagClient->token()->get($tokenValue); ``` +### Listar Tokens + +```php +$tokensResponse = $ipagClient->token()->list([ + 'limit' => 10 +]); +``` + > Todos os exemplos: [examples/token/](https://github.com/ipagdevs/ipag-sdk-php/tree/master/examples/token/) # Cobrança (Charge) @@ -737,8 +762,22 @@ $responseCharge = $ipagClient->charge()->list([ ]); ``` +### Enviar Notificação de Cobrança + +```php +$chargeNotifyResponse = $ipagClient->chargeV2()->notify($chargeId); +``` + > Todos os exemplos: [examples/charge/](https://github.com/ipagdevs/ipag-sdk-php/tree/master/examples/charge/) +# Conta (Account) + +### Listar taxas + +```php +$responseMyFees = $ipagClient->account()->myFees(); +``` + # Estabelecimento (Establishment) ```php @@ -819,6 +858,26 @@ $responseTransactions = $ipagClient->establishment()->transaction()->listByEstab $responseTransactions = $ipagClient->establishment()->transaction()->getByEstablishment($establishmentTid, $transactionTid); ``` +### Aplicar Disputas de Transações + +```php +$transactions = [00001, 00002, 00003]; +$responseDisputes = $ipagClient->establishment()->disputes()->applyDisputes($establishmentId, $transactions); +``` + +### Aplicar Chargebacks de Transações + +```php +$transactions = [00001, 00002, 00003]; +$responseChargeBacks = $ipagClient->establishment()->disputes()->applyChargeBacks($establishmentId, $transactions); +``` + +### Listar Disputas de um Estabelecimento + +```php +$responseDisputes = $ipagClient->establishment()->disputes()->list($establishmentId); +``` + ## Métodos de Pagamento (Payment Methods) ```php @@ -1052,6 +1111,14 @@ $responseTransfers = $ipagClient->transfer()->future()->listBySellerId($sellerId $responseTransfers = $ipagClient->transfer()->future()->listBySellerCpfCnpj($sellerCpf); ``` +## Listar Recebíveis + +```php +$receivablesResponse = $ipagClient->receivable()->list([ + 'from' => '2024-08-27' +]); +``` + > Todos os exemplos: [examples/transfer/](https://github.com/ipagdevs/ipag-sdk-php/tree/master/examples/transfer/) # Link de Pagamento (Payment Links) @@ -1105,6 +1172,12 @@ $responsePaymentLink = $ipagClient->paymentLinks()->getById($paymentLinkId); $responsePaymentLink = $ipagClient->paymentLinks()->getByExternalCode($externalCode); ``` +### Listar Links de Pagamento + +```php +$responsePaymentLink = $ipagClient->paymentLinksV2()->list(); +``` + > Todos os exemplos: [examples/payment_links/](https://github.com/ipagdevs/ipag-sdk-php/tree/master/examples/payment_links/) # Webhook @@ -1261,6 +1334,16 @@ $checkout = (new \Ipag\Sdk\Model\Checkout()) $responseCheckout = $ipagClient->checkout()->create($checkout); ``` +### Obter Parcelamento + +```php + $responseInstallmentsCheckout = $ipagClient->checkoutV2()->getInstallments( + new CheckoutInstallments([ + 'amount' => 100.00 + ]) + ); +``` + > Todos os exemplos: [examples/checkout/](https://github.com/ipagdevs/ipag-sdk-php/tree/master/examples/checkout/) # Voucher diff --git a/examples/account/00-my-fees.php b/examples/account/00-my-fees.php new file mode 100644 index 0000000..79819dd --- /dev/null +++ b/examples/account/00-my-fees.php @@ -0,0 +1,29 @@ +account()->myFees(); + $data = $responseMyFees->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; + +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; + +} \ No newline at end of file diff --git a/examples/charge/01-charge-update.php b/examples/charge/01-charge-update.php index 1f4a512..cac88c1 100644 --- a/examples/charge/01-charge-update.php +++ b/examples/charge/01-charge-update.php @@ -3,9 +3,9 @@ require_once __DIR__ . '/..' . '/config.php'; $charge = new \Ipag\Sdk\Model\Charge([ - 'amount' => 100, - 'description' => 'Cobrança referente a negociação de débito pendente na Empresa X', - 'due_date' => '2020-10-30', + 'amount' => 99, + 'description' => 'Cobrança referente a negociação de débito pendente na Empresa XX', + 'due_date' => '2020-10-29', 'frequency' => 1, 'interval' => 'month', 'type' => 'charge', diff --git a/examples/charge/04-charge-billing-notify.php b/examples/charge/04-charge-billing-notify.php new file mode 100644 index 0000000..9326963 --- /dev/null +++ b/examples/charge/04-charge-billing-notify.php @@ -0,0 +1,31 @@ +chargeV2()->notify($charge_id); + $data = $chargeNotifyResponse->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; + +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; + +} \ No newline at end of file diff --git a/examples/checkout/01-get-installments-checkout.php b/examples/checkout/01-get-installments-checkout.php new file mode 100644 index 0000000..e7536db --- /dev/null +++ b/examples/checkout/01-get-installments-checkout.php @@ -0,0 +1,34 @@ +checkoutV2()->getInstallments( + new CheckoutInstallments([ + 'amount' => 100.00 + ]) + ); + $data = $responseInstallmentsCheckout->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; + +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; + +} \ No newline at end of file diff --git a/examples/establishment/09-establishment-get-disputes.php b/examples/establishment/09-establishment-get-disputes.php new file mode 100644 index 0000000..2cc8d79 --- /dev/null +++ b/examples/establishment/09-establishment-get-disputes.php @@ -0,0 +1,29 @@ +establishment()->disputes()->list($establishment_id); + $data = $responseDisputes->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (\Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; +} \ No newline at end of file diff --git a/examples/establishment/10-establishment-apply-dispute.php b/examples/establishment/10-establishment-apply-dispute.php new file mode 100644 index 0000000..ffde91f --- /dev/null +++ b/examples/establishment/10-establishment-apply-dispute.php @@ -0,0 +1,30 @@ +establishment()->disputes()->applyDisputes($establishment_id, $transactions); + $data = $responseDisputes->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (\Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; +} \ No newline at end of file diff --git a/examples/establishment/11-establishment-apply-chargebacks.php b/examples/establishment/11-establishment-apply-chargebacks.php new file mode 100644 index 0000000..f4a6e26 --- /dev/null +++ b/examples/establishment/11-establishment-apply-chargebacks.php @@ -0,0 +1,30 @@ +establishment()->disputes()->applyChargeBacks($establishment_id, $transactions); + $data = $responseChargeBacks->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (\Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; +} \ No newline at end of file diff --git a/examples/payment_links/03-payment-link-list.php b/examples/payment_links/03-payment-link-list.php new file mode 100644 index 0000000..751d2fa --- /dev/null +++ b/examples/payment_links/03-payment-link-list.php @@ -0,0 +1,31 @@ +paymentLinksV2()->list([ + "id" => 9 + ]); + $data = $responsePaymentLink->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; + +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; + +} \ No newline at end of file diff --git a/examples/receivable/00-receivables-list.php b/examples/receivable/00-receivables-list.php new file mode 100644 index 0000000..eefa9fa --- /dev/null +++ b/examples/receivable/00-receivables-list.php @@ -0,0 +1,31 @@ +receivable()->list([ + 'from' => '2024-08-27' + ]); + $data = $receivablesResponse->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; + +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; + +} \ No newline at end of file diff --git a/examples/subscription/07-subscription-billing-notify.php b/examples/subscription/07-subscription-billing-notify.php new file mode 100644 index 0000000..710a33d --- /dev/null +++ b/examples/subscription/07-subscription-billing-notify.php @@ -0,0 +1,31 @@ +subscriptionV2()->notify($subscription_id); + $data = $responseSubscriptionNotify->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; + +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; + +} \ No newline at end of file diff --git a/examples/token/02-token-list.php b/examples/token/02-token-list.php new file mode 100644 index 0000000..476b25b --- /dev/null +++ b/examples/token/02-token-list.php @@ -0,0 +1,31 @@ +token()->list([ + 'limit' => 10 + ]); + $data = $tokensResponse->getData(); + + echo "
" . PHP_EOL; + print_r($data); + echo "" . PHP_EOL; + +} catch (Ipag\Sdk\Exception\HttpException $e) { + $code = $e->getResponse()->getStatusCode(); + $errors = $e->getErrors(); + + echo "
" . PHP_EOL; + var_dump($code, $errors); + echo "" . PHP_EOL; + +} catch (Exception $e) { + $error = $e->getMessage(); + + echo "
" . PHP_EOL; + var_dump($error); + echo "" . PHP_EOL; + +} \ No newline at end of file diff --git a/src/Core/IpagClient.php b/src/Core/IpagClient.php index 224bdf2..ceecfd9 100644 --- a/src/Core/IpagClient.php +++ b/src/Core/IpagClient.php @@ -3,15 +3,21 @@ namespace Ipag\Sdk\Core; use Ipag\Sdk\Core\IpagEnvironment; +use Ipag\Sdk\Endpoint\AccountEndpoint; use Ipag\Sdk\Endpoint\ChargeEndpoint; +use Ipag\Sdk\Endpoint\ChargeEndpointV2; use Ipag\Sdk\Endpoint\CheckoutEndpoint; +use Ipag\Sdk\Endpoint\CheckoutEndpointV2; use Ipag\Sdk\Endpoint\CustomerEndpoint; use Ipag\Sdk\Endpoint\EstablishmentEndpoint; use Ipag\Sdk\Endpoint\PaymentEndpoint; use Ipag\Sdk\Endpoint\PaymentLinksEndpoint; +use Ipag\Sdk\Endpoint\PaymentLinksEndpointV2; +use Ipag\Sdk\Endpoint\ReceivableEndpoint; use Ipag\Sdk\Endpoint\SellerEndpoint; use Ipag\Sdk\Endpoint\SplitRulesEndpoint; use Ipag\Sdk\Endpoint\SubscriptionEndpoint; +use Ipag\Sdk\Endpoint\SubscriptionEndpointV2; use Ipag\Sdk\Endpoint\SubscriptionPlanEndpoint; use Ipag\Sdk\Endpoint\TokenEndpoint; use Ipag\Sdk\Endpoint\TransactionEndpoint; @@ -72,6 +78,11 @@ public function subscription(): SubscriptionEndpoint return SubscriptionEndpoint::make($this, $this); } + public function subscriptionV2(): SubscriptionEndpointV2 + { + return SubscriptionEndpointV2::make($this, $this); + } + public function transaction(): TransactionEndpoint { return TransactionEndpoint::make($this, $this); @@ -87,6 +98,11 @@ public function charge(): ChargeEndpoint return ChargeEndpoint::make($this, $this); } + public function chargeV2(): ChargeEndpointV2 + { + return ChargeEndpointV2::make($this, $this); + } + public function establishment(): EstablishmentEndpoint { return EstablishmentEndpoint::make($this, $this); @@ -102,6 +118,11 @@ public function paymentLinks(): PaymentLinksEndpoint return PaymentLinksEndpoint::make($this, $this); } + public function paymentLinksV2(): PaymentLinksEndpointV2 + { + return PaymentLinksEndpointV2::make($this, $this); + } + public function webhook(): WebhookEndpoint { return WebhookEndpoint::make($this, $this); @@ -127,9 +148,23 @@ public function checkout(): CheckoutEndpoint return CheckoutEndpoint::make($this, $this); } + public function checkoutV2(): CheckoutEndpointV2 + { + return CheckoutEndpointV2::make($this, $this); + } + public function payment(): PaymentEndpoint { return PaymentEndpoint::make($this, $this); } + public function account(): AccountEndpoint + { + return AccountEndpoint::make($this, $this); + } + + public function receivable(): ReceivableEndpoint + { + return ReceivableEndpoint::make($this, $this); + } } \ No newline at end of file diff --git a/src/Endpoint/AccountEndpoint.php b/src/Endpoint/AccountEndpoint.php new file mode 100644 index 0000000..9a7b9e8 --- /dev/null +++ b/src/Endpoint/AccountEndpoint.php @@ -0,0 +1,17 @@ +_GET([], [], '/my-fees'); + } + +} \ No newline at end of file diff --git a/src/Endpoint/ChargeEndpointV2.php b/src/Endpoint/ChargeEndpointV2.php new file mode 100644 index 0000000..7bc7ede --- /dev/null +++ b/src/Endpoint/ChargeEndpointV2.php @@ -0,0 +1,27 @@ +_POST([], [], [], "/$charge_id/notify"); + } +} \ No newline at end of file diff --git a/src/Endpoint/CheckoutEndpointV2.php b/src/Endpoint/CheckoutEndpointV2.php new file mode 100644 index 0000000..5f3b8e3 --- /dev/null +++ b/src/Endpoint/CheckoutEndpointV2.php @@ -0,0 +1,28 @@ +_GET(empty($checkoutInstallments) ? [] : $checkoutInstallments->jsonSerialize(), [], '/installments'); + } +} \ No newline at end of file diff --git a/src/Endpoint/EstablishmentDisputeEndpoint.php b/src/Endpoint/EstablishmentDisputeEndpoint.php new file mode 100644 index 0000000..7c1d637 --- /dev/null +++ b/src/Endpoint/EstablishmentDisputeEndpoint.php @@ -0,0 +1,50 @@ +_GET($filters, [], "/$establishment_id/transactions/disputes"); + } + + /** + * Endpoint para aplicar disputas aos recursos `Transactions` + * @param string $establishment_id + * @param array $transactions + * @return Response + */ + public function applyDisputes(string $establishment_id, array $transactions): Response + { + return $this->_POST(compact('transactions'), [], [], "/$establishment_id/transactions/dispute"); + } + + /** + * Endpoint para aplicar charge back aos recursos `Transactions` + * @param string $establishment_id + * @param array $transactions + * @return Response + */ + public function applyChargeBacks(string $establishment_id, array $transactions): Response + { + return $this->_POST(compact('transactions'), [], [], "/$establishment_id/transactions/chargeback"); + } +} \ No newline at end of file diff --git a/src/Endpoint/EstablishmentEndpoint.php b/src/Endpoint/EstablishmentEndpoint.php index a3531d4..dba577e 100644 --- a/src/Endpoint/EstablishmentEndpoint.php +++ b/src/Endpoint/EstablishmentEndpoint.php @@ -103,4 +103,13 @@ public function antifraud(): EstablishmentAntifraudEndpoint { return EstablishmentAntifraudEndpoint::make($this->parent, $this->parent); } + + /** + * Endpoint `Dispute` do recurso `Establishment` + * @return EstablishmentDisputeEndpoint + */ + public function disputes(): EstablishmentDisputeEndpoint + { + return EstablishmentDisputeEndpoint::make($this->parent, $this->parent); + } } \ No newline at end of file diff --git a/src/Endpoint/PaymentLinksEndpointV2.php b/src/Endpoint/PaymentLinksEndpointV2.php new file mode 100644 index 0000000..e93d79f --- /dev/null +++ b/src/Endpoint/PaymentLinksEndpointV2.php @@ -0,0 +1,27 @@ +_GET($filters ?? []); + } +} \ No newline at end of file diff --git a/src/Endpoint/ReceivableEndpoint.php b/src/Endpoint/ReceivableEndpoint.php new file mode 100644 index 0000000..60d7c8b --- /dev/null +++ b/src/Endpoint/ReceivableEndpoint.php @@ -0,0 +1,27 @@ +_GET($filters ?? [], [], '/upcoming'); + } +} \ No newline at end of file diff --git a/src/Endpoint/SubscriptionEndpointV2.php b/src/Endpoint/SubscriptionEndpointV2.php new file mode 100644 index 0000000..c876b54 --- /dev/null +++ b/src/Endpoint/SubscriptionEndpointV2.php @@ -0,0 +1,27 @@ +_POST([], [], [], "/$subscription_id/notify"); + } +} \ No newline at end of file diff --git a/src/Endpoint/TokenEndpoint.php b/src/Endpoint/TokenEndpoint.php index 696947c..467df47 100644 --- a/src/Endpoint/TokenEndpoint.php +++ b/src/Endpoint/TokenEndpoint.php @@ -39,4 +39,8 @@ public function get(string $token): Response return $this->_GET(['token' => $token]); } + public function list(?array $filters = []): Response + { + return $this->_GET($filters ?? []); + } } \ No newline at end of file diff --git a/src/Model/CheckoutInstallments.php b/src/Model/CheckoutInstallments.php new file mode 100644 index 0000000..19236b8 --- /dev/null +++ b/src/Model/CheckoutInstallments.php @@ -0,0 +1,157 @@ +float('amount')->nullable(); + $schema->int('max_installment')->nullable(); + $schema->int('installments_without_interest')->nullable(); + $schema->float('installment_min_amount')->nullable(); + $schema->float('installment_tax')->nullable(); + + return $schema->build(); + } + + protected function amount(): Mutator + { + return new Mutator( + null, + fn($value, $ctx) => + is_null($value) ? $value : + ( + Assert::value(floatval($value))->gte(0)->get() + ?? $ctx->raise('inválido') + ) + ); + } + + protected function max_installment(): Mutator + { + return new Mutator( + null, + fn($value, $ctx) => + is_null($value) ? $value : + ( + Assert::value(intval($value))->gte(0)->get() + ?? $ctx->raise('inválido') + ) + ); + } + + protected function installments_without_interest(): Mutator + { + return new Mutator( + null, + fn($value, $ctx) => + is_null($value) ? $value : + ( + Assert::value(intval($value))->gte(0)->get() + ?? $ctx->raise('inválido') + ) + ); + } + + protected function installment_min_amount(): Mutator + { + return new Mutator( + null, + fn($value, $ctx) => + is_null($value) ? $value : + ( + Assert::value(floatval($value))->gte(0)->get() + ?? $ctx->raise('inválido') + ) + ); + } + + protected function installment_tax(): Mutator + { + return new Mutator( + null, + fn($value, $ctx) => + is_null($value) ? $value : + ( + Assert::value(floatval($value))->gte(0)->get() + ?? $ctx->raise('inválido') + ) + ); + } + + public function getAmount(): ?float + { + return $this->get('amount'); + } + + public function setAmount(?float $amount = null): self + { + $this->set('amount', $amount); + return $this; + } + + public function getMaxInstallment(): ?int + { + return $this->get('max_installment'); + } + + public function setMaxInstallment(?int $max_installment = null): self + { + $this->set('max_installment', $max_installment); + return $this; + } + + public function getInstallmentsWithoutInterest(): ?int + { + return $this->get('installments_without_interest'); + } + + public function setInstallmentsWithoutInterest(?int $installments_without_interest = null): self + { + $this->set('installments_without_interest', $installments_without_interest); + return $this; + } + + public function getInstallmentMinAmount(): ?float + { + return $this->get('installment_min_amount'); + } + + public function setInstallmentMinAmount(?float $installment_min_amount = null): self + { + $this->set('installment_min_amount', $installment_min_amount); + return $this; + } + + public function getInstallmentTax(): ?float + { + return $this->get('installment_tax'); + } + + public function setInstallmentTax(?float $installment_tax = null): self + { + $this->set('installment_tax', $installment_tax); + return $this; + } +} \ No newline at end of file diff --git a/src/Model/PaymentTransaction.php b/src/Model/PaymentTransaction.php index f3843c0..71f71b9 100644 --- a/src/Model/PaymentTransaction.php +++ b/src/Model/PaymentTransaction.php @@ -22,6 +22,7 @@ final class PaymentTransaction extends Model * + [`'amount'`] float. * + [`'order_id'`] string. * + [`'callback_url'`] string. + * + [`'redirect_url'`] string. * * + [`'antifraud'`] array (opcional) dos dados do Antifraud. * + [`'fingerprint'`] string. @@ -114,6 +115,7 @@ public function schema(SchemaBuilder $schema): Schema $schema->float('amount')->nullable(); $schema->string('order_id')->nullable(); $schema->string('callback_url')->nullable(); + $schema->string('redirect_url')->nullable(); $schema->has('antifraud', PaymentAntifraud::class)->nullable(); $schema->has('payment', Payment::class)->nullable(); @@ -205,6 +207,22 @@ public function setCallbackUrl(?string $callbackUrl = null): self return $this; } + /** + * Retorna o valor da propriedade `redirect_url`. + * + * @return string|null + */ + public function getRedirectUrl(): ?string + { + return $this->get('redirect_url'); + } + + public function setRedirectUrl(?string $redirectUrl = null): self + { + $this->set('redirect_url', $redirectUrl); + return $this; + } + /** * Retorna o valor da propriedade `PaymentAntifraud`. * diff --git a/tests/Endpoint/AccountEndpointTest.php b/tests/Endpoint/AccountEndpointTest.php new file mode 100644 index 0000000..e9fd1d2 --- /dev/null +++ b/tests/Endpoint/AccountEndpointTest.php @@ -0,0 +1,90 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $accountResponse = $this->client->account()->myFees(); + + $this->assertIsObject($accountResponse); + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $this->client->account()->myFees(); + + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $this->client->account()->myFees(); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $this->client->paymentLinksV2()->list([]); + } +} \ No newline at end of file diff --git a/tests/Endpoint/ChargeEndpointV2Test.php b/tests/Endpoint/ChargeEndpointV2Test.php new file mode 100644 index 0000000..0ac91ba --- /dev/null +++ b/tests/Endpoint/ChargeEndpointV2Test.php @@ -0,0 +1,98 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $charge_id = 1; + + $chargeResponse = $this->client->chargeV2()->notify($charge_id); + + $this->assertIsObject($chargeResponse); + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $charge_id = 1; + + $this->client->chargeV2()->notify($charge_id); + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $charge_id = 1; + + $this->client->chargeV2()->notify($charge_id); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $charge_id = 1; + + $this->client->chargeV2()->notify($charge_id); + } + +} \ No newline at end of file diff --git a/tests/Endpoint/CheckoutEndpointV2Test.php b/tests/Endpoint/CheckoutEndpointV2Test.php new file mode 100644 index 0000000..71442ca --- /dev/null +++ b/tests/Endpoint/CheckoutEndpointV2Test.php @@ -0,0 +1,89 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $checkoutResponse = $this->client->checkoutV2()->getInstallments(); + + $this->assertIsObject($checkoutResponse); + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $this->client->checkoutV2()->getInstallments(); + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $this->client->checkoutV2()->getInstallments(); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $this->client->checkoutV2()->getInstallments(); + } +} \ No newline at end of file diff --git a/tests/Endpoint/EstablishmentDisputeEndpointTest.php b/tests/Endpoint/EstablishmentDisputeEndpointTest.php new file mode 100644 index 0000000..0fc244d --- /dev/null +++ b/tests/Endpoint/EstablishmentDisputeEndpointTest.php @@ -0,0 +1,97 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $establishment_id = 100000; + + $disputeResponse = $this->client->establishment()->disputes()->list($establishment_id); + + $this->assertIsObject($disputeResponse); + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $establishment_id = 100000; + + $this->client->establishment()->disputes()->list($establishment_id); + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $establishment_id = 100000; + + $this->client->establishment()->disputes()->list($establishment_id); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $establishment_id = 100000; + + $this->client->establishment()->disputes()->list($establishment_id); + } +} \ No newline at end of file diff --git a/tests/Endpoint/PaymentEndpointV2Test.php b/tests/Endpoint/PaymentEndpointV2Test.php new file mode 100644 index 0000000..20aad56 --- /dev/null +++ b/tests/Endpoint/PaymentEndpointV2Test.php @@ -0,0 +1,89 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $responsePaymentLink = $this->client->paymentLinksV2()->list([]); + + $this->assertIsObject($responsePaymentLink); + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $this->client->paymentLinksV2()->list([]); + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $this->client->paymentLinksV2()->list([]); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $this->client->paymentLinksV2()->list([]); + } +} \ No newline at end of file diff --git a/tests/Endpoint/PaymentLinksEndpointV2Test.php b/tests/Endpoint/PaymentLinksEndpointV2Test.php new file mode 100644 index 0000000..226e90f --- /dev/null +++ b/tests/Endpoint/PaymentLinksEndpointV2Test.php @@ -0,0 +1,90 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $paymentLinksResponse = $this->client->paymentLinksV2()->list(); + + $this->assertIsObject($paymentLinksResponse); + + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $this->client->paymentLinksV2()->list(); + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $this->client->paymentLinksV2()->list(); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $this->client->paymentLinksV2()->list(); + } +} \ No newline at end of file diff --git a/tests/Endpoint/ReceivableEndpointTest.php b/tests/Endpoint/ReceivableEndpointTest.php new file mode 100644 index 0000000..d07b011 --- /dev/null +++ b/tests/Endpoint/ReceivableEndpointTest.php @@ -0,0 +1,89 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $receivableResponse = $this->client->receivable()->list(); + + $this->assertIsObject($receivableResponse); + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $this->client->receivable()->list(); + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $this->client->receivable()->list(); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $this->client->receivable()->list(); + } +} \ No newline at end of file diff --git a/tests/Endpoint/SubscriptionEndpointV2Test.php b/tests/Endpoint/SubscriptionEndpointV2Test.php new file mode 100644 index 0000000..1c317f5 --- /dev/null +++ b/tests/Endpoint/SubscriptionEndpointV2Test.php @@ -0,0 +1,97 @@ +instanceClient([ + new Response( + 201, + [], + json_encode(((object) [])) + ) + ]); + + $subscription_id = 1; + + $notifyResponse = $this->client->subscriptionV2()->notify($subscription_id); + + $this->assertIsObject($notifyResponse); + } + + public function testShouldResponseFailUnprocessableDataClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 406, + [], + json_encode( + (object) [ + "code" => "406", + "message" => + [ + "description" => + [ + "Description is required", + "Description must be at least 10 characters long", + ] + ] + ] + ) + ) + ]); + + $subscription_id = 1; + + $this->client->subscriptionV2()->notify($subscription_id); + } + + public function testShouldResponseFailUnauthenticatedClient() + { + $this->expectException(HttpException::class); + + $this->instanceClient([ + new Response( + 401, + [], + json_encode( + (object) [ + "code" => 401, + "message" => "Unauthorized", + "resource" => "authorization" + ] + ) + ) + ]); + + $subscription_id = 1; + + $this->client->subscriptionV2()->notify($subscription_id); + } + + public function testThrowsServerExceptionOnServerError() + { + $this->expectException(HttpServerException::class); + + $this->instanceClient([ + new Response( + 500, + [], + json_encode(((object) [])) + ) + ]); + + $subscription_id = 1; + + $this->client->subscriptionV2()->notify($subscription_id); + } +} \ No newline at end of file diff --git a/tests/Model/CheckoutInstallmentsTest.php b/tests/Model/CheckoutInstallmentsTest.php new file mode 100644 index 0000000..016b846 --- /dev/null +++ b/tests/Model/CheckoutInstallmentsTest.php @@ -0,0 +1,82 @@ + 100.00, + 'max_installment' => 12, + 'installments_without_interest' => 3, + 'installment_min_amount' => 5.00, + 'installment_tax' => 2.24, + ]); + + $this->assertEquals(100.00, $checkoutInstallments->getAmount()); + $this->assertEquals(12, $checkoutInstallments->getMaxInstallment()); + $this->assertEquals(3, $checkoutInstallments->getInstallmentsWithoutInterest()); + $this->assertEquals(5.00, $checkoutInstallments->getInstallmentMinAmount()); + $this->assertEquals(2.24, $checkoutInstallments->getInstallmentTax()); + + } + + public function testShouldCreateCheckoutInstallmentsObjectAndSetTheValuesSuccessfully() + { + $checkoutInstallments = (new \Ipag\Sdk\Model\CheckoutInstallments()) + ->setAmount(100.00) + ->setMaxInstallment(12) + ->setInstallmentsWithoutInterest(3) + ->setInstallmentMinAmount(5.00) + ->setInstallmentTax(2.24); + + $this->assertEquals(100.00, $checkoutInstallments->getAmount()); + $this->assertEquals(12, $checkoutInstallments->getMaxInstallment()); + $this->assertEquals(3, $checkoutInstallments->getInstallmentsWithoutInterest()); + $this->assertEquals(5.00, $checkoutInstallments->getInstallmentMinAmount()); + $this->assertEquals(2.24, $checkoutInstallments->getInstallmentTax()); + + } + + public function testShouldCreateEmptyCheckoutInstallmentsObjectSuccessfully() + { + $checkoutInstallments = new \Ipag\Sdk\Model\CheckoutInstallments(); + + $this->assertEmpty($checkoutInstallments->getAmount()); + $this->assertEmpty($checkoutInstallments->getMaxInstallment()); + $this->assertEmpty($checkoutInstallments->getInstallmentsWithoutInterest()); + $this->assertEmpty($checkoutInstallments->getInstallmentMinAmount()); + $this->assertEmpty($checkoutInstallments->getInstallmentTax()); + + } + + public function testCreateAndSetEmptyPropertiesCheckoutInstallmentsObjectSuccessfully() + { + $checkoutInstallments = new \Ipag\Sdk\Model\CheckoutInstallments([ + 'amount' => 100.00, + 'max_installment' => 12, + 'installments_without_interest' => 3, + 'installment_min_amount' => 5.00, + 'installment_tax' => 2.24, + ]); + + $checkoutInstallments + ->setAmount(null) + ->setMaxInstallment(null) + ->setInstallmentsWithoutInterest(null) + ->setInstallmentMinAmount(null) + ->setInstallmentTax(null); + + $this->assertEmpty($checkoutInstallments->getAmount()); + $this->assertEmpty($checkoutInstallments->getMaxInstallment()); + $this->assertEmpty($checkoutInstallments->getInstallmentsWithoutInterest()); + $this->assertEmpty($checkoutInstallments->getInstallmentMinAmount()); + $this->assertEmpty($checkoutInstallments->getInstallmentTax()); + + } +} \ No newline at end of file diff --git a/tests/Model/PaymentTransactionTest.php b/tests/Model/PaymentTransactionTest.php index 14ef922..ee40557 100644 --- a/tests/Model/PaymentTransactionTest.php +++ b/tests/Model/PaymentTransactionTest.php @@ -13,6 +13,7 @@ public function testShouldCreatePaymentTransactionObjectWithConstructorSuccessfu 'amount' => 100.0, 'order_id' => '123456', 'callback_url' => 'https://ipag-sdk.requestcatcher.com/callback', + 'redirect_url' => 'https://ipag-sdk.requestcatcher.com/callback', 'antifraud' => [ 'fingerprint' => '123', 'provider' => 'test', @@ -88,6 +89,7 @@ public function testShouldCreatePaymentTransactionObjectWithConstructorSuccessfu $this->assertEquals(100.0, $paymentTransaction->getAmount()); $this->assertEquals('123456', $paymentTransaction->getOrderId()); $this->assertEquals('https://ipag-sdk.requestcatcher.com/callback', $paymentTransaction->getCallbackUrl()); + $this->assertEquals('https://ipag-sdk.requestcatcher.com/callback', $paymentTransaction->getRedirectUrl()); $this->assertEquals('123', $paymentTransaction->getAntifraud()->getFingerprint()); $this->assertEquals('test', $paymentTransaction->getAntifraud()->getProvider()); @@ -155,6 +157,7 @@ public function testShouldCreatePaymentTransactionObjectAndSetTheValuesSuccessfu ->setAmount(100.0) ->setOrderId('123456') ->setCallbackUrl('https://ipag-sdk.requestcatcher.com/callback') + ->setRedirectUrl('https://ipag-sdk.requestcatcher.com/callback') ->setAntifraud( (new \Ipag\Sdk\Model\PaymentAntifraud()) ->setFingerprint('123') @@ -238,6 +241,7 @@ public function testShouldCreatePaymentTransactionObjectAndSetTheValuesSuccessfu $this->assertEquals(100.0, $paymentTransaction->getAmount()); $this->assertEquals('123456', $paymentTransaction->getOrderId()); $this->assertEquals('https://ipag-sdk.requestcatcher.com/callback', $paymentTransaction->getCallbackUrl()); + $this->assertEquals('https://ipag-sdk.requestcatcher.com/callback', $paymentTransaction->getRedirectUrl()); $this->assertEquals('123', $paymentTransaction->getAntifraud()->getFingerprint()); $this->assertEquals('test', $paymentTransaction->getAntifraud()->getProvider()); @@ -306,6 +310,7 @@ public function testShouldCreateEmptyPaymentTransactionObjectSuccessfully() $this->assertEmpty($paymentTransaction->getAmount()); $this->assertEmpty($paymentTransaction->getOrderId()); $this->assertEmpty($paymentTransaction->getCallbackUrl()); + $this->assertEmpty($paymentTransaction->getRedirectUrl()); $this->assertEmpty($paymentTransaction->getAntifraud()); $this->assertEmpty($paymentTransaction->getPayment()); $this->assertEmpty($paymentTransaction->getCustomer()); @@ -322,6 +327,7 @@ public function testCreateAndSetEmptyPropertiesPaymentTransactionObjectSuccessfu 'amount' => 100.0, 'order_id' => '123456', 'callback_url' => 'https://ipag-sdk.requestcatcher.com/callback', + 'redirect_url' => 'https://ipag-sdk.requestcatcher.com/callback', 'antifraud' => [ 'fingerprint' => '123', 'provider' => 'test', @@ -398,6 +404,7 @@ public function testCreateAndSetEmptyPropertiesPaymentTransactionObjectSuccessfu ->setAmount(null) ->setOrderId(null) ->setCallbackUrl(null) + ->setRedirectUrl(null) ->setAntifraud(null) ->setPayment(null) ->setCustomer(null) @@ -409,6 +416,7 @@ public function testCreateAndSetEmptyPropertiesPaymentTransactionObjectSuccessfu $this->assertEmpty($paymentTransaction->getAmount()); $this->assertEmpty($paymentTransaction->getOrderId()); $this->assertEmpty($paymentTransaction->getCallbackUrl()); + $this->assertEmpty($paymentTransaction->getRedirectUrl()); $this->assertEmpty($paymentTransaction->getAntifraud()); $this->assertEmpty($paymentTransaction->getPayment()); $this->assertEmpty($paymentTransaction->getCustomer());