Hosted Checkout Quick Start Guide

Hosted Checkout — Quick Start Guide

Prerequisites

  • Active CyoGate merchant account
  • Private API Key — see Get Your API Keys
  • Server capable of HTTPS POST requests

Step 1 — Configure Your Hosted Page

Log in to your Merchant Control PanelSettings > Hosted Payment Page. Upload your logo, set colors, and configure your redirect URLs and notification URL.

Step 2 — Redirect to Hosted Checkout

<?php
$post = array(
    'security_key'      => YOUR_PRIVATE_KEY,
    'type'              => 'sale',
    'amount'            => '29.99',
    'order_id'          => 'ORDER-12345',
    'order_description' => 'Widget Purchase',
    'redirect'          => 'https://yoursite.com/thank-you',
);
$ch = curl_init('https://secure.cyogate.net/api/transact.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
parse_str($response, $result);
if ($result['response'] == '1') {
    header('Location: ' . $result['form_url']);
    exit;
}
?>

Step 3 — Handle the Notification

<?php
// Your notification_url endpoint
if ($_POST['response'] == '1') {
    // Approved — fulfill order
    fulfill_order($_POST['order_id'], $_POST['transactionid']);
}
?>

Test Cards

Card NumberResult
4111111111111111Approved
4111111111111111 with amount 0.01Declined

Take Your Business to the Next Level

Find out how our innovative payment solutions can benefit your business. Reach out to us for more information or to get started!

Let's Get Started