PHP code example of unquam / ing-web-pay-sdk

1. Go to this page and download the library: Download unquam/ing-web-pay-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/ */

    

unquam / ing-web-pay-sdk example snippets




return [
    // ING WebPay API username (use 'TEST_API' for testing, replace with your production username)
    'username' => 'TEST_API',

    // ING WebPay API password (use test password during development, replace with your production password)
    'password' => 'q1w2e3r4Q!',

    // ... other configuration options
];

use Unquam\IngWebPaySdk\IngWebPayGateway;

$gateway = new IngWebPayGateway();

// The customerDetails parameter is optional. If you don’t need to include billing or contact information, you can omit it entirely from the request.

$response = $gateway->initializePayment([
    'order' => 'ORDER123',
    'amount' => 100.00,
    'currency' => '946', // RON currency code
    'description' => 'Order #ORDER123',
    'email' => '[email protected]',
    'customerDetails' => [
        'email' => '[email protected]',
        'phone' => '40712345678',
        'billingInfo' => [
            'country' => 'RO',
            'city' => 'Bucharest',
            'postAddress' => '123 Main St',
        ],
    ],
]);

if ($response && isset($response['formUrl'], $response['orderId'])) {
// IMPORTANT: You **must** save the 'orderId' returned by the gateway
    // in your local database associated with your order.
    // This 'orderId' is 

use Unquam\IngWebPaySdk\IngWebPayGateway;

// Retrieve payment status from ING using stored orderId
$gateway = new IngWebPayGateway();

$status = $gateway->getOrderStatus($orderId);

[
    "errorCode" => "0", // "0" means success
    "errorMessage" => "Success",
    "orderNumber" => "55701045", // Internal gateway order number
    "orderStatus" => 2, // See status codes below
    "actionCode" => 0,
    "actionCodeDescription" => "Request processed successfully",
    "amount" => 100, // Amount in minor units (e.g., "100" means 1.00 RON)
    "currency" => "946", // ISO 4217 numeric code for RON
    "date" => 1752261834463, // Order creation timestamp (milliseconds)
    "paymentDate" => 1752261857681, // Payment confirmation timestamp (milliseconds)
    "orderDescription" => "Comanda nr. EP4MN8KX",
    "ip" => "127.0.0.1", // IP address of the customer
    "merchantOrderParams" => [ ... ],
    "attributes" => [ ... ],
    "cardAuthInfo" => [
        "expiration" => "1226",
        "cardholderName" => "CARDHOLDER",
        "pan" => "411111****1111",
        "approvalCode" => "AB1234",
    ],
    "orderBundle" => [ ... ],
    "reconciliationId" => "6d36d96b50814f62ae8e"
]
bash
php artisan vendor:publish --provider="Unquam\IngWebPaySdk\IngWebPayServiceProvider" --tag="config"