imagex / billfixers
Billfixers 库允许您使用 GraphQL 客户端查询 Billfixers API。
v1.0.5-alpha
2022-07-12 19:57 UTC
Requires
This package is auto-updated.
Last update: 2024-09-13 00:52:36 UTC
README
用法
Billfixers 库允许您使用 GraphQL 客户端查询 Billfixers API。
- 联系 Billfixers 团队以获取合作伙伴账户 https://billfixers.com/partnerships
- 使用合作伙伴 ApiKey 实例化一个客户端类。
- 需要创建自己的客户端来与 Billfixers 进行身份验证并运行任何查询,使用客户端类。
- 创建自己的自定义实现以使用此库中的查询。
示例
创建客户
<?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);
}
列出提供商
<?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);
}