- list - List payment services
- create - Configure a payment service
- get - Get payment service
- update - Update a configured payment service
- delete - Delete a configured payment service
- verify - Verify payment service credentials
- session - Create a session for a payment service definition
List the configured payment services.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Gr4vy\ListPaymentServicesRequest(
method: 'card',
cursor: 'ZXhhbXBsZTE',
deleted: true,
);
$responses = $sdk->paymentServices->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
?ListPaymentServicesResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Configures a new payment service for use by merchants.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$paymentServiceCreate = new Gr4vy\PaymentServiceCreate(
displayName: 'Stripe',
paymentServiceDefinitionId: 'stripe-card',
fields: [
new Gr4vy\Field(
key: 'api_key',
value: 'key-12345',
),
],
acceptedCurrencies: [
'USD',
'EUR',
'GBP',
],
acceptedCountries: [
'US',
'DE',
'GB',
],
threeDSecureEnabled: true,
settlementReportingEnabled: true,
);
$response = $sdk->paymentServices->create(
paymentServiceCreate: $paymentServiceCreate
);
if ($response->paymentService !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentServiceCreate |
PaymentServiceCreate |
✔️ |
N/A |
|
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?CreatePaymentServiceResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Get the details of a configured payment service.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->paymentServices->get(
paymentServiceId: 'fffd152a-9532-4087-9a4f-de58754210f0'
);
if ($response->paymentService !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentServiceId |
string |
✔️ |
the ID of the payment service |
fffd152a-9532-4087-9a4f-de58754210f0 |
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?GetPaymentServiceResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Updates the configuration of a payment service.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$paymentServiceUpdate = new Gr4vy\PaymentServiceUpdate(
settlementReportingEnabled: true,
);
$response = $sdk->paymentServices->update(
paymentServiceId: 'fffd152a-9532-4087-9a4f-de58754210f0',
paymentServiceUpdate: $paymentServiceUpdate
);
if ($response->paymentService !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentServiceId |
string |
✔️ |
the ID of the payment service |
fffd152a-9532-4087-9a4f-de58754210f0 |
paymentServiceUpdate |
PaymentServiceUpdate |
✔️ |
N/A |
|
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?UpdatePaymentServiceResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Deletes all the configuration of a payment service.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->paymentServices->delete(
paymentServiceId: 'fffd152a-9532-4087-9a4f-de58754210f0'
);
if ($response->statusCode === 200) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentServiceId |
string |
✔️ |
the ID of the payment service |
fffd152a-9532-4087-9a4f-de58754210f0 |
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?DeletePaymentServiceResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Verify the credentials of a configured payment service
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$verifyCredentials = new Gr4vy\VerifyCredentials(
paymentServiceDefinitionId: 'stripe-card',
fields: [],
);
$response = $sdk->paymentServices->verify(
verifyCredentials: $verifyCredentials
);
if ($response->any !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
verifyCredentials |
VerifyCredentials |
✔️ |
N/A |
|
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?VerifyPaymentServiceCredentialsResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Creates a session for a payment service that supports sessions.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->paymentServices->session(
paymentServiceId: 'fffd152a-9532-4087-9a4f-de58754210f0',
requestBody: [
]
);
if ($response->createSession !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentServiceId |
string |
✔️ |
the ID of the payment service |
fffd152a-9532-4087-9a4f-de58754210f0 |
requestBody |
array<string, mixed> |
✔️ |
N/A |
|
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?CreatePaymentServiceSessionResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |