Simple payment request without card details for alternative payment methods
{ "name": "Test User", "email": "test.user@email.com", "phoneNumber": "1234567890", "address": "10 Unknown Street", "city": "Far Town", "state": "NA", "postalCode": "123456", "country": "US", "amount": 10.50, "unit": "USD", "originDomain": "example.com", "referenceId": "123-GA-456", "notifyUrl": "https://notify.me", "successUrl": "https://success.payment.com", "failureUrl": "http://fail.payment.com" }
const alternativePayment = { name: "Test User", email: "test.user@email.com", phoneNumber: "1234567890", address: "10 Unknown Street", city: "Far Town", state: "NA", postalCode: "123456", country: "US", amount: 10.50, unit: "USD", originDomain: "example.com", referenceId: "123-GA-456", notifyUrl: "https://notify.me", successUrl: "https://success.payment.com", failureUrl: "http://fail.payment.com" }; // Send payment request const response = await fetch('https://your-h2h-endpoint.com', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'your-api-key' }, body: JSON.stringify(alternativePayment) }); const result = await response.json(); console.log('Payment created:', result.paymentRequestId); console.log('Redirect URL:', result.redirectUrl);
<?php $alternativePayment = [ 'name' => 'Test User', 'email' => 'test.user@email.com', 'phoneNumber' => '1234567890', 'address' => '10 Unknown Street', 'city' => 'Far Town', 'state' => 'NA', 'postalCode' => '123456', 'country' => 'US', 'amount' => 10.50, 'unit' => 'USD', 'originDomain' => 'example.com', 'referenceId' => '123-GA-456', 'notifyUrl' => 'https://notify.me', 'successUrl' => 'https://success.payment.com', 'failureUrl' => 'http://fail.payment.com' ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://your-h2h-endpoint.com'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($alternativePayment)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'X-API-Key: your-api-key' ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $result = json_decode($response, true); echo "Payment ID: " . $result['paymentRequestId']; echo "Redirect URL: " . $result['redirectUrl']; ?>
{ "name": "John Doe", "email": "john.doe@example.com", "phoneNumber": "+1234567890", "address": "123 Test Street", "city": "Test City", "state": "TS", "postalCode": "12345", "country": "US", "amount": 25.00, "unit": "USD", "referenceId": "TEST-ORDER-001" }