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

Commit

Permalink
Add php code example (#45)
Browse files Browse the repository at this point in the history
* Add php code example

* Remove c
  • Loading branch information
svenpopping authored and Sille Kamoen committed Mar 21, 2017
1 parent 0814f4c commit 1b4e174
Showing 1 changed file with 22 additions and 3 deletions.
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

0 comments on commit 1b4e174

Please sign in to comment.