Store customer details.
- accountDeleteCustomerCustomerIdPaymentMethodToken - Delete Payment Method Associated with Customer by Token for a given Account
- accountDeleteCustomerId - Delete Customer by ID for a given Account
- accountGetCustomer - Query customers for a given Account (Partner context)
- accountGetCustomerId - Get Customer by ID for a given Account
- accountGetCustomerCustomerIdPaymentMethodToken - Get Payment Method Associated with Customer by Token for a given Account
- accountGetCustomerCustomerIdPayments - Get Customer Payments for a given Account
- accountGetCustomerDefaultPaymentMethod - Get Default Payment Method Associated to a Customer for a given Account
- accountGetCustomerIdPaymentMethod - Query Payment Methods for Customer for a given Account
- accountGetCustomerTokenPaymentMethod - Query Payment Methods for Customer by customer token for a given Account
- accountPostCustomer - Create Customer for a given Account
- accountPostCustomerIdPaymentMethod - Attach Payment Method for a Customer (Partner context)
- accountPutCustomerId - Update Customer by ID for a given Account
- deleteCustomerCustomerIdPaymentMethodToken - Delete Payment Method Associated with Customer by Token
- deleteCustomerId - Delete Customer by ID
- getCustomer - Query customers for a given Account (Sub-merchant context)
- getCustomerId - Get Customer by ID
- getCustomerCustomerIdPaymentMethodToken - Get Payment Method Associated with Customer by Token
- getCustomerCustomerIdPayments - Get Customer Payments
- getCustomerIdPaymentMethod - Query Payment Methods for Customer
- getCustomerTokenPaymentMethod - Query Payment Methods for Customer by customer token
- postCustomer - Create Customer
- postCustomerIdPaymentMethod - Attach Payment Method for a Customer (Sub-merchant context)
- putCustomerId - Update Customer by ID
In order to unlink a payment method from a customer, the following call can be made.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountDeleteCustomerCustomerIdPaymentMethodTokenRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';
$request->tokenId = '<value>';;
$response = $sdk->customers->accountDeleteCustomerCustomerIdPaymentMethodToken($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountDeleteCustomerCustomerIdPaymentMethodTokenRequest | ✔️ | The request object to use for the request. |
On occasion it is necessary for an API consumer to delete customers. The following call supports this use case.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountDeleteCustomerIdRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';;
$response = $sdk->customers->accountDeleteCustomerId($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountDeleteCustomerIdRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountDeleteCustomerIdResponse
This API returns the list of customers under a given merchant. It is meant to be invoked by a Organization(partner) to fetch the list of all customers for a given merchant(accountId) in the request URI. Please note that the Organization(partner) needs to authenticate using the partner or org token.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountGetCustomerRequest();
$request->accountId = '<value>';
$request->dollarLimit = 5056.72;
$request->dollarSkip = 6564.29;
$request->dollarSort = '-name';;
$response = $sdk->customers->accountGetCustomer($request);
if ($response->object !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerResponse
For fetching singular customer objects API consumers can issue a call to the following endpoint. If the id provided in the path exists it will be returned in the response body. It is meant to be invoked by a Organization(partner) for a given merchant(accountId) in the request URI. Please note that the Organization(partner) needs to authenticate using the partner or org token.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountGetCustomerIdRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';;
$response = $sdk->customers->accountGetCustomerId($request);
if ($response->customer !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerIdRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerIdResponse
To retrieve a payment method as well as ensure it is associated with a customer. The following call can be used. It is meant to be invoked by a Organization(partner) for a given merchant(accountId) in the request URI. Please note that the Organization(partner) needs to authenticate using the partner or org token.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountGetCustomerCustomerIdPaymentMethodTokenRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';
$request->tokenId = '<value>';;
$response = $sdk->customers->accountGetCustomerCustomerIdPaymentMethodToken($request);
if ($response->paymentMethod !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerCustomerIdPaymentMethodTokenRequest | ✔️ | The request object to use for the request. |
In order to fetch payments performed by a customer, the following endpoint can be called. It is meant to be invoked by a Organization(partner) for a given merchant(accountId) in the request URI. Please note that the Organization(partner) needs to authenticate using the partner or org token.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountGetCustomerCustomerIdPaymentsRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';
$request->dollarSort = '-name';
$request->dollarLimit = 10;
$request->dollarSkip = 10;;
$response = $sdk->customers->accountGetCustomerCustomerIdPayments($request);
if ($response->payments !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerCustomerIdPaymentsRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerCustomerIdPaymentsResponse
You can associate multiple Payment Methods to a single Customer; however, only one of those can be used as default. This endpoint will allow you to retrieve the Payment Method marked as default for the specified Customer. It is meant to be invoked by an Organization (Partner) for a given merchant (accountId
) in the request URI. Please note that the Organization (Partner) needs to authenticate using the Partner or Organization token.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountGetCustomerDefaultPaymentMethodRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';;
$response = $sdk->customers->accountGetCustomerDefaultPaymentMethod($request);
if ($response->anies !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerDefaultPaymentMethodRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerDefaultPaymentMethodResponse
To query payment methods associated with a customer the following call can be used. Note that because card information is encrypted, query string filtering is not supported. That said $limit and $skip can still be used for pagination. It is meant to be invoked by a Organization(partner) for a given merchant(accountId) in the request URI. Please note that the Organization(partner) needs to authenticate using the partner or org token.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountGetCustomerIdPaymentMethodRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';;
$response = $sdk->customers->accountGetCustomerIdPaymentMethod($request);
if ($response->anies !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerIdPaymentMethodRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerIdPaymentMethodResponse
This route takes the customer token instead of an id to enable users to list payment methods associated with a customer when they do not have the customer's id. Please note that there is no need to provide the (accountId) in the request URI, since the merchant needs to provide the account token to limit the scope for their own account
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountGetCustomerTokenPaymentMethodRequest();
$request->accountId = '<value>';
$request->customerToken = '<value>';;
$response = $sdk->customers->accountGetCustomerTokenPaymentMethod($request);
if ($response->anies !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerTokenPaymentMethodRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountGetCustomerTokenPaymentMethodResponse
In order to create a customer API consumers can issue a call to the following endpoint. Note that as mentioned at the start of the document, an account id can be provided in the path.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountPostCustomerRequest();
$request->accountId = '<value>';
$request->newCustomer = new Shared\NewCustomer();
$request->newCustomer->addresses = [
new Shared\NewCustomerAddresses(),
];
$request->newCustomer->email = 'Tobin56@hotmail.com';
$request->newCustomer->name = '<value>';
$request->newCustomer->phone = '568-455-3660 x283';;
$response = $sdk->customers->accountPostCustomer($request);
if ($response->object !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountPostCustomerRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountPostCustomerResponse
This API associates a payment method with a customer. It is meant to be invoked by a partner to associate the payment method for specific customer under a specific sub-merchant as identified by the {customer Id} and {accountId) parameters in the request URI. Please note that the partner needs to authenticate using the partner or org token when making this API call. Please note that the payment method is represented by a token returned earlier as a response to the POST method of the resource endpoint: /account/{accountId}/payment-method
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountPostCustomerIdPaymentMethodRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';
$request->requestBody = new Operations\AccountPostCustomerIdPaymentMethodRequestBody();
$request->requestBody->isDefault = false;
$request->requestBody->label = '<value>';
$request->requestBody->token = '<value>';;
$response = $sdk->customers->accountPostCustomerIdPaymentMethod($request);
if ($response->paymentMethod !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountPostCustomerIdPaymentMethodRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountPostCustomerIdPaymentMethodResponse
It is necessary for API consumers to update customer details from time to time. This can be achieved with the following call. Note that the body can contain a subset of MongoDB update operators for more fine grain control. See https://www.mongodb.com/docs/manual/reference/operator/update/ for reference.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\AccountPutCustomerIdRequest();
$request->accountId = '<value>';
$request->customerId = '<value>';
$request->newCustomer = new Shared\NewCustomer();
$request->newCustomer->addresses = [
new Shared\NewCustomerAddresses(),
];
$request->newCustomer->email = 'Rashad26@hotmail.com';
$request->newCustomer->name = '<value>';
$request->newCustomer->phone = '1-551-733-0450 x71687';;
$response = $sdk->customers->accountPutCustomerId($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\AccountPutCustomerIdRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\AccountPutCustomerIdResponse
In order to unlink a payment method from a customer, the following call can be made.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\DeleteCustomerCustomerIdPaymentMethodTokenRequest();
$request->customerId = '<value>';
$request->tokenId = '<value>';;
$response = $sdk->customers->deleteCustomerCustomerIdPaymentMethodToken($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\DeleteCustomerCustomerIdPaymentMethodTokenRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\DeleteCustomerCustomerIdPaymentMethodTokenResponse
On occasion it is necessary for an API consumer to delete customers. The following call supports this use case.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\DeleteCustomerIdRequest();
$request->customerId = '<value>';;
$response = $sdk->customers->deleteCustomerId($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\DeleteCustomerIdRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\DeleteCustomerIdResponse
This API returns the list of customers for a given merchant. It is meant to be invoked by a merchant to fetch the list of their own customers. Please note that there is no need to provide the (accountId) in the request URI, since the merchant needs to provide the account token to limit the scope for their own account
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\GetCustomerRequest();
$request->dollarLimit = 1259.75;
$request->dollarSkip = 6289.72;
$request->dollarSort = '-name';;
$response = $sdk->customers->getCustomer($request);
if ($response->object !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerResponse
For fetching singular customer objects API consumers can issue a call to the following endpoint. If the id provided in the path exists it will be returned in the response body. Please note that there is no need to provide the (accountId) in the request URI, since the merchant needs to provide the account token to limit the scope for their own account
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\GetCustomerIdRequest();
$request->customerId = '<value>';;
$response = $sdk->customers->getCustomerId($request);
if ($response->customer !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerIdRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerIdResponse
To retrieve a payment method as well as ensure it is associated with a customer. The following call can be used. Please note that there is no need to provide the (accountId) in the request URI, since the merchant needs to provide the account token to limit the scope for their own account
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\GetCustomerCustomerIdPaymentMethodTokenRequest();
$request->customerId = '<value>';
$request->tokenId = '<value>';;
$response = $sdk->customers->getCustomerCustomerIdPaymentMethodToken($request);
if ($response->paymentMethod !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerCustomerIdPaymentMethodTokenRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerCustomerIdPaymentMethodTokenResponse
In order to fetch payments performed by a customer, the following endpoint can be called. Please note that there is no need to provide the (accountId) in the request URI, since the merchant needs to provide the account token to limit the scope for their own account
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\GetCustomerCustomerIdPaymentsRequest();
$request->customerId = '<value>';
$request->dollarSort = '-name';
$request->dollarLimit = 10;
$request->dollarSkip = 10;;
$response = $sdk->customers->getCustomerCustomerIdPayments($request);
if ($response->payments !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerCustomerIdPaymentsRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerCustomerIdPaymentsResponse
To query payment methods associated with a customer the following call can be used. Note that because card information is encrypted, query string filtering is not supported. That said $limit and $skip can still be used for pagination.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\GetCustomerIdPaymentMethodRequest();
$request->customerId = '<value>';;
$response = $sdk->customers->getCustomerIdPaymentMethod($request);
if ($response->anies !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerIdPaymentMethodRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerIdPaymentMethodResponse
This route takes the customer token instead of an id to enable users to list payment methods associated with a customer when they do not have the customer's id.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\GetCustomerTokenPaymentMethodRequest();
$request->customerToken = '<value>';
$request->dollarLimit = '<value>';
$request->dollarSkip = '<value>';;
$response = $sdk->customers->getCustomerTokenPaymentMethod($request);
if ($response->paymentMethods !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerTokenPaymentMethodRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\GetCustomerTokenPaymentMethodResponse
In order to create a customer API consumers can issue a call to the following endpoint. Note that as mentioned at the start of the document, an account id can be provided in the path.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Shared\NewCustomer();
$request->addresses = [
new Shared\NewCustomerAddresses(),
];
$request->email = 'Polly.Hamill94@gmail.com';
$request->name = '<value>';
$request->phone = '712-889-4633';;
$response = $sdk->customers->postCustomer($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Shared\NewCustomer | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\PostCustomerResponse
This API associates a payment method with a customer. It is meant to be invoked by a sub-merchant to associate the payment method for a specific customer as identified by the {customer Id} parameter in the request URI. Please note that the sub-merchant needs to provide the account authentication token when making this API call. Please note that the payment method in the request is represented by a token returned earlier as a response to the POST method of the resource endpoint: /payment-method
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\PostCustomerIdPaymentMethodRequest();
$request->customerId = '<value>';
$request->requestBody = new Operations\PostCustomerIdPaymentMethodRequestBody();
$request->requestBody->isDefault = false;
$request->requestBody->label = '<value>';
$request->requestBody->token = '<value>';;
$response = $sdk->customers->postCustomerIdPaymentMethod($request);
if ($response->paymentMethod !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\PostCustomerIdPaymentMethodRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\PostCustomerIdPaymentMethodResponse
It is necessary for API consumers to update customer details from time to time. This can be achieved with the following call. Note that the body can contain a subset of MongoDB update operators for more fine grain control. See https://www.mongodb.com/docs/manual/reference/operator/update/ for reference.
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use \TheLogicStudio\ExactPayments;
use \TheLogicStudio\ExactPayments\Models\Shared;
use \TheLogicStudio\ExactPayments\Models\Operations;
$security = new Shared\Security();
$security->apiKey = '<YOUR_API_KEY_HERE>';
$sdk = ExactPayments\ExactPayments::builder()->setSecurity($security)->build();
try {
$request = new Operations\PutCustomerIdRequest();
$request->customerId = '<value>';
$request->newCustomer = new Shared\NewCustomer();
$request->newCustomer->addresses = [
new Shared\NewCustomerAddresses(),
];
$request->newCustomer->email = 'Major43@hotmail.com';
$request->newCustomer->name = '<value>';
$request->newCustomer->phone = '(828) 567-3843 x897';;
$response = $sdk->customers->putCustomerId($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
\TheLogicStudio\ExactPayments\Models\Operations\PutCustomerIdRequest | ✔️ | The request object to use for the request. |
?\TheLogicStudio\ExactPayments\Models\Operations\PutCustomerIdResponse