Skip to content

Commit

Permalink
Added links to examples in CheckoutAPI and some other minor updated
Browse files Browse the repository at this point in the history
  • Loading branch information
codedeviate committed Sep 9, 2024
1 parent caca3f6 commit f364afc
Show file tree
Hide file tree
Showing 38 changed files with 236 additions and 5 deletions.
1 change: 1 addition & 0 deletions Writerside/hi.tree
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
<toc-element topic="CheckoutAPI-Example-confirm.md"/>
<toc-element topic="CheckoutAPI-Example-reset.md"/>
<toc-element topic="CheckoutAPI-Example-checkoutStatus.md"/>
<toc-element topic="CheckoutAPI-Example-terms.md"/>
</toc-element>
<toc-element topic="Javascript-events.md">
<toc-element topic="update.md"/>
Expand Down
19 changes: 18 additions & 1 deletion Writerside/topics/Auth-Endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,21 @@

<include from="Snippets-AuthAPI.md" element-id="snippet-header" />

Start typing here...
Here is a collection of the available endpoints for the Auth API.

## bankid

## bankidV6

## login
Login based on username and password

## login/token

## me
Get information about the current user token.

## me/address
Get the physical address of the current user. This requires that the token contains a Swedish personal identity number.

## merchant
2 changes: 1 addition & 1 deletion Writerside/topics/CheckoutAPI-Example-checkoutStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ 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/9-reset.php)
Full example can be found [here](https://github.com/Billmate/qvickly-php-module/blob/main/examples/CheckoutAPI/A-checkoutStatus.php)

<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" />

Expand Down
42 changes: 42 additions & 0 deletions Writerside/topics/CheckoutAPI-Example-terms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# terms

<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;

$checkoutAPI = new CheckoutAPI($_ENV['EID'], $_ENV['SECRET'], true);

echo "Create checkout\n";
$payload = exampleCheckout();
$checkout = $checkoutAPI->initCheckout($payload);

$terms = $checkoutAPI->terms($checkout['hash'], 1000, 8);
echo $terms . "\n";

]]>
</code-block>

Full example can be found [here](https://github.com/Billmate/qvickly-php-module/blob/main/examples/CheckoutAPI/B-terms.php)

<include from="Snippets-PHP-Module.md" element-id="snippet-composer-require" />

</tab>
</tabs>

<include from="Snippets-Examples.md" element-id="snippet-footer"></include>
2 changes: 2 additions & 0 deletions Writerside/topics/RemoveQuickPaymentCard.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-removeQuickPaymentCard.md)

{type="narrow"}
Endpoint
: /public/ajax.php?removeQuickPaymentCard
Expand Down
7 changes: 7 additions & 0 deletions Writerside/topics/address.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

<include from="Snippets-AuthAPI.md" element-id="snippet-header" />

{type="narrow"}
Endpoint
: ```/me/address```

Method
: POST

For an example see [here](Auth-Example-address.md)

Start typing here...
7 changes: 7 additions & 0 deletions Writerside/topics/auth-merchant.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@

<include from="Snippets-AuthAPI.md" element-id="snippet-header" />

{type="narrow"}
Endpoint
: ```/merchant```

Method
: POST

Start typing here...
8 changes: 8 additions & 0 deletions Writerside/topics/bankid.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@

<include from="Snippets-AuthAPI.md" element-id="snippet-header" />

{type="narrow"}
Endpoint
: ```/bankid```

Method
: POST


Start typing here...
7 changes: 7 additions & 0 deletions Writerside/topics/bankidV6.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@

<include from="Snippets-AuthAPI.md" element-id="snippet-header" />

{type="narrow"}
Endpoint
: ```/bankidV6```

Method
: POST

Start typing here...
9 changes: 9 additions & 0 deletions Writerside/topics/bankidclose.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-bankidclose.md)

{type="narrow"}
Endpoint
: /public/ajax.php?bankidclose

Method
: POST

Start typing here...
9 changes: 9 additions & 0 deletions Writerside/topics/bankidopen.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-bankidopen.md)

{type="narrow"}
Endpoint
: /public/ajax.php?bankidopen

Method
: POST

Start typing here...
2 changes: 2 additions & 0 deletions Writerside/topics/cancel.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-cancel.md)

{type="narrow"}
Endpoint
: /public/ajax.php?cancel
Expand Down
9 changes: 9 additions & 0 deletions Writerside/topics/cancelInvoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-cancelInvoice.md)

{type="narrow"}
Endpoint
: /public/ajax.php?cancelInvoice

Method
: POST

Start typing here...
2 changes: 2 additions & 0 deletions Writerside/topics/checkout-getpaymentplans.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-getpaymentplans.md)

