Skip to content

Latest commit

 

History

History
404 lines (296 loc) · 13.5 KB

PaymentsApi.md

File metadata and controls

404 lines (296 loc) · 13.5 KB

BillaBear\PaymentsApi

All URIs are relative to https://{customerId}.billabear.cloud/api/v1

Method HTTP request Description
chargeInvoice POST /invoice/{invoiceId}/charge Charge Invoice
downloadInvoice GET /invoice/{invoiceId}/download Download Invoice
downloadReceipt GET /receipt/{receiptId}/download Download Receipt
getInvoicesForCustomer GET /customer/{customerId}/invoices List Customer Invoices
getPaymentsForCustomer GET /customer/{customerId}/payment List Customer Payments
listPayment GET /payment List
refundPayment POST /payment/{paymentId}/refund Refund Payment

chargeInvoice

\BillaBear\Model\InlineResponse20012 chargeInvoice($invoice_id)

Charge Invoice

Attempts to charge a card that is on file for the invoice amount

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

$apiInstance = new BillaBear\Api\PaymentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$invoice_id = "invoice_id_example"; // string | The id of the invoice

try {
    $result = $apiInstance->chargeInvoice($invoice_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->chargeInvoice: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
invoice_id string The id of the invoice

Return type

\BillaBear\Model\InlineResponse20012

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

downloadInvoice

string downloadInvoice($invoice_id)

Download Invoice

Returns the pdf blob for the invoice

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

$apiInstance = new BillaBear\Api\PaymentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$invoice_id = "invoice_id_example"; // string | The id of the invoice

try {
    $result = $apiInstance->downloadInvoice($invoice_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->downloadInvoice: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
invoice_id string The id of the invoice

Return type

string

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/pdf

[Back to top] [Back to API list] [Back to Model list] [Back to README]

downloadReceipt

string downloadReceipt($receipt)

Download Receipt

Returns the pdf blob for the Receipt

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

$apiInstance = new BillaBear\Api\PaymentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$receipt = "receipt_example"; // string | The id of the receipt

try {
    $result = $apiInstance->downloadReceipt($receipt);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->downloadReceipt: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
receipt string The id of the receipt

Return type

string

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/pdf

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getInvoicesForCustomer

\BillaBear\Model\InlineResponse2004 getInvoicesForCustomer($customer_id)

List Customer Invoices

List Customer Invoices

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

$apiInstance = new BillaBear\Api\PaymentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve

try {
    $result = $apiInstance->getInvoicesForCustomer($customer_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->getInvoicesForCustomer: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
customer_id string The id of the customer to retrieve

Return type

\BillaBear\Model\InlineResponse2004

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPaymentsForCustomer

\BillaBear\Model\InlineResponse2003 getPaymentsForCustomer($customer_id, $limit, $last_key, $name)

List Customer Payments

List Customer Payment

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

$apiInstance = new BillaBear\Api\PaymentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve
$limit = 56; // int | How many items to return at one time (max 100)
$last_key = "last_key_example"; // string | The key to be used in pagination to say what the last key of the previous page was
$name = "name_example"; // string | The name to search for

try {
    $result = $apiInstance->getPaymentsForCustomer($customer_id, $limit, $last_key, $name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->getPaymentsForCustomer: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
customer_id string The id of the customer to retrieve
limit int How many items to return at one time (max 100) [optional]
last_key string The key to be used in pagination to say what the last key of the previous page was [optional]
name string The name to search for [optional]

Return type

\BillaBear\Model\InlineResponse2003

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listPayment

\BillaBear\Model\InlineResponse2007 listPayment($limit, $last_key, $name)

List

List all payment

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

$apiInstance = new BillaBear\Api\PaymentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$limit = 56; // int | How many items to return at one time (max 100)
$last_key = "last_key_example"; // string | The key to be used in pagination to say what the last key of the previous page was
$name = "name_example"; // string | The name to search for

try {
    $result = $apiInstance->listPayment($limit, $last_key, $name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->listPayment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
limit int How many items to return at one time (max 100) [optional]
last_key string The key to be used in pagination to say what the last key of the previous page was [optional]
name string The name to search for [optional]

Return type

\BillaBear\Model\InlineResponse2007

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

refundPayment

string refundPayment($body, $payment_id)

Refund Payment

Issue a refund for payment

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');

$apiInstance = new BillaBear\Api\PaymentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \BillaBear\Model\IssueRefundPayment(); // \BillaBear\Model\IssueRefundPayment | 
$payment_id = "payment_id_example"; // string | The id of the payment

try {
    $result = $apiInstance->refundPayment($body, $payment_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentsApi->refundPayment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \BillaBear\Model\IssueRefundPayment
payment_id string The id of the payment

Return type

string

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]