Testing & Debugging

Before launching your logistic app, it's essential to thoroughly test all features in a safe environment. This guide covers how to use development stores and test various scenarios.

Using Development Store

A development store is a sandbox environment for testing your Logistic App integration. You can create orders, test shipping rate calculations, fulfillment flows, and AWB printing without affecting real merchant data.

📖 Learn how to set up a development store: EasyStore Development Store Guide

Testing Shipping Methods or Pickup Methods

  1. Install your app to a development store
  2. Register your CURL endpoint using the API
  3. Go to the store's online storefront
  4. Add a product to cart and proceed to checkout
  5. For Shipping:
    • Fill in the shipping address
    • Your CURL endpoint should receive an API call with the shipping topic
    • Verify your endpoint returns the correct shipping rates
  6. For Pickup:
    • Select the pickup delivery option
    • Your CURL endpoint should receive an API call with the pickup topic
    • Verify your endpoint returns the correct pickup methods/locations
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│                              Checkout Page - Shipping Options                           │
└─────────────────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│  🛒 CHECKOUT                                                              [Your Store]  │
├─────────────────────────────────────────────────────────────────────────────────────────┤
│                                                                                         │
│  ┌─────────────────────────────────┐    ┌─────────────────────────────────────────────┐ │
│  │  📍 SHIPPING ADDRESS            │    │  📦 ORDER SUMMARY                          │ │
│  │  ───────────────────────────    │    │  ─────────────────────────────────────     │ │
│  │  John Doe                       │    │  Product A (x2)            RM 50.00        │ │
│  │  123 Main Street                │    │  Product B (x1)            RM 30.00        │ │
│  │  Kuala Lumpur, 50000            │    │  ─────────────────────────────────────     │ │
│  │  Malaysia                       │    │  Subtotal                  RM 80.00        │ │
│  │  📱 +60 12-345 6789             │    │  Shipping                  RM  8.00        │ │
│  └─────────────────────────────────┘    │  ─────────────────────────────────────     │ │
│                                         │  TOTAL                     RM 88.00        │ │
│  ┌─────────────────────────────────┐    └─────────────────────────────────────────────┘ │
│  │  🚚 SHIPPING METHOD             │                                                    │
│  │  ───────────────────────────    │    ┌─────────────────────────────────────────────┐ │
│  │                                 │    │  Your app's shipping rates appear here     │ │
│  │  ◉ Your App - Standard          │◄───│  after EasyStore calls your CURL endpoint  │ │
│  │    Est. 3-5 business days       │    │  with the shipping address details         │ │
│  │    RM 8.00                      │    └─────────────────────────────────────────────┘ │
│  │                                 │                                                    │
│  │  ○ Your App - Express           │                                                    │
│  │    Est. 1-2 business days       │                                                    │
│  │    RM 15.00                     │                                                    │
│  │                                 │                                                    │
│  │  ○ Other Courier - Economy      │                                                    │
│  │    Est. 5-7 business days       │                                                    │
│  │    RM 5.00                      │                                                    │
│  │                                 │                                                    │
│  └─────────────────────────────────┘                                                    │
│                                                                                         │
│                                    ┌───────────────────────┐                            │
│                                    │   PLACE ORDER         │                            │
│                                    └───────────────────────┘                            │
└─────────────────────────────────────────────────────────────────────────────────────────┘
      

Testing Order Fulfillment & AWB Integration

  1. Install your app to a development store
  2. Register your fulfillment URL with EasyStore team (email dev@easystore.co)
  3. Place an order from Online Store or manually create an order in admin panel
  4. Click the "Fulfill" button and select your app from the dropdown
  5. Your fulfillment URL should receive the API call

💡 For bulk fulfillment: Select multiple orders in the listing, click "More actions" dropdown, and select your app

  1. Display your fulfillment UI by returning a link type response
  2. Fulfill the orders by:
    • Creating shipment record in your logistics platform
    • Creating fulfillment record in EasyStore via API
  3. On success, display a success page
    • Recommended: Include a "Print AWB" button directly in the success page for smoother operation (this bypasses the AWB URL defined in EasyStore since it's within your app)
  4. Merchants can also print AWB later by clicking "More actions" dropdown and selecting your AWB option (this uses the AWB URL registered with EasyStore)
📷 TODO: Add screenshot of the Fulfill button and app dropdown in admin panel

Debugging Tips

Common Issues

Issue Possible Cause Solution
Shipping rates not showing CURL endpoint not registered or returning errors Verify CURL registration and check endpoint logs
HMAC validation failing Incorrect app secret used for signature verification Double-check your app secret and HMAC calculation
Fulfillment iframe not loading X-Frame-Options header blocking iframe Allow framing from EasyStore domains
API calls timing out Endpoint response time exceeding 5 seconds Optimize your endpoint or implement caching

Logging Recommendations

  • Log all incoming requests from EasyStore with headers and payload
  • Log all API calls to your logistics platform
  • Log all responses sent back to EasyStore
  • Use request IDs to correlate logs across your system

Verifying HMAC Signature

Always verify the Easystore-Hmac-Sha256 header to ensure requests are genuinely from EasyStore:

// PHP Example
$payload = file_get_contents('php://input');
$hmac_header = $_SERVER['HTTP_EASYSTORE_HMAC_SHA256'];
$calculated_hmac = base64_encode(hash_hmac('sha256', $payload, $app_secret, true));

if (hash_equals($hmac_header, $calculated_hmac)) {
    // Request is valid
} else {
    // Request is invalid - reject it
    http_response_code(401);
    exit;
}
      

Next Steps

Review the Best Practices & FAQ to ensure your app follows recommended patterns.

icon-accounticon-add-newicon-add-storeicon-appicon-appleicon-archiveicon-arrowdownicon-ascicon-bookicon-cancelicon-cart-addonicon-checkouticon-cherryicon-collectionicon-comfirmicon-confirmicon-couponicon-creditsicon-currencyicon-dashboardicon-discounticon-disintegrateicon-domainicon-dscicon-duplicateicon-editicon-emailicon-exclamation-triangleicon-exporticon-eyeicon-eye-slashicon-fullscreenicon-fullscreen-closeicon-generalicon-gifticon-gridicon-hddicon-helpicon-importicon-infoicon-integrationicon-invoiceicon-likeicon-listicon-locationicon-logouticon-new-tabicon-not-secureicon-optionicon-ordericon-outline-arrowdownicon-pageicon-paymenticon-plusicon-posicon-pricingicon-printericon-producticon-product-sumicon-product-sum-xicon-redirecticon-reporticon-reseticon-searchicon-secureicon-settingicon-shippingicon-staricon-storeicon-switch-storeicon-tagicon-taxesicon-templateicon-themeicon-tickicon-trashicon-unarchiveicon-uploadicon-user-tagicon-usersicon-weighticon-wholesale