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
- Install your app to a development store
- Register your CURL endpoint using the API
- Go to the store's online storefront
- Add a product to cart and proceed to checkout
- 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
- 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
- Install your app to a development store
- Register your fulfillment URL with EasyStore team (email dev@easystore.co)
- Place an order from Online Store or manually create an order in admin panel
- Click the "Fulfill" button and select your app from the dropdown
- 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
- Display your fulfillment UI by returning a
linktype response - Fulfill the orders by:
- Creating shipment record in your logistics platform
- Creating fulfillment record in EasyStore via API
- 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)
- Merchants can also print AWB later by clicking "More actions" dropdown and selecting your AWB option (this uses the AWB URL registered with EasyStore)
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.