Take a one-time payment
Authorize and capture a tokenized payment.
Prepare the order
Use matching sandbox merchant credentials and a fresh component token. Resolve the amount on your server. online
Submit from your server
This request uses the REST Payments API. Replace placeholders and the example amount with the authorized test order. POST /api/v5/payments/sale HTTP/1.1 Host: sandbox.nmi.com Authorization: <sandbox-private-merchant-key> Content-Type: application/json { "amount": 10.0, "payment_details": { "payment_token": "<fresh-sandbox-token>" } }
Record the outcome
Check the gateway result, not only HTTP success. Store the payment ID with the order.
Verify failure handling
Test approval, decline, and a lost response. Keep ambiguous attempts unresolved until investigated; do not create another charge automatically. Handle uncertain outcomes