Skip to content
Open
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
10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,15 @@
"fakerphp/faker": "^1.23",
"phpunit/phpunit": "^9.6",
"phpunit/php-code-coverage": "^9.2.13"
},
"config": {
"platform": {
"php": "7.4.33"
},
"audit": {
"ignore": {
"PKSA-z3gr-8qht-p93v": "*"
}
}
}
}
105 changes: 54 additions & 51 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions examples/payment_links_v2/00-payment-link-v2-create.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

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

/**
* Criar Payment Link V2 (básico, sem checkout_settings)
*/
$paymentLink = new \Ipag\Sdk\Model\PaymentLinkV2\PaymentLinkV2(
[
'external_code' => 'PL_V2_001',
'amount' => 150.00,
'description' => 'Link de pagamento V2',
'expires_at' => '05/02/2026 13:35:00',
'additional_info' => 'Informações adicionais do link',
'stock_limit' => 100,
]
);

try {

$responsePaymentLink = $ipagClient->paymentLinksV2()->create($paymentLink);
$data = $responsePaymentLink->getData();

$link = $responsePaymentLink->getParsedPath('links.payment');

echo "Link de Pagamento: {$link}" . PHP_EOL;

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