Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'vendor/autoload.php';
- /**
- * This code shows how to use the voucher api
- * - clientId can be passed in request body to assiciate the voucher with the given client or it will be associated with a walk in customer
- * - serialNumber is optional, if passed the voucher will get that serial number, if not one will be autogenerated
- **/
- $username = 'cloud@rachelbangura.com'; // Contact Phorest support for username
- $password = 'WV&FCoA0J!07kOd'; // Contact Phorest support for password
- $businessId = 'HwuWoFmNI82cyW2LSrDrVQ'; // Contact Phorest support for business id
- $apiUrl = 'api-gateway-staging.phorest.com/third-party-api-server/'; // Contact Phorest support for url
- $uri = 'http://' . $apiUrl . '/third-party-api-server/api/business/' . $businessId . '/voucher';
- $response = \Httpful\Request::post($uri)
- ->authenticateWith($username, $password)->
- sendsJson()->body('{
- "creatingBranchId": "SE-J0emUgQnya14mOGdQSw",
- "expiryDate": "2017-07-11T08:27:23.993Z",
- "id": "ab-123",
- "issueDate": "2017-07-11T08:27:23.993Z",
- "originalBalance": 123.12
- }')->send();
- echo(json_encode($response->body));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement