Skip to content
Open
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,23 @@ 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)
- [Liberar Recebíveis da Transação](#liberar-recebíveis-da-transação)
- [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)
Expand All @@ -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)
Expand All @@ -101,17 +109,20 @@ 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)
- [Listar Webhooks](#listar-webhooks)
- [Deletar Webhook](#deletar-webhook)
- [Checkout](#checkout)
- [Novo Checkout](#novo-checkout)
- [Obter Parcelamento](#obter-parcelamento)
- [Voucher](#voucher)
- [Novo Voucher](#novo-voucher)
- [Helpers](#helpers)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions examples/account/00-my-fees.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

require_once __DIR__ . '/..' . '/config.php';

try {

$responseMyFees = $ipagClient->account()->myFees();
$data = $responseMyFees->getData();

echo "<pre>" . PHP_EOL;
print_r($data);
echo "</pre>" . PHP_EOL;

} catch (Ipag\Sdk\Exception\HttpException $e) {
$code = $e->getResponse()->getStatusCode();
$errors = $e->getErrors();

echo "<pre>" . PHP_EOL;
var_dump($code, $errors);
echo "</pre>" . PHP_EOL;

} catch (Exception $e) {
$error = $e->getMessage();

echo "<pre>" . PHP_EOL;
var_dump($error);
echo "</pre>" . PHP_EOL;

}
6 changes: 3 additions & 3 deletions examples/charge/01-charge-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
31 changes: 31 additions & 0 deletions examples/charge/04-charge-billing-notify.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

require_once __DIR__ . '/..' . '/config.php';

try {

$charge_id = 124;

$chargeNotifyResponse = $ipagClient->chargeV2()->notify($charge_id);
$data = $chargeNotifyResponse->getData();

echo "<pre>" . PHP_EOL;
print_r($data);
echo "</pre>" . PHP_EOL;

} catch (Ipag\Sdk\Exception\HttpException $e) {
$code = $e->getResponse()->getStatusCode();
$errors = $e->getErrors();

echo "<pre>" . PHP_EOL;
var_dump($code, $errors);
echo "</pre>" . PHP_EOL;

} catch (Exception $e) {
$error = $e->getMessage();

echo "<pre>" . PHP_EOL;
var_dump($error);
echo "</pre>" . PHP_EOL;

}
34 changes: 34 additions & 0 deletions examples/checkout/01-get-installments-checkout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
use Ipag\Sdk\Model\CheckoutInstallments;

require_once __DIR__ . '/..' . '/config.php';

try {

$responseInstallmentsCheckout = $ipagClient->checkoutV2()->getInstallments(
new CheckoutInstallments([
'amount' => 100.00
])
);
$data = $responseInstallmentsCheckout->getData();

echo "<pre>" . PHP_EOL;
print_r($data);
echo "</pre>" . PHP_EOL;

} catch (Ipag\Sdk\Exception\HttpException $e) {
$code = $e->getResponse()->getStatusCode();
$errors = $e->getErrors();

echo "<pre>" . PHP_EOL;
var_dump($code, $errors);
echo "</pre>" . PHP_EOL;

} catch (Exception $e) {
$error = $e->getMessage();

echo "<pre>" . PHP_EOL;
var_dump($error);
echo "</pre>" . PHP_EOL;

}
29 changes: 29 additions & 0 deletions examples/establishment/09-establishment-get-disputes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

require_once __DIR__ . '/..' . '/config.php';

try {

$establishment_id = 100000;

$responseDisputes = $ipagClient->establishment()->disputes()->list($establishment_id);
$data = $responseDisputes->getData();

echo "<pre>" . PHP_EOL;
print_r($data);
echo "</pre>" . PHP_EOL;

} catch (\Ipag\Sdk\Exception\HttpException $e) {
$code = $e->getResponse()->getStatusCode();
$errors = $e->getErrors();

echo "<pre>" . PHP_EOL;
var_dump($code, $errors);
echo "</pre>" . PHP_EOL;
} catch (Exception $e) {
$error = $e->getMessage();

echo "<pre>" . PHP_EOL;
var_dump($error);
echo "</pre>" . PHP_EOL;
}
30 changes: 30 additions & 0 deletions examples/establishment/10-establishment-apply-dispute.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

require_once __DIR__ . '/..' . '/config.php';

try {

$establishment_id = 100000;
$transactions = [00001, 00002, 00003];

$responseDisputes = $ipagClient->establishment()->disputes()->applyDisputes($establishment_id, $transactions);
$data = $responseDisputes->getData();

echo "<pre>" . PHP_EOL;
print_r($data);
echo "</pre>" . PHP_EOL;

} catch (\Ipag\Sdk\Exception\HttpException $e) {
$code = $e->getResponse()->getStatusCode();
$errors = $e->getErrors();

echo "<pre>" . PHP_EOL;
var_dump($code, $errors);
echo "</pre>" . PHP_EOL;
} catch (Exception $e) {
$error = $e->getMessage();

echo "<pre>" . PHP_EOL;
var_dump($error);
echo "</pre>" . PHP_EOL;
}
30 changes: 30 additions & 0 deletions examples/establishment/11-establishment-apply-chargebacks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

require_once __DIR__ . '/..' . '/config.php';

try {

$establishment_id = 100000;
$transactions = [00001, 00002, 00003];

$responseChargeBacks = $ipagClient->establishment()->disputes()->applyChargeBacks($establishment_id, $transactions);
$data = $responseChargeBacks->getData();

echo "<pre>" . PHP_EOL;
print_r($data);
echo "</pre>" . PHP_EOL;

} catch (\Ipag\Sdk\Exception\HttpException $e) {
$code = $e->getResponse()->getStatusCode();
$errors = $e->getErrors();

echo "<pre>" . PHP_EOL;
var_dump($code, $errors);
echo "</pre>" . PHP_EOL;
} catch (Exception $e) {
$error = $e->getMessage();

echo "<pre>" . PHP_EOL;
var_dump($error);
echo "</pre>" . PHP_EOL;
}
Loading