Learn how to accept dynamic online payments (Cash App, Zelle, Venmo, Apple Pay, PayPal, and USDT) on your e-commerce store or custom website. From API credentials and dynamic rate calculation to cryptographic webhooks and automated order settlement.
Instant onboarding with zero security deposit requirement
To begin accepting customer payments, register an account on FinTrGo. Every account has instant access to the developer payment gateway platform:
Dashboard → Developer Gateway (or visit /developer-gateway).Retrieve your API Key, Secret Key, and configure where they belong
In your Developer Hub (/developer-gateway), you will find three primary credentials:
| Credential | Format Example | Where to Set |
|---|---|---|
| Live API Key | ftg_live_a1b2c3d4e5f6... |
In WooCommerce Plugin settings or your server .env file (FINTRGO_API_KEY). |
| Live Secret Key | sec_live_9876543210ab... |
Used for server-side management. Keep confidential! |
| Webhook Secret | whsec_543210fedcba... |
In WooCommerce Plugin settings or your server .env file (FINTRGO_WEBHOOK_SECRET). |
https://yourstore.com/api/fintrgo-ipn) in the Developer Hub to receive instant automated payment alerts.Secret Key and Webhook Secret must never be placed in frontend code (React, Vue, HTML, browser JavaScript) or public repositories. All payment creation and webhook verification calls must occur on your secure backend server.
Pass dynamic cart total and customer details to FinTrGo's checkout engine
When a customer completes their order on your website (for any dynamic amount: $10, $50, $100, etc.), your backend server sends an HTTP POST request to:
https://fintrgo.com/api/v1/checkout/create
{
"order_id": "ORD-10025",
"amount": 50.00,
"currency": "USD",
"customer_name": "Alex Carter",
"customer_email": "[email protected]",
"success_url": "https://yourstore.com/checkout/success?order_id=ORD-10025",
"cancel_url": "https://yourstore.com/checkout/cancel?order_id=ORD-10025",
"webhook_url": "https://yourstore.com/api/fintrgo-ipn"
}
FinTrGo API Response:
{
"status": "success",
"session_token": "cs_live_948fbc01e23a",
"checkout_url": "https://fintrgo.com/checkout/pay/cs_live_948fbc01e23a",
"amount": 50.00,
"currency": "USD",
"expires_at": "2026-10-06 22:49:41"
}
$_POST['customer_name'], $_POST['customer_email'], and dynamic cart total) and forward them in the payload above.The customer is safely redirected to FinTrGo's hosted checkout
Your website redirects the customer’s browser to the returned checkout_url. The customer views a clean, mobile-responsive checkout interface where they can select their preferred payment channel:
How channel rates and box capacity limits protect merchant transactions
To ensure the merchant always receives their exact required checkout amount, FinTrGo applies the payment channel's configured conversion rate using standard division:
Customer Payment Required = Merchant Required Amount ÷ Channel Rate
0.98, the required customer payment is $51.02, guaranteeing the merchant's full amount is fulfilled.
Account details, dynamic QR codes, and transaction submission
On the hosted checkout page:
Secure server-side validation and multi-layer verification
FinTrGo processes the submitted payment:
GET https://fintrgo.com/api/v1/checkout/status?session_token=cs_live_948fbc01e23a
Cryptographically signed HTTP POST notification to your server
Once payment is verified, FinTrGo delivers an asynchronous webhook payload to your registered webhook_url. The request includes the X-FinTrGo-Signature header generated using HMAC-SHA256:
{
"event": "payment.completed",
"event_id": "evt_8839102",
"timestamp": 1791334200,
"data": {
"order_id": "ORD-10025",
"session_token": "cs_live_948fbc01e23a",
"amount": 50.00,
"currency": "USD",
"fee": 1.00,
"net": 49.00,
"status": "completed",
"trx_id": "FTG-TX-8921102"
}
}
Mark order as Paid and trigger digital delivery
When your webhook listener verifies that the HMAC-SHA256 signature matches your webhook_secret:
200 OK to acknowledge receipt.Smooth customer return to your store's confirmation page
Following payment completion, the customer's browser is automatically redirected back to your configured success_url with confirmation query parameters:
https://yourstore.com/checkout/success?order_id=ORD-10025&session=cs_live_948fbc01e23a&status=completed
Drop-in integration code for your backend stack
1. Create Checkout Session (Initiate Payment):
<?php
$api_key = 'ftg_live_your_api_key_here';
$payload = [
'order_id' => 'ORD-' . time(),
'amount' => 50.00, // Dynamic cart amount
'currency' => 'USD',
'customer_name' => 'John Doe',
'customer_email' => '[email protected]',
'success_url' => 'https://yourstore.com/order-success.php',
'cancel_url' => 'https://yourstore.com/order-cancel.php',
'webhook_url' => 'https://yourstore.com/webhook.php'
];
$ch = curl_init('https://fintrgo.com/api/v1/checkout/create');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $api_key
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!empty($response['checkout_url'])) {
header('Location: ' . $response['checkout_url']);
exit;
} else {
echo "Payment Error: " . ($response['message'] ?? 'Unable to connect to gateway');
}
2. Webhook Listener (Verify and Mark as Paid):
<?php
$webhook_secret = 'whsec_your_signing_secret_here';
$raw_payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_FINTRGO_SIGNATURE'] ?? '';
// Cryptographic HMAC-SHA256 Signature Verification
$expected_signature = hash_hmac('sha256', $raw_payload, $webhook_secret);
if (!hash_equals($expected_signature, $signature)) {
http_response_code(403);
exit('Invalid signature');
}
$event = json_decode($raw_payload, true);
if ($event['event'] === 'payment.completed') {
$order_id = $event['data']['order_id'];
$amount_paid = $event['data']['amount'];
$trx_id = $event['data']['trx_id'];
// Update your database: Mark order as Paid
// db_query("UPDATE orders SET status = 'paid', trx_id = '$trx_id' WHERE id = '$order_id'");
http_response_code(200);
echo json_encode(['status' => 'success']);
} else {
http_response_code(200);
echo json_encode(['status' => 'ignored']);
}
Laravel Controller Implementation:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use App\Models\Order;
class PaymentController extends Controller
{
public function initiatePayment($orderId)
{
$order = Order::findOrFail($orderId);
$response = Http::withToken(env('FINTRGO_API_KEY'))
->post('https://fintrgo.com/api/v1/checkout/create', [
'order_id' => (string) $order->id,
'amount' => (float) $order->total_amount,
'currency' => 'USD',
'customer_name' => $order->customer_name,
'customer_email' => $order->customer_email,
'success_url' => route('payment.success', ['order' => $order->id]),
'cancel_url' => route('payment.cancel', ['order' => $order->id]),
'webhook_url' => route('payment.webhook'),
]);
if ($response->successful() && $response->json('checkout_url')) {
return redirect()->away($response->json('checkout_url'));
}
return back()->with('error', 'Payment gateway error. Please try again.');
}
public function handleWebhook(Request $request)
{
$raw = $request->getContent();
$sig = $request->header('X-FinTrGo-Signature');
$secret = env('FINTRGO_WEBHOOK_SECRET');
if (!hash_equals(hash_hmac('sha256', $raw, $secret), (string)$sig)) {
return response()->json(['error' => 'Invalid signature'], 403);
}
$event = $request->json('event');
$data = $request->json('data');
if ($event === 'payment.completed') {
$order = Order::find($data['order_id']);
if ($order) {
$order->update([
'status' => 'paid',
'transaction_id' => $data['trx_id']
]);
}
}
return response()->json(['status' => 'success'], 200);
}
}
WordPress / WooCommerce Plug & Play Integration:
You do not need to write custom code for WooCommerce. Follow these 3 simple steps:
/wp-content/plugins/fintrgo-woocommerce/ on your WordPress site and click Activate Plugin in your WP Admin.<?php
/**
* Plugin Name: FinTrGo Payment Gateway for WooCommerce
* Plugin URI: https://fintrgo.com
* Description: Accept Cash App, Zelle, Venmo, Apple Pay and USDT payments seamlessly via FinTrGo Payment Gateway with automated IPN Webhook verification. Zero security deposit required.
* Version: 1.0.0
* Author: FinTrGo Developer Platform
* Author URI: https://fintrgo.com
* Text Domain: fintrgo-gateway
* Domain Path: /languages
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
add_action('plugins_loaded', 'init_fintrgo_payment_gateway');
function init_fintrgo_payment_gateway() {
if (!class_exists('WC_Payment_Gateway')) {
return;
}
class WC_Gateway_FinTrGo extends WC_Payment_Gateway {
public function __construct() {
$this->id = 'fintrgo';
$this->icon = apply_filters('woocommerce_fintrgo_icon', 'https://fintrgo.com/assets/favicon.png');
$this->has_fields = false;
$this->method_title = __('FinTrGo Payment Gateway', 'fintrgo-gateway');
$this->method_description = __('Accept global payments (Cash App, Zelle, USDT) via FinTrGo hosted checkout.', 'fintrgo-gateway');
$this->supports = ['products'];
// Load form fields & settings
$this->init_form_fields();
$this->init_settings();
$this->title = $this->get_option('title');
$this->description = $this->get_option('description');
$this->enabled = $this->get_option('enabled');
$this->api_key = $this->get_option('api_key');
$this->webhook_secret = $this->get_option('webhook_secret');
$this->api_url = rtrim($this->get_option('api_url', 'https://fintrgo.com'), '/');
// Save admin options
add_action('woocommerce_update_options_payment_gateways_' . $this->id, [$this, 'process_admin_options']);
// IPN Webhook Listener
add_action('woocommerce_api_fintrgo_ipn', [$this, 'handle_ipn_callback']);
}
public function init_form_fields() {
$webhook_url = add_query_arg('wc-api', 'fintrgo_ipn', home_url('/'));
$this->form_fields = [
'enabled' => [
'title' => __('Enable/Disable', 'fintrgo-gateway'),
'type' => 'checkbox',
'label' => __('Enable FinTrGo Gateway', 'fintrgo-gateway'),
'default' => 'yes'
],
'title' => [
'title' => __('Title', 'fintrgo-gateway'),
'type' => 'text',
'description' => __('Payment method title that the customer sees during checkout.', 'fintrgo-gateway'),
'default' => __('FinTrGo Secure Payments (Cash App, Zelle, USDT)', 'fintrgo-gateway'),
'desc_tip' => true
],
'description' => [
'title' => __('Description', 'fintrgo-gateway'),
'type' => 'textarea',
'description' => __('Payment method description that the customer sees during checkout.', 'fintrgo-gateway'),
'default' => __('Pay securely via Cash App, Zelle, Venmo or USDT. Instant order confirmation upon verification.', 'fintrgo-gateway')
],
'api_key' => [
'title' => __('Live API Key', 'fintrgo-gateway'),
'type' => 'text',
'description' => __('Get this from your FinTrGo Dashboard > Developer & Gateway.', 'fintrgo-gateway'),
'default' => '',
'desc_tip' => true
],
'webhook_secret' => [
'title' => __('Webhook Signing Secret', 'fintrgo-gateway'),
'type' => 'password',
'description' => __('Get this from your FinTrGo Developer Hub to verify incoming IPN signatures.', 'fintrgo-gateway'),
'default' => '',
'desc_tip' => true
],
'api_url' => [
'title' => __('Gateway Endpoint URL', 'fintrgo-gateway'),
'type' => 'text',
'description' => __('FinTrGo platform URL (default: https://fintrgo.com)', 'fintrgo-gateway'),
'default' => 'https://fintrgo.com'
],
'webhook_notice' => [
'title' => __('Your Store Webhook URL', 'fintrgo-gateway'),
'type' => 'title',
'description' => sprintf(__('Copy this URL and paste it into your FinTrGo Developer Hub: <code>%s</code>', 'fintrgo-gateway'), esc_url($webhook_url))
]
];
}
public function process_payment($order_id) {
$order = wc_get_order($order_id);
if (!$order) {
return ['result' => 'fail'];
}
$amount = $order->get_total();
$currency = get_woocommerce_currency();
$webhook_url = add_query_arg('wc-api', 'fintrgo_ipn', home_url('/'));
$success_url = $this->get_return_url($order);
$cancel_url = $order->get_cancel_order_url();
$payload = [
'order_id' => (string)$order->get_id(),
'amount' => (float)$amount,
'currency' => $currency,
'customer_name' => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(),
'customer_email' => $order->get_billing_email(),
'success_url' => $success_url,
'cancel_url' => $cancel_url,
'webhook_url' => $webhook_url
];
$response = wp_remote_post($this->api_url . '/api/v1/checkout/create', [
'method' => 'POST',
'timeout' => 25,
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . trim($this->api_key)
],
'body' => json_encode($payload)
]);
if (is_wp_error($response)) {
wc_add_notice(__('Gateway communication error. Please try again.', 'fintrgo-gateway'), 'error');
return ['result' => 'fail'];
}
$body = json_decode(wp_remote_retrieve_body($response), true);
if (isset($body['status']) && $body['status'] === 'success' && !empty($body['checkout_url'])) {
// Mark as pending payment
$order->update_status('pending', __('Awaiting FinTrGo payment completion.', 'fintrgo-gateway'));
WC()->cart->empty_cart();
return [
'result' => 'success',
'redirect' => $body['checkout_url']
];
} else {
$err_msg = $body['message'] ?? __('Payment initialization failed. Please contact store support.', 'fintrgo-gateway');
wc_add_notice($err_msg, 'error');
return ['result' => 'fail'];
}
}
public function handle_ipn_callback() {
$raw_input = file_get_contents('php://input');
$signature_header = $_SERVER['HTTP_X_FINTRGO_SIGNATURE'] ?? '';
if (empty($raw_input)) {
wp_die('No payload provided', 'IPN Error', ['response' => 400]);
}
// Verify signature
if (!empty($this->webhook_secret)) {
$expected_sig = hash_hmac('sha256', $raw_input, trim($this->webhook_secret));
if (!hash_equals($expected_sig, $signature_header)) {
wp_die('Signature verification failed', 'Forbidden', ['response' => 403]);
}
}
$data = json_decode($raw_input, true);
if (!$data || empty($data['event']) || empty($data['data'])) {
wp_die('Invalid JSON structure', 'Bad Request', ['response' => 400]);
}
$event = $data['event'];
$payload = $data['data'];
$order_id = $payload['order_id'] ?? 0;
$order = wc_get_order($order_id);
if (!$order) {
wp_die('Order not found', 'Not Found', ['response' => 404]);
}
if ($event === 'payment.completed') {
$trx_id = $payload['trx_id'] ?? 'FinTrGo-Verified';
$order->payment_complete($trx_id);
$order->add_order_note(sprintf(__('Payment verified successfully via FinTrGo. Trx ID: %s, Amount: $%s', 'fintrgo-gateway'), $trx_id, number_format($payload['amount'], 2)));
status_header(200);
echo json_encode(['status' => 'success']);
exit;
} elseif ($event === 'payment.failed') {
$order->update_status('failed', __('Payment rejected or verification failed on FinTrGo.', 'fintrgo-gateway'));
status_header(200);
echo json_encode(['status' => 'handled']);
exit;
}
status_header(200);
echo json_encode(['status' => 'event_ignored']);
exit;
}
}
add_filter('woocommerce_payment_gateways', function($methods) {
$methods[] = 'WC_Gateway_FinTrGo';
return $methods;
});
}
Node.js / Express Implementation:
const express = require('express');
const axios = require('axios');
const crypto = require('crypto');
const app = express();
app.use(express.json());
const FINTRGO_API_KEY = process.env.FINTRGO_API_KEY;
const FINTRGO_WEBHOOK_SECRET = process.env.FINTRGO_WEBHOOK_SECRET;
// 1. Create Checkout Session
app.post('/api/create-payment', async (req, res) => {
try {
const { orderId, amount, customerName, customerEmail } = req.body;
const response = await axios.post('https://fintrgo.com/api/v1/checkout/create', {
order_id: orderId,
amount: parseFloat(amount),
currency: 'USD',
customer_name: customerName,
customer_email: customerEmail,
success_url: `https://yourstore.com/success?order_id=${orderId}`,
cancel_url: `https://yourstore.com/cancel?order_id=${orderId}`,
webhook_url: 'https://yourstore.com/api/fintrgo-webhook'
}, {
headers: {
'Authorization': `Bearer ${FINTRGO_API_KEY}`,
'Content-Type': 'application/json'
}
});
res.json({ checkout_url: response.data.checkout_url });
} catch (err) {
res.status(500).json({ error: err.response?.data?.message || err.message });
}
});
// 2. Webhook Listener
app.post('/api/fintrgo-webhook', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-fintrgo-signature'];
const expectedSig = crypto
.createHmac('sha256', FINTRGO_WEBHOOK_SECRET)
.update(req.body)
.digest('hex');
if (signature !== expectedSig) {
return res.status(403).send('Signature verification failed');
}
const payload = JSON.parse(req.body.toString());
if (payload.event === 'payment.completed') {
const { order_id, trx_id } = payload.data;
// Mark order as paid in your DB:
console.log(`Order ${order_id} verified with Trx ID ${trx_id}`);
}
res.status(200).json({ status: 'success' });
});
Python / FastAPI Implementation:
import hmac
import hashlib
import httpx
from fastapi import FastAPI, Request, HTTPException
app = FastAPI()
FINTRGO_API_KEY = "ftg_live_your_api_key"
FINTRGO_WEBHOOK_SECRET = "whsec_your_webhook_secret"
@app.post("/create-checkout")
async def create_checkout(order_id: str, amount: float):
url = "https://fintrgo.com/api/v1/checkout/create"
headers = {
"Authorization": f"Bearer {FINTRGO_API_KEY}",
"Content-Type": "application/json"
}
payload = {
"order_id": order_id,
"amount": amount,
"currency": "USD",
"success_url": f"https://yourstore.com/success?order={order_id}",
"cancel_url": f"https://yourstore.com/cancel?order={order_id}",
"webhook_url": "https://yourstore.com/fintrgo-webhook"
}
async with httpx.AsyncClient() as client:
res = await client.post(url, json=payload, headers=headers)
return res.json()
@app.post("/fintrgo-webhook")
async def fintrgo_webhook(request: Request):
raw_body = await request.body()
signature = request.headers.get("x-fintrgo-signature", "")
expected = hmac.new(
FINTRGO_WEBHOOK_SECRET.encode(),
raw_body,
hashlib.sha256
).hexdigest()
if not hmac.compare_digest(expected, signature):
raise HTTPException(status_code=403, detail="Invalid signature")
event = await request.json()
if event.get("event") == "payment.completed":
order_id = event["data"]["order_id"]
# Update database: mark order as paid
print(f"Payment received for order {order_id}")
return {"status": "success"}
Master Prompt for ChatGPT, Claude, Gemini & Cursor
Copy this master prompt into your coding AI assistant. It provides all technical rules, endpoints, dynamic amount specifications, and HMAC signature algorithms so AI can write the exact integration code for your project in seconds.