Skip to content

Commit

Permalink
add example checkout to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdrakedennis committed Mar 31, 2023
1 parent 34c3b57 commit 4884c8c
Showing 1 changed file with 58 additions and 6 deletions.
64 changes: 58 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,58 @@
This package is currently for internal use, do not expect support.


```
composer require useshimmer/laravel-tebex-checkout
```
This package is currently for internal use, do not expect support.


```
composer require useshimmer/laravel-tebex-checkout
```


### Create a checkout with sdk:

```PHP
$connector = new TebexCheckout('foo', 'bar');

$request = new CreateCheckoutRequest(
basket: [
'return_url' => 'http://foo.com',
'complete_url' => 'http://bar.com',
'custom' => [
'baz' => 'buzz',
],
],
items: [
[
'package' => [
'name' => 'foobar',
'price' => 12.34,
],
],
]
);

$response = $connector->send($request);
```

### Create a checkout with resource api:

```PHP
$connector = new TebexCheckout('foo', 'bar');

$response = $connector->checkout()->create(
basket: [
'return_url' => 'http://foo.com',
'complete_url' => 'http://bar.com',
'custom' => [
'baz' => 'buzz',
],
],
items: [
[
'package' => [
'name' => 'foobar',
'price' => 12.34,
],
],
]
);

```

0 comments on commit 4884c8c

Please sign in to comment.