{type="narrow"}
Endpoint
: /public/ajax.php?getpaymentplans
Expand Down
4 changes: 3 additions & 1 deletion Writerside/topics/checkoutStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-checkoutStatus.md)

{type="narrow"}
Endpoint
: /public/ajax.php?get
: /public/ajax.php?checkoutStatus

Method
: POST
Expand Down
9 changes: 9 additions & 0 deletions Writerside/topics/clearCheckout.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-clearCheckout.md)

{type="narrow"}
Endpoint
: /public/ajax.php?clearCheckout

Method
: POST

Start typing here...
2 changes: 2 additions & 0 deletions Writerside/topics/confirm.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-confirm.md)

{type="narrow"}
Endpoint
: /public/ajax.php?confirm
Expand Down
2 changes: 2 additions & 0 deletions Writerside/topics/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

Get the current payment data for the order.

An example of how to use this function can be found [here](CheckoutAPI-Example-get.md)

{type="narrow"}
Endpoint
: /public/ajax.php?get
Expand Down
2 changes: 2 additions & 0 deletions Writerside/topics/getCityFromZipcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
> Please note that this function does not do any external lookups which means that it can return an empty string for valid zipcodes.
> {style="warning"}
An example of how to use this function can be found [here](CheckoutAPI-Example-getCityFromZipcode.md)

{type="narrow"}
Endpoint
: /ajax.php?getCityFromZipcode
Expand Down
2 changes: 2 additions & 0 deletions Writerside/topics/getPaymentMethods.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-getPaymentMethods.md)

{type="narrow"}
Endpoint
: /public/ajax.php?getPaymentMethods
Expand Down
2 changes: 2 additions & 0 deletions Writerside/topics/isPaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Check if Checkout order is paid and when paid, return status is_paid with callba
so checkout can simulate a callback to the store
return by echo JSON string.

An example of how to use this function can be found [here](CheckoutAPI-Example-isPaid.md)

{type="narrow"}
Endpoint
: /public/ajax.php?isPaid
Expand Down
2 changes: 2 additions & 0 deletions Writerside/topics/isRedirectedOnSuccess.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-isRedirectedOnSuccess.md)

{type="narrow"}
Endpoint
: /public/ajax.php?isRedirectedOnSuccess
Expand Down
8 changes: 8 additions & 0 deletions Writerside/topics/login.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

<include from="Snippets-AuthAPI.md" element-id="snippet-header" />

{type="narrow"}
Endpoint
: ```/login```

Method
: POST

For an example see [here](Auth-Example-Login.md)


Start typing here...
7 changes: 7 additions & 0 deletions Writerside/topics/me.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

Find the information about the current logged in person from the token.

{type="narrow"}
Endpoint
: ```/me```

Method
: POST

For an example see [here](Auth-Example-me.md)

## Response
Expand Down
2 changes: 2 additions & 0 deletions Writerside/topics/reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

Reset the current session on the server.

An example of how to use this function can be found [here](CheckoutAPI-Example-reset.md)

{type="narrow"}
Endpoint
: ```/{eid}/{hash}/reset```
Expand Down
2 changes: 2 additions & 0 deletions Writerside/topics/step1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-step1.md)

{type="narrow"}
Endpoint
: /ajax.php?step1
Expand Down
25 changes: 24 additions & 1 deletion Writerside/topics/terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,34 @@
> This is an internal function used by the checkout
{style="warning"}

An example of how to use this function can be found [here](CheckoutAPI-Example-terms.md)

{type="narrow"}
Endpoint
: /public/ajax.php?terms

Method
: POST

Start typing here...
## Request

| Property | Type | Required | Description |
|---------------|--------|----------|----------------------------------------------------------------------------------------|
| hash | string | Yes | The hash for the order. |
| amount | cent | No | The amount for the order. |
| method | int | No | The payment method for the order. |
| methodoptions | int | No | The payment method options for the order. FOr part payments this is the paymentplanid. |


## Response

The return from this will either be the html text for the terms and conditions or an error message.

The error message will come in the form of a text string.

If the payment method isn't available for the order then the error message will be:
```html
CODE: <b>7030</b>
<br/>
MESSAGE: <b>Betalmetoden existerar ej, var vänlig kontrollera anropet.</b>
```
7 changes: 7 additions & 0 deletions Writerside/topics/token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@

<include from="Snippets-AuthAPI.md" element-id="snippet-header" />

{type="narrow"}
Endpoint
: ```/login/token```

Method
: POST

Start typing here...
Loading

0 comments on commit f364afc

Please sign in to comment.