Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sverraest authored Apr 8, 2018
1 parent 0afa38d commit 926155a
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,63 @@ use PomeloPHP\Client;
$client = new Client('apikey', 'appid');
$transactions = $client->transactions->all();
```
#### Get one transaction

```php
use PomeloPHP\Client;

$client = new Client('apikey', 'appid');
$transaction = $client->transactions->get('foo');
```

#### Create transaction

```php
use PomeloPHP\Client;

$client = new Client('apikey', 'appid');

$json = [
"provider" => "POMELO", // Provider enabled for your merchant account such as POMELO, BANCONTACT, ALIPAY, etc...
"currency" => "GBP",
"amount" => 1000, // 10.00 GBP
"redirectUrl" => "https://foo.bar/order/123" // Optional redirect after payment completion
];

$transaction = $client->transactions->create($json);
header('Location: '. $transaction["forwardUrl"]); // Go to transaction payment page
```
### Pagination

The Pomelo Page API offers a flexible pagination structure for GET requests on collections.
The following query filters are possible for pagination.
The default page number is 1.



| Query | Values |
| --------------------------|----------------------------------------------------------------------|
| pagination | 0 or 1 (disabled pagination, is enabled by default) |
| page | 1,2,3,4,... (page of the collection, default is 1) |
| itemsPerPage | 20 (numbers of items per page, default is 20) |

```php
use PomeloPHP\Client;

$client = new Client('apikey', 'appid');

$subSet = $client->transactions->all([
"page" => 3, // We're on page 3
"itemsPerPage" => 5 // We're displaying 5 items per page
]);

$all = $client->transactions->all([
"pagination" => 0 // Don't paginate the results
]);
```

## About

➡️ You can follow me on 🐦 [Twitter](https://www.twitter.com/simondoestech) or ✉️ email me at simon[-at-]appfleet.uk.

⭐ Sign up as a merchant at https://pomelopay.com and start receiving payments in seconds.

0 comments on commit 926155a

Please sign in to comment.