-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efb58c2
commit d59b4ce
Showing
17 changed files
with
697 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# confirm | ||
|
||
<include from="Snippets-CheckoutAPI.md" element-id="snippet-header" /> | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
use Qvickly\Api\Checkout\CheckoutAPI; | ||
|
||
use function Qvickly\Api\Payment\Helpers\exampleCheckout; | ||
use Qvickly\Api\Enums\PaymentMethod; | ||
|
||
$checkoutAPI = new CheckoutAPI($_ENV['EID'], $_ENV['SECRET'], true); | ||
|
||
echo "Create checkout\n"; | ||
$payload = exampleCheckout(); | ||
$checkout = $checkoutAPI->initCheckout($payload); | ||
|
||
echo "Step 1\n"; | ||
$personalInfo = $checkoutAPI->step1($checkout['hash'], [ | ||
'pno' => $_ENV['PNO'], | ||
'email' => $_ENV['EMAIL'], | ||
'type' => 'person', | ||
'zip' => $_ENV['ZIP'], | ||
'phonenumber' => $_ENV['PHONENUMBER'], | ||
]); | ||
|
||
echo "Payment plans\n"; | ||
$paymentplans = $checkoutAPI->getpaymentplans($checkout['hash']); | ||
|
||
echo "Payment methods\n"; | ||
$paymentMethods = $checkoutAPI->getPaymentMethods($checkout['hash']); | ||
|
||
echo "Update payment method\n"; | ||
$paymentMethod = $checkoutAPI->updatePaymentMethod($checkout['hash'], PaymentMethod::CARD->value); | ||
|
||
echo "Get payment\n"; | ||
$get = $checkoutAPI->get($checkout['hash']); | ||
|
||
echo "Confirm payment\n"; | ||
$confirm = $checkoutAPI->confirm($checkout['hash'], $get); | ||
|
||
echo json_encode($confirm, JSON_PRETTY_PRINT) . "\n"; | ||
|
||
echo "URL to use: " . $confirm['url'] . "\n"; | ||
]]> | ||
</code-block> | ||
|
||
Full example can be found [here](https://github.com/Billmate/qvickly-php-module/blob/main/examples/CheckoutAPI/8-confirm.php) | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
</tabs> | ||
|
||
<include from="Snippets-Examples.md" element-id="snippet-footer"></include> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# get | ||
|
||
<include from="Snippets-CheckoutAPI.md" element-id="snippet-header" /> | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
use Qvickly\Api\Checkout\CheckoutAPI; | ||
|
||
use function Qvickly\Api\Payment\Helpers\exampleCheckout; | ||
use Qvickly\Api\Enums\PaymentMethod; | ||
|
||
$checkoutAPI = new CheckoutAPI($_ENV['EID'], $_ENV['SECRET'], true); | ||
|
||
echo "Create checkout\n"; | ||
$payload = exampleCheckout(); | ||
$checkout = $checkoutAPI->initCheckout($payload); | ||
|
||
echo "Step 1\n"; | ||
$personalInfo = $checkoutAPI->step1($checkout['hash'], [ | ||
'pno' => $_ENV['PNO'], | ||
'email' => $_ENV['EMAIL'], | ||
'type' => 'person', | ||
'zip' => $_ENV['ZIP'], | ||
'phonenumber' => $_ENV['PHONENUMBER'], | ||
]); | ||
|
||
echo "Payment plans\n"; | ||
$paymentplans = $checkoutAPI->getpaymentplans($checkout['hash']); | ||
|
||
echo "Payment methods\n"; | ||
$paymentMethods = $checkoutAPI->getPaymentMethods($checkout['hash']); | ||
|
||
echo "Update payment method\n"; | ||
$paymentMethod = $checkoutAPI->updatePaymentMethod($checkout['hash'], PaymentMethod::CARD->value); | ||
|
||
echo "Get payment\n"; | ||
$get = $checkoutAPI->get($checkout['hash']); | ||
echo json_encode($get, JSON_PRETTY_PRINT) . "\n"; | ||
|
||
echo "URL to use: " . $paymentMethod['url'] . "\n"; | ||
]]> | ||
</code-block> | ||
|
||
Full example can be found [here](https://github.com/Billmate/qvickly-php-module/blob/main/examples/CheckoutAPI/6-get.php) | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
</tabs> | ||
|
||
<include from="Snippets-Examples.md" element-id="snippet-footer"></include> |
58 changes: 58 additions & 0 deletions
58
Writerside/topics/CheckoutAPI-Example-getPaymentMethods.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# getPaymentMethods | ||
|
||
<include from="Snippets-CheckoutAPI.md" element-id="snippet-header" /> | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
use Qvickly\Api\Checkout\CheckoutAPI; | ||
|
||
use function Qvickly\Api\Payment\Helpers\exampleCheckout; | ||
use Qvickly\Api\Enums\PaymentMethod; | ||
|
||
$checkoutAPI = new CheckoutAPI($_ENV['EID'], $_ENV['SECRET'], true); | ||
|
||
echo "Create checkout\n"; | ||
$payload = exampleCheckout(); | ||
$checkout = $checkoutAPI->initCheckout($payload); | ||
|
||
echo "Step 1\n"; | ||
$personalInfo = $checkoutAPI->step1($checkout['hash'], [ | ||
'pno' => $_ENV['PNO'], | ||
'email' => $_ENV['EMAIL'], | ||
'type' => 'person', | ||
'zip' => $_ENV['ZIP'], | ||
'phonenumber' => $_ENV['PHONENUMBER'], | ||
]); | ||
|
||
echo "Payment plans\n"; | ||
$paymentplans = $checkoutAPI->getpaymentplans($checkout['hash']); | ||
|
||
echo "Payment methods\n"; | ||
$paymentMethods = $checkoutAPI->getPaymentMethods($checkout['hash']); | ||
|
||
echo json_encode($paymentMethods, JSON_PRETTY_PRINT) . "\n"; | ||
|
||
echo "URL to use: " . $checkout['url'] . "\n"; | ||
]]> | ||
</code-block> | ||
|
||
Full example can be found [here](https://github.com/Billmate/qvickly-php-module/blob/main/examples/CheckoutAPI/4-getPaymentMethods.php) | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
</tabs> | ||
|
||
<include from="Snippets-Examples.md" element-id="snippet-footer"></include> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# getpaymentplans | ||
|
||
<include from="Snippets-CheckoutAPI.md" element-id="snippet-header" /> | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
use Qvickly\Api\Checkout\CheckoutAPI; | ||
|
||
use function Qvickly\Api\Payment\Helpers\exampleCheckout; | ||
use Qvickly\Api\Enums\PaymentMethod; | ||
|
||
$checkoutAPI = new CheckoutAPI($_ENV['EID'], $_ENV['SECRET'], true); | ||
|
||
echo "Create checkout\n"; | ||
$payload = exampleCheckout(); | ||
$checkout = $checkoutAPI->initCheckout($payload); | ||
|
||
echo "Step 1\n"; | ||
$personalInfo = $checkoutAPI->step1($checkout['hash'], [ | ||
'pno' => $_ENV['PNO'], | ||
'email' => $_ENV['EMAIL'], | ||
'type' => 'person', | ||
'zip' => $_ENV['ZIP'], | ||
'phonenumber' => $_ENV['PHONENUMBER'], | ||
]); | ||
|
||
echo "Payment plans\n"; | ||
$paymentplans = $checkoutAPI->getpaymentplans($checkout['hash']); | ||
|
||
echo json_encode($paymentplans, JSON_PRETTY_PRINT) . "\n"; | ||
|
||
echo "URL to use: " . $checkout['url'] . "\n"; | ||
]]> | ||
</code-block> | ||
|
||
Full example can be found [here](https://github.com/Billmate/qvickly-php-module/blob/main/examples/CheckoutAPI/3-getpaymentplans.php) | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
</tabs> | ||
|
||
<include from="Snippets-Examples.md" element-id="snippet-footer"></include> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# setPaymentMethod | ||
|
||
<include from="Snippets-CheckoutAPI.md" element-id="snippet-header" /> | ||
|
||
<tabs> | ||
<tab title="%code-php%"> | ||
<code-block lang="php"> | ||
<![CDATA[ | ||
<?php | ||
declare(strict_types=1); | ||
require __DIR__ . '/../../vendor/autoload.php'; | ||
use Dotenv\Dotenv; | ||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..'); | ||
$dotenv->load(); | ||
|
||
use Qvickly\Api\Checkout\CheckoutAPI; | ||
|
||
use function Qvickly\Api\Payment\Helpers\exampleCheckout; | ||
use Qvickly\Api\Enums\PaymentMethod; | ||
|
||
$checkoutAPI = new CheckoutAPI($_ENV['EID'], $_ENV['SECRET'], true); | ||
|
||
echo "Create checkout\n"; | ||
$payload = exampleCheckout(); | ||
$checkout = $checkoutAPI->initCheckout($payload); | ||
|
||
echo "Step 1\n"; | ||
$personalInfo = $checkoutAPI->step1($checkout['hash'], [ | ||
'pno' => $_ENV['PNO'], | ||
'email' => $_ENV['EMAIL'], | ||
'type' => 'person', | ||
'zip' => $_ENV['ZIP'], | ||
'phonenumber' => $_ENV['PHONENUMBER'], | ||
]); | ||
|
||
echo "Payment plans\n"; | ||
$paymentplans = $checkoutAPI->getpaymentplans($checkout['hash']); | ||
|
||
echo "Payment methods\n"; | ||
$paymentMethods = $checkoutAPI->getPaymentMethods($checkout['hash']); | ||
|
||
echo "Update payment method\n"; | ||
$paymentMethod = $checkoutAPI->updatePaymentMethod($checkout['hash'], PaymentMethod::CARD->value); | ||
|
||
echo json_encode($paymentMethod, JSON_PRETTY_PRINT) . "\n"; | ||
|
||
echo "URL to use: " . $paymentMethod['url'] . "\n"; | ||
]]> | ||
</code-block> | ||
|
||
Full example can be found [here](https://github.com/Billmate/qvickly-php-module/blob/main/examples/CheckoutAPI/5-setPaymentMethod.php) | ||
|
||
<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" /> | ||
|
||
</tab> | ||
</tabs> | ||
|
||
<include from="Snippets-Examples.md" element-id="snippet-footer"></include> |
Oops, something went wrong.