1. Go to this page and download the library: Download paystream/sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
paystream / sdk example snippets
use WeMiscPay\Sdk\WeMiscPayClient;
use WeMiscPay\Sdk\Exceptions\ValidationException;
use WeMiscPay\Sdk\Exceptions\ApiException;
$client = new WeMiscPayClient(
apiToken: 'wm_...', // Companies > Edit in the WeMiscPay dashboard
baseUrl: 'https://your-wemisc-pay-instance.test/api/v1/integrations',
);
try {
$checkout = $client->checkout(
amount: 250.00,
successUrl: 'https://your-app.test/orders/123/paid',
failUrl: 'https://your-app.test/orders/123/failed',
reference: 'order-123', // your own id, echoed back later
);
// Send the customer here — WeMiscPay hosts the actual card entry page.
header("Location: {$checkout->checkoutUrl}");
} catch (ValidationException $e) {
// $e->errors() is a field => [messages] map, same shape as Laravel validation errors.
} catch (ApiException $e) {
// e.g. 503 — no payment gateway configured on the WeMiscPay side yet.
// $e->statusCode(), $e->body()
}