Skip to content

Commit 1458d72

Browse files
Update documentation
1 parent 9182d9b commit 1458d72

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ $merchant_api->payment_requests->getPaymentLink($payment_request_id);
6868
$merchant_api->payment_requests->getDynamicLink($payment_request_id);
6969
```
7070

71-
72-
73-
74-
75-
76-
7771
### Webhooks / Callbacks
7872
In order to validate callback requests from Settle, both Apache and nginx servers require manual setup to pass the `Authorization` header to PHP.
7973

@@ -94,5 +88,19 @@ Two methods on the `SettleApiClient` class can be used in relation to the callba
9488

9589
```php
9690
// the following will return
97-
$settle_client->isValidCallback($callbackUrl, $body, $headers, $method);
98-
```
91+
$is_valid = $settle_client->isValidCallback($callbackUrl, $body, $headers, $method);
92+
93+
// the following method will grab the data Settle sent in the current request
94+
$settle_data = $settle_client->getCallbackData();
95+
```
96+
97+
### Dynamic links
98+
Payment requests have a helper method for creating dynamic links but this is only a subset of all the cases when one might need a dynamic link.
99+
The main method for creating dynamic links can be found in the `SettleApiClient` class:
100+
101+
```php
102+
$dynamic_link = $settle_client->createDynamicLink([
103+
'shortLink' => 'https://settle.eu/s/gSpEb/pos123/'
104+
]);
105+
```
106+
For more options refer to the [documentation](https://support.settle.eu/hc/en-150/articles/4412216178705-Settle-Dynamic-Links)

src/SettleApiClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function createLink($template, array $data = [], array $extraData = [])
273273
return $link;
274274
}
275275

276-
protected function createDynamicLink($data)
276+
public function createDynamicLink($data)
277277
{
278278
$data['environment'] = $this->getIsSandbox() ? 'sandbox' : 'production';
279279

0 commit comments

Comments
 (0)