testPaymentGatewayConnection
Requires permission settings:integration:update.
Verifies the stored credentials for one provider by calling it. When the provider rejects them, the error carries the provider's own message. Verified keys are required before the gateway can be enabled.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation TestPaymentGatewayConnection($provider: PaymentGatewayProvider!) {
testPaymentGatewayConnection(provider: $provider) {
keysCheckedAt
keysValid
needsReverification
testPaymentAt
webhookReachable
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation TestPaymentGatewayConnection($provider: PaymentGatewayProvider!) {\n testPaymentGatewayConnection(provider: $provider) {\n keysCheckedAt\n keysValid\n needsReverification\n testPaymentAt\n webhookReachable\n }\n}",
"variables": {
"provider": "PEACH"
}
}
EOF
Variables:
{
"provider": "PEACH"
}
Response:
{
"data": {
"testPaymentGatewayConnection": {
"keysCheckedAt": "string",
"keysValid": true,
"needsReverification": true,
"testPaymentAt": "string",
"webhookReachable": true
}
}
}
testPaymentGatewayConnection(
provider: PaymentGatewayProvider!
): PaymentGatewayVerificationGql!
Arguments
testPaymentGatewayConnection.provider ● PaymentGatewayProvider! non-null enum
The payment provider whose stored credentials to test.
Type
PaymentGatewayVerificationGql object
The result of checking a gateway's credentials, webhook and test payment.