Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Add php code example #45

Merged
merged 2 commits into from
Mar 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,30 @@ async function main() {

main();
```

(You can copy-paste this snippet into the Dev console of your browser to try it out. It requires Chrome 55+.

#### PHP
[Code example required](https://github.com/WISVCH/payments/issues/6)
#### PHP (you filthy sjaarsCH)
```php
$url = 'http://localhost:9000/api/orders';
$data = [
'name': "Thomas Ticket",
'email': "[email protected]",
'returnUrl': "<return-url>",
'productKeys': ["<product-key>", "<product-key>"]
];

$options = [
'http' => [
'header' => [
"Content-Type:application/json"
],
'method' => "POST",
'content' => json_encode($data)
]
];

$response = json_decode(file_get_contents($url, false, stream_context_create($options)));
```

# HootHub
This project currently is quite minimal, and offers lots of opportunities for great features built by you!
Expand Down