Skip to content

Quickstart

Take a test payment with the hosted payment page (checkout), the integration that needs the least code.

  1. Get your test key

    In the dashboard, copy your sk_test_… key. Keep it on your server, never in a mobile app or in JavaScript that runs in the browser.

  2. Initialize a checkout

    Fenêtre de terminal
    curl https://api.senfenico.com/v1/payment/checkouts/initialize/ \
    -H "X-API-KEY: sk_test_..." \
    -H "Content-Type: application/json" \
    -d '{"amount": 1000, "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel"}'
  3. Redirect the customer to authorization_url

    {
    "status": true,
    "message": "Checkout initialized",
    "data": {
    "reference": "CHK261126-101502--1ba1b4d126",
    "authorization_url": "https://api.senfenico.com/v1/checkout_payment/payment_page/CHK261126-101502--1ba1b4d126/",
    "live_mode": false
    }
    }

    On the page, pay with a test number, for example the Orange number 76000000 with amount 1000 and OTP 123456.

  4. Confirm the payment server-side

    Senfenico sends the customer back to success_url?reference=CHK…. Anyone can open that URL, so it proves nothing. Fetch the checkout from your server and check its status and amount:

    Fenêtre de terminal
    curl https://api.senfenico.com/v1/payment/checkouts/CHK261126-101502--1ba1b4d126/ \
    -H "X-API-KEY: sk_test_..."
    {
    "status": true,
    "message": "Checkout details retrieved",
    "data": {
    "reference": "CHK261126-101502--1ba1b4d126",
    "amount": 1000,
    "status": "success",
    "live_mode": false
    }
    }

    The order is paid only if data.status is success and data.amount matches your order. In production, also subscribe to the charge.success webhook, the only one that arrives if the customer closes the page before the end. See Confirm the payment server-side.