Ready plugin guide
Custom PHP and Laravel Integration
Connect Custom PHP / Laravel to NeroPay using server-side API calls and webhooks.
Custom PHP / LaravelCheckoutWebhooks
Recommended Custom PHP / Laravel flow
- Create or open the Custom PHP / Laravel order/invoice.
- Send a NeroPay API request from the server side.
- Store the returned NeroPay id on the Custom PHP / Laravel order/invoice record.
- Redirect the customer or display the payment link.
- Receive webhook confirmation and update the order/invoice status.
POST
/payment-intentsCreate the NeroPay payment for a Custom PHP / Laravel order or invoice.
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | Unique order or invoice reference from Custom PHP / Laravel. |
amount | decimal | Yes | Order total in major currency units. |
currency | string | Yes | Currency code from the order. |
details | string | Yes | Order or invoice description. |
success_url | url string | Yes | Return URL after success. |
cancel_url | url string | Yes | Return URL after cancellation. |
ipn_url | url string | Yes | Webhook URL handled by the plugin. |
metadata | object | Optional | Short references such as order id, invoice id or customer id. |
'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $secretKey,
'Accept: application/json',
'Content-Type: application/json',
'X-NeroPay-Timestamp: ' . $timestamp,
'X-NeroPay-Signature: ' . $signature,
'Idempotency-Key: ' . bin2hex(random_bytes(16)),
],
CURLOPT_POSTFIELDS => $rawBody,
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $response;
{
"success": true,
"data": {
"id": "pay_nero_123",
"identifier": "CUSTOM_PHP_/_LARAVEL-1001",
"status": "pending",
"checkout_url": "https://eu.neropay.app/checkout/..."
}
}
Webhook update
When transaction.succeeded is received, verify the event, retrieve the transaction if needed and mark the Custom PHP / Laravel order as paid.
transaction.succeeded => paid
transaction.cancelled => cancelled
transaction.failed => failed
refund.succeeded => refunded
Laravel controller example
$request->amount,
'currency' => 'GBP',
'description' => 'Order #' . $request->order_id,
'reference' => 'ORDER-' . $request->order_id,
];
$timestamp = time();
$rawBody = json_encode($payload, JSON_UNESCAPED_SLASHES);
$secret = config('services.neropay.secret_key');
$response = Http::withHeaders([
'Authorization' => 'Bearer ' . $secret,
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'X-NeroPay-Timestamp' => $timestamp,
'X-NeroPay-Signature' => hash_hmac('sha256', $timestamp . '.' . $rawBody, $secret),
'Idempotency-Key' => (string) str()->uuid(),
])->withBody($rawBody, 'application/json')
->post('https://eu.neropay.app/v2/payment-intents');
return $response->json();
}