Lunch In A Box

Paymob Integration Guide

Step-by-step guide to integrate Paymob payment gateway

Step 1: Get Paymob Credentials

You need the following from your Paymob dashboard:

  • API Key - From Paymob Settings → Developers
  • Integration ID - For card payments
  • HMAC Secret - For transaction verification
Step 2: Create Backend Function

I'll create a backend function called InitiatePaymobPayment that:

  • Creates authentication token with Paymob
  • Registers the order
  • Generates payment key
  • Returns iframe URL for payment
Step 3: Payment Flow

The payment flow will work as follows:

  1. User completes order form (current flow)
  2. Frontend calls backend function to initiate payment
  3. User is redirected to Paymob payment iframe
  4. After payment, user returns to confirmation page
  5. Webhook updates subscription payment status

📋 Next Steps:

  1. Provide your Paymob API credentials (API Key, Integration ID, HMAC Secret)
  2. I'll create the backend function to handle payment initiation
  3. I'll modify the order flows to include payment step
  4. I'll set up webhook handler for payment confirmations

⚠️ Note: Test with Paymob sandbox credentials first before going live