imagex / billfixers
Billfixers library allows you to query Billfixers API using GraphQL client.
v1.0.5-alpha
2022-07-12 19:57 UTC
Requires
This package is auto-updated.
Last update: 2025-03-13 02:03:07 UTC
README
Version [Latest Stable Version]
Usage
Billfixers library allows you to query Billfixers API using GraphQL client.
- Reach Billfixers team so as to have a partner account https://billfixers.com/partnerships
- Use the Partner ApiKey to instantiate a Client class.
- Needs to create your own client to authenticate with Billfixers and run any queries, using Client class.
- Create your own custom implementation to use queries from this library.
Examples
Create Customer
<?php
use BillfixersPartner\Customer;
use BillfixersPartner\Client;
/**
* Create Customer example.
*/
function fooBar() {
// Instantiate the Billfixers client.
$client = new Client($api_key, $api_url);
// Instantiate the Provider class and get the list query.
$customer = new Customer();
$variables = [
'email' => $email,
'firstName' => $first_name,
'lastName' => $last_name,
'phoneNumber' => $phone_number,
];
$variables = ['customer' => $variables];
// Execute the query.
// Parameters available: Query $query, bool $resultsAsArray = FALSE, array $variables = []
$result = $client->runQuery($query, TRUE, $variables);
}
List providers
<?php
use BillfixersPartner\Provider;
use BillfixersPartner\Client;
/**
* List Providers example.
*/
function fooBar() {
// Instantiate the Billfixers client.
$client = new Client($api_key, $api_url);
// Instantiate the Provider class and get the list query.
$provider = new Provider();
$query = $provider->list();
// Execute the query.
// Parameters available: Query $query, bool $resultsAsArray = FALSE, array $variables = []
$result = $client->runQuery($query);
}