Contents
On this page
Test Payment Gateway - Plugixa Stream
POST /plugixa-stream/v1/admin/payments/{gateway}/test
Make one harmless call to the gateway with the saved credentials: Stripe lists one checkout session, PayPal asks for an access token.
Needs a user with the plugixa_stream_manage_settings capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it.
Request
POST https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/stripe/test
Path parameters
| Name | Type | Description |
|---|---|---|
gateway |
string |
stripe or paypal |
Responses
200 OK. The gateway accepted the credentials.
{
"success": true,
"data": {
"ok": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.ok |
boolean |
true |
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_stream_forbidden |
The caller lacks the capability. |
422 |
plugixa_stream_gateway |
No credentials are saved for that gateway. |
502 |
plugixa_stream_stripe |
Stripe refused; message is Stripe’s. plugixa_stream_paypal for PayPal. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/stripe/test" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/stripe/test');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/payments/stripe/test', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share