· 6 years ago · Feb 25, 2020, 06:50 AM
1<?php
2
3require 'vendor/autoload.php';
4
5$api_key = '<sandbox api key>';
6
7use GuzzleHttp\Client;
8
9$client = new Client();
10
11$array = [
12 'name' => "Email sendiri",
13 'email' => 'email@sendiri.com',
14 'phone' => '0141234567',
15 'callback_url' => 'https://google.com',
16];
17
18$response = $client->request('POST', 'https://www.billplz-sandbox.com/api/v4/cards', [
19 'auth' => [$api_key,''],
20 'verify' => false,
21 'form_params' => $array
22]);
23
24$contents = $response->getBody()->getContents();
25$data = json_decode($contents, true);
26
27echo print_r($data, true);