Skip to main content

Documentation

Simulating 'Create Hosted Page' With 3DS Authentication

When you create a hosted page for a card payment, 3DS authentication of the cardholder is sometimes required. You can use the API to simulate this process in the sandbox.

Note

  • Simulated card operations with 3DS authentication must be authenticated within 15 minutes.

  • Hosted page operations can be authenticated with Rapyd 3DS.

Related Information

Prerequisites

  • A payment method that supports 3DS authentication. If the response to Get Payment Method Required Fields includes payment_method_options.3d_required, 3DS is supported.

  • Keys to the sandbox environment for your user.

  • A properly configured testing tool.

How
  1. Create a hosted page for a card payment as described in Create Checkout Page, with the following settings:

    • amount - Set to 1000 or above. Certain amounts above 2000 trigger specific errors instead of the 3DS flow. See Error Simulation.

    • country - Specify the country for the payment method type.

    • currency - Specify a currency that the payment method type supports.

    • payment_method_type - Specify the code for the payment method type.

      • Request

        • curl -X post
          https://sandboxapi.rapyd.net/v1/checkout/
          -H 'access_key: your-access-key-here'
          -H 'Content-Type: application/json'
          -H 'idempotency: your-idempotency-parameter-here'
          -H 'salt: your-random-string-here'
          -H 'signature: your-calculated-signature-here'
          -H 'timestamp: your-unix-timestamp-here'
          -d '{
              "amount": 450,
              "country": "IS",
              "currency": "ISK",
              "payment_method_type": "is_visa_card"
          }'
      • Response

        • {
              "status": {
                  "error_code": "",
                  "status": "SUCCESS",
                  "message": "",
                  "response_code": "",
                  "operation_id": "03c67c12-b0db-4c1f-be51-52dba46806fa"
              },
              "data": {
                  "id": "checkout_622156b26292ed4b3c146c99a7560918",
                  "status": "NEW",
                  "language": null,
                  "merchant_color": "323fff",
                  "merchant_logo": null,
                  "merchant_website": "https://example1234.net",
                  "merchant_customer_support": {
                      "url": "https://example1234.net",
                      "email": "support@example1234.net",
                      "phone_number": "121255551213"
                  },
                  "merchant_alias": "Doc Team",
                  "merchant_terms": "https://example1234.net/terms_and_conditions",
                  "merchant_privacy_policy": "https://example1234.net/privacy_policy",
                  "page_expiration": 1752146713,
                  "redirect_url": "https://sandboxcheckout.rapyd.net/?token=checkout_622156b26292ed4b3c146c99a7560918",
                  "merchant_main_button": "place_your_order",
                  "recurrence_type": null,
                  "cancel_checkout_url": "https://example1234.net",
                  "complete_checkout_url": "https://example1234.net",
                  "country": "IS",
                  "currency": "ISK",
                  "amount": 450,
                  "payment": {
                      "id": null,
                      "amount": 450,
                      "original_amount": 0,
                      "is_partial": false,
                      "currency_code": "ISK",
                      "country_code": "IS",
                      "status": null,
                      "description": "Payment via Checkout",
                      "merchant_reference_id": null,
                      "customer_token": null,
                      "payment_method": null,
                      "payment_method_data": {},
                      "expiration": 0,
                      "captured": false,
                      "refunded": false,
                      "refunded_amount": 0,
                      "receipt_email": null,
                      "redirect_url": null,
                      "complete_payment_url": null,
                      "error_payment_url": null,
                      "receipt_number": null,
                      "flow_type": null,
                      "address": null,
                      "statement_descriptor": null,
                      "transaction_id": null,
                      "created_at": 0,
                      "updated_at": 0,
                      "metadata": null,
                      "failure_code": null,
                      "failure_message": null,
                      "paid": false,
                      "paid_at": 0,
                      "dispute": null,
                      "refunds": null,
                      "order": null,
                      "outcome": null,
                      "visual_codes": {},
                      "textual_codes": {},
                      "instructions": {},
                      "ewallet_id": null,
                      "ewallets": [],
                      "payment_method_options": {},
                      "payment_method_type": null,
                      "payment_method_type_category": null,
                      "fx_rate": null,
                      "merchant_requested_currency": null,
                      "merchant_requested_amount": null,
                      "fixed_side": null,
                      "payment_fees": null,
                      "invoice": null,
                      "escrow": null,
                      "group_payment": null,
                      "cancel_reason": null,
                      "initiation_type": null,
                      "mid": null,
                      "next_action": "not_applicable"
                  },
                  "payment_method_type": "is_visa_card",
                  "payment_method_type_categories": null,
                  "payment_method_types_include": null,
                  "payment_method_types_exclude": null,
                  "account_funding_transaction": null,
                  "customer": null,
                  "custom_elements": {
                      "hide_save_card": false,
                      "save_card_default": false,
                      "display_description": false,
                      "payment_fees_display": true,
                      "merchant_currency_only": false,
                      "billing_address_collect": false,
                      "dynamic_currency_conversion": false
                  },
                  "timestamp": 1750937113,
                  "payment_expiration": null,
                  "cart_items": [],
                  "escrow": null,
                  "escrow_release_days": null,
                  "require_card_cvv": false
              }
          }
  2. Paste the redirect URL into the address bar of your browser.

    The Rapyd hosted page appears.

    hosted_page.png
  3. Provide all requested information. You can use 4111 1111 1111 1111 for the card number.

  4. Click Place Your Order.

    The Rapyd 3DS Simulator page appears.

    3ds.png
  5. Type 123456, then click Continue.

    The Payment Successful page appears.

    payment_successful.png

    The PAYMENT_COMPLETED webhook is sent.

      • Webhook

        • {
            "id": "wh_de598994263efa0f9e426828899773d6",
            "type": "PAYMENT_COMPLETED",
            "data": {
              "id": "payment_ed542c9e3b2e32697b99892cafeadd8a",
              "mid": "",
              "paid": true,
              "order": null,
              "amount": 1450,
              "escrow": null,
              "status": "CLO",
              "address": null,
              "dispute": null,
              "fx_rate": 1,
              "invoice": "",
              "outcome": null,
              "paid_at": 1750938365,
              "refunds": null,
              "captured": true,
              "ewallets": [
                {
                  "amount": 1450,
                  "percent": 100,
                  "ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
                  "refunded_amount": 0
                }
              ],
              "metadata": {},
              "refunded": false,
              "auth_code": null,
              "flow_type": "",
              "created_at": 1750938350,
              "error_code": "",
              "ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
              "expiration": 1751543150,
              "fixed_side": "",
              "is_partial": false,
              "description": "Payment via Checkout",
              "next_action": "not_applicable",
              "country_code": "IS",
              "failure_code": "",
              "instructions": [
                {
                  "name": "instructions",
                  "steps": [
                    {
                      "step1": ""
                    }
                  ]
                }
              ],
              "payment_fees": null,
              "redirect_url": "https://sandboxcheckout.rapyd.net/3ds-payment?token=payment_ed542c9e3b2e32697b99892cafeadd8a",
              "visual_codes": {},
              "cancel_reason": null,
              "currency_code": "ISK",
              "group_payment": "",
              "receipt_email": "",
              "textual_codes": {},
              "customer_token": "cus_0f48e10fdc48a66c7167d0d79ef3a4fc",
              "payment_method": null,
              "receipt_number": "",
              "transaction_id": "",
              "failure_message": "",
              "initiation_type": "customer_present",
              "original_amount": 1450,
              "refunded_amount": 0,
              "error_payment_url": "https://sandboxcheckout.rapyd.net/thank-you-failed/checkout_f3daf69168461e36f673fe2696e9186e",
              "payment_method_data": {
                "id": null,
                "name": "John Doe",
                "type": "is_visa_card",
                "image": "",
                "last4": "1111",
                "category": "card",
                "metadata": {},
                "acs_check": "pass",
                "cvv_check": "unchecked",
                "bin_details": {
                  "type": "DEBIT",
                  "brand": "VISA",
                  "level": "CLASSIC",
                  "issuer": "CONOTOXIA SP. Z O.O",
                  "country": "PL",
                  "bin_number": "411111"
                },
                "next_action": "not_applicable",
                "webhook_url": "",
                "expiration_year": "30",
                "expiration_month": "12",
                "fingerprint_token": "ocfp_e599f990674473ce6283b245e9ad2467",
                "network_reference_id": "367194",
                "supporting_documentation": "",
                "payment_account_reference": "V001BCCI1UIBPCAV7AEY7HBRDY5AA"
              },
              "payment_method_type": "is_visa_card",
              "save_payment_method": false,
              "transaction_link_id": null,
              "complete_payment_url": "https://sandboxcheckout.rapyd.net/thank-you-success/checkout_f3daf69168461e36f673fe2696e9186e",
              "merchant_advice_code": null,
              "remitter_information": {},
              "statement_descriptor": "Doc Team",
              "authentication_result": {
                "eci": "05",
                "result": "A",
                "version": "2.2.0",
                "cardholder_info": null
              },
              "merchant_reference_id": "",
              "payment_method_options": {},
              "merchant_advice_message": null,
              "merchant_requested_amount": null,
              "merchant_requested_currency": null,
              "payment_method_type_category": "card"
            },
            "trigger_operation_id": "0aa95224-1384-4676-ad13-2a78e803eb9d",
            "status": "NEW",
            "created_at": 1750938365,
            "extended_timestamp": 1750938365797
          }

    Note that the status has changed to CLO (closed).