# OmanNET for Unified Payments API OmanNET payments follow a two-step process: 1. [Request a payment](#Request_a_payment). 2. [Redirect the customer](#Redirect_the_customer). --- ## Request a payment You can [request a payment](https://www.checkout.com/docs/payments/accept-payments/request-a-payment.md) using: - A token - A payment instrument - Full card details, if you are [SAQ D PCI compliant](https://www.checkout.com/docs/payments/ensure-regulatory-compliance/pci-compliance.md) All payment requests processed through OmanNET are purchase payments. This means that payments are authorized and captured simultaneously, regardless of the `capture` value you pass in your request. If you need to return funds to the cardholder, you must [process a full refund](https://www.checkout.com/docs/payments/manage-payments/refund-a-payment.md) instead. > **Warning** > > [3D Secure](https://www.checkout.com/docs/payments/authenticate-payments/3d-secure.md) (3DS) is not applicable to payments made through OmanNET. To avoid unexpected declines, you should explicitly set the `3ds.enabled` field in your payment request to `false`. For the full API specification, see the [API reference](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout). > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request example ```json { "source": { "type": "card", "number": "4837915625977889", "expiry_month": 8, "expiry_year": 2025, "stored": false, "name": "John", "cvv": "806" }, "3ds": { "enabled": false }, "amount": 5, "currency": "OMR", "success_url": "https://www.checkout.com/", "failure_url": "https://www.checkout.com/404", "processing_channel_id": "pc_lmdzwouw4ffenmkzyqenzwske4", "reference": "ORD-123A" } ``` > **Note** > > The [reference](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout!path=0/reference&t=request) field must be a unique identifier for each payment action. If you pass the same value when refunding the payment, you receive a `20020` error code, and OmanNET declines the refund request with a _Duplicate Merchant Track Id_ error. ### Response example If you receive a `202 Success` response with a payment `id` and a `status` field set to `Pending`, your request was successful. ```json { "id": "pay_ogvedu6ney7utmcikacddpyeuq", "status": "Pending", "_links": { "self": { "href": "https://{prefix}.api.checkout.com/payments/pay_ogvedu6ney7utmcikacddpyeuq" }, "actions": { "href": "https://{prefix}.api.checkout.com/payments/pay_ogvedu6ney7utmcikacddpyeuq/actions" }, "redirect": { "href": "http://tpa-qa.ckotech.co/omannet/payment/9cf244e0-f582-42bf-8578-4e4b333d26d2" } } } ``` --- ## Redirect the customer Redirect your customer to the `redirect.href` link from the response. The subsequent steps vary depending on whether you've enabled OTP for authentication. If your acquirer MID configuration requires additional authentication, your customer will be prompted for additional information before they can be redirected to the `success_url` or `failure_url`. They will be redirected to the OmanNET website and prompted for an OTP code to authorize the payment. If additional authentication is not required, your customer will be redirected directly to the `success_url` or `failure_url` without any further action from your customer required. > **Information** > > Confirmation of an OmanNET payment is only communicated via webhooks. To receive webhooks, [configure your webhook server](https://www.checkout.com/docs/developer-resources/event-notifications/receive-webhooks/configure-your-webhook-server.md). Regardless of whether you performed OTP authentication or not, you'll receive a `payment_captured` webhook when the transaction has completed successfully. Until you receive this webhook, the payment will be labeled as `Pending`. --- ## Get details about a payment Retrieve details about an existing OmanNET payment with the following endpoint: > **Information** > > If you attempt to retrieve details about a payment that is labeled as `Pending`, you'll receive a `404`. **Live** `GET` `https://{prefix}.api.checkout.com/payments/{id}` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/payments/{id}` ### Response example ```json { "id": "pay_artwfmgguv7uvi2wuv6mq4o3mu", "requested_on": "2023-05-10T08:44:24.3754671Z", "source": { "id": "src_baqgk6yhjspe5gpotvpjx72kqe", "type": "card", "expiry_month": 8, "expiry_year": 2025, "name": "John", "scheme": "Visa", "scheme_local": "omannet", "local_schemes": [ "omannet" ], "last4": "7889", "fingerprint": "0BD3C37E91933EE417E7205B454E6E4617B1F858B25C15219E6EA7CE1D1EF093", "bin": "483791", "card_type": "DEBIT", "card_category": "CONSUMER", "issuer": "Bank Muscat", "issuer_country": "OM", "product_id": "F" }, "amount": 5, "currency": "OMR", "payment_type": "Regular", "status": "Captured", "balances": { "total_authorized": 5, "total_voided": 0, "available_to_void": 0, "total_captured": 5, "available_to_capture": 0, "total_refunded": 5, "available_to_refund": 0 }, "risk": { "flagged": false }, "_links": { "self": { "href": "https://{prefix}.api.checkout.com/payments/pay_artwfmgguv7uvi2wuv6mq4o3mu" }, "actions": { "href": "https://{prefix}.api.checkout.com/payments/pay_artwfmgguv7uvi2wuv6mq4o3mu/actions" }, "refund": { "href": "https://{prefix}.api.checkout.com/payments/pay_artwfmgguv7uvi2wuv6mq4o3mu/refunds" } } } ``` --- ## Refund a payment OmanNET only supports full refunds. You can refund a payment through the [Dashboard](https://dashboard.checkout.com), or by using our [Refund API](https://api-reference.checkout.com/tag/Payments/#operation/refundAPayment). --- ## Test OmanNET 1. Create an OmanNET transaction and use the details from one of the [test cards](#Test_cards). 2. Follow the redirect link provided in the response. 3. If an OTP is required to complete the payment, enter the code sent to the email address you configured with your account manager. You should then be redirected to your predefined success URL. If an OTP is not required, you will be redirected immediately without an OTP prompt. ### Test cards | Card number | Card type | | --- | --- | | 4837915090070004 | OmanNET, co-branded Visa Classic Debit | | 4837915090073321 | OmanNET, co-branded Visa Classic Debit |