# π³ Wompi Payment Gateway for Botble β by Codeupp
Β
> Accept real payments through **Wompi** (Nequi, Bancolombia Transfer, PSE, Daviplata, Cards) directly in your Botble / Martfury / Shofy / Nest store β with full **Test β Live** mode switching and secure webhook signature verification.
Β
**Plugin ID:**`maryam/wompi-pro`
**Namespace:**`Maryam\WompiPro\`
**Install path:**`platform/plugins/wompi/`
**Brand:** Maryam International LLC Β· [codeupp.xyz](https://codeupp.xyz)
Β
---
Β
## β¨ Features
Β
- β Full **Wompi Colombia API v1** integration (`https://production.wompi.co/v1`)
- β Multi-country support: **Colombia** (primary), **El Salvador**, **PanamΓ‘**
- β **Admin-selectable Test / Live mode** from Payment Methods settings β no code changes
- β Separate **Test** and **Live** API key fields (Public Key, Private Key, Events Secret, Integrity Secret)
- β **TWO checkout modes** β switch any time from admin (see below):
- π **Payment Link** β customer redirected to Wompi hosted checkout
- πͺ **Web Checkout Widget β auto-redirect** β modal opens on YOUR site, redirects automatically after payment (no "Volver al comercio" click needed)
- β Automatic **webhook handler** at `/payment/wompi/webhook` (CSRF-exempt) for `transaction.updated`
- β **SHA-256 signature verification** of every webhook per [official Wompi spec](https://docs.wompi.co/docs/colombia/eventos/) β spoofed webhooks are rejected
- β **Server-side re-verification** of every event via `GET /v1/transactions/{id}` (defense in depth)
- β **Callback / return URL** handler at `/payment/wompi/return` β handles Wompi's `?id=&env=` query params
- β **Idempotent** processing β no duplicate order updates, even if Wompi retries the webhook
- β Marks **APPROVED β COMPLETED**, **DECLINED / ERROR / VOIDED β FAILED**, **PENDING β unchanged**
- β **Triple-redundant order confirmation** β webhook + browser polling + customer return all converge idempotently
- β **Rate-limited polling endpoint** (60 req/min) prevents abuse
- β Detailed logging at every step for easy debugging
- β Compatible with **Martfury, Shofy, Nest**, and every Botble theme
- β Clean Botble design β integrates as a native payment method alongside Stripe, PayPal, Wava, etc.
Β
---
Β
## π― Two Checkout Modes β Choose Per-Store
Β
The plugin offers two officially-supported Wompi checkout flows. **Switch any time** from `Admin β Payment Methods β Wompi β Checkout Mode (Colombia)`.
Β
### Option 1 β π Payment Link (default)
Β
```
Customer clicks "Place Order"
β fully redirected to checkout.wompi.co/l/{link}
β picks payment method (Nequi / PSE / Bancolombia / Card / Daviplata)
β completes payment
β clicks "Volver al comercio" β returns to your store β success page
```
Β
**Pros:** Maximum compatibility. Works for every Wompi merchant out-of-the-box. Only Public Key + Private Key + Events Secret needed.
Β
**Cons:** Customer leaves your branded site during payment. Requires one click on "Volver al comercio" to return.
Β
---
Β
### Option 2 β πͺ Web Checkout Widget (auto-redirect)
Β
```
Customer clicks "Place Order"
β stays on your site β Wompi modal opens INSIDE your branded page
β completes payment in modal
β page AUTO-REDIRECTS to success page within 3 seconds β NO CLICK NEEDED β¨
```
Β
**How auto-redirect works:** the page polls our backend every 3 seconds. As soon as Wompi reports the transaction `APPROVED`, the browser is redirected to the order success page β bypassing the manual "Volver al comercio" click that all standard Wompi integrations require.
Β
**Pros:** Customer never visually leaves your site. True one-step checkout. Higher conversion.
Β
**Cons:** Requires the **Integrity Secret** to be configured (one extra key from Wompi dashboard). Available for Colombia only.
Β
---
Β
### Which should I pick?
Β
| Need | Recommended |
|---|---|
| Fastest setup, Wompi El Salvador / PanamΓ‘ | **Payment Link** |
| Best customer experience, Colombia | **Web Checkout Widget** |
| Maximum reliability across edge cases | **Either β both are battle-tested** |
Β
No code change needed to switch β just toggle the dropdown and save.
Β
---
Β
## π¦ Installation
Β
1. Copy the `wompi` folder into `platform/plugins/` of your Botble installation.
2. Go to **Admin β Platform Administration β Plugins**.
3. Find **Wompi Payment Gateway by Codeupp** and click **Activate**.
4. Go to **Admin β Settings β Payment Methods β Wompi** and configure:
-**Country** β `Colombia` (or El Salvador / PanamΓ‘)
-**Environment Mode** β `Test` or `Live`
-**Test Public Key** (`pub_test_β¦`)
-**Test Private Key** (`prv_test_β¦`)
-**Test Events Secret** (`test_events_β¦`) β **CRITICAL β webhooks rejected without it**
-**Live Public Key** (`pub_prod_β¦`)
-**Live Private Key** (`prv_prod_β¦`)
-**Live Events Secret** (`prod_events_β¦`)
5.**Pick your Checkout Mode** β Payment Link (default) or Web Checkout Widget.
- For Widget mode, also fill the **Integrity Secret** field (`test_integrity_β¦` / `prod_integrity_β¦`).
6. Copy the **Webhook URL** shown in the admin instructions and paste it into
**Wompi Dashboard β Developers β Events URL**.
7. Enable the payment method (status = ON) and save.
Β
---
Β
## π Where to find your Wompi keys
Β
Login to [comercios.wompi.co](https://comercios.wompi.co) β **Developers β Secrets for technical integration**.
Β
| Key | Test prefix | Live prefix | Purpose |
|---|---|---|---|
| Public Key | `pub_test_β¦` | `pub_prod_β¦` | Read-only API + frontend widget |
| Private Key | `prv_test_β¦` | `prv_prod_β¦` | **Create Payment Links** (server-side only) |
| Events Secret | `test_events_β¦` | `prod_events_β¦` | **Verify webhook signatures** |
| Integrity Secret | `test_integrity_β¦` | `prod_integrity_β¦` | Optional, for on-site Web Checkout widget |
Β
> β οΈ Keep Private Key and secrets server-side only. Never expose them in frontend code.
Β
---
Β
## π URLs registered by this plugin
Β
| Purpose | Route name | URL |
|---------|-----------|-----|
| Hosted-checkout return | `wompi.return` | `/payment/wompi/return` |
| Incoming webhook | `wompi.webhook` | `POST /payment/wompi/webhook` |
| Web Checkout Widget renderer | `wompi.widget` | `/payment/wompi/widget/{token}` |
| Status polling (auto-redirect) | `wompi.check_status` | `/payment/wompi/check-status/{token}` |
| AJAX create payment (legacy) | `payments.wompi.create` | `POST /payment/wompi/create` |
Β
---
Β
## π Webhook events handled
Β
| Wompi Event | Wompi Status | Mapped Botble Status |
|------------|------|----------------------|
| `transaction.updated` | `APPROVED` | **COMPLETED** β order marked paid |
| `transaction.updated` | `DECLINED` | **FAILED** |
| `transaction.updated` | `ERROR` | **FAILED** |
| `transaction.updated` | `VOIDED` | **FAILED** |
| `transaction.updated` | `PENDING` | (no change β wait for next event) |
Β
Every webhook is **re-verified** twice:
1.**HMAC SHA-256** signature check using your Events Secret
2.**Server-fetch** of the transaction via `GET /v1/transactions/{id}` to confirm the data
Β
Spoofed or tampered webhooks are rejected.
Β
---
Β
## π§ͺ Testing (Sandbox)
Β
Use Wompi sandbox keys (`pub_test_β¦` / `prv_test_β¦`) and place a test order.
Β
Wompi test cards:
Β
- β APPROVED β `4242 4242 4242 4242`, any expiry / CVC, cardholder name `APROBADA`
- β DECLINED β cardholder name `RECHAZADA`
- β οΈ ERROR β cardholder name `ERROR`
Β
### Payment Link mode test flow
1. Customer redirected to `checkout.wompi.co/l/{link}`
2. Pays β clicks "Volver al comercio"
3. Lands on `/payment/wompi/return?id=<txn>&env=test` β order marked completed
4. Webhook also fires server-side as backup
Β
### Web Checkout Widget mode test flow
1. Customer stays on `/payment/wompi/widget/{order_token}` page
2. Wompi modal opens automatically on your site
3. Customer pays in modal
4. Within 3 seconds polling detects APPROVED β page auto-redirects to success β¨
5. Webhook also fires server-side as backup
Β
Check `storage/logs/laravel.log` β every step is logged with `[WOMPI]` prefix for easy debugging.
Β
---
Β
## π Troubleshooting
Β
| Symptom | Cause | Fix |
|---|---|---|
| Customer pays but order stays "Pending" | Webhook blocked / events_secret missing | Verify webhook URL in Wompi dashboard + Events Secret in admin |
| `Wompi rejected the request: invalid public key` | Wrong key for environment | Make sure you're using `prv_test_*` for Test mode, `prv_prod_*` for Live |
| `Wompi webhook signature mismatch` | Wrong Events Secret | Re-copy from Wompi dashboard β Developers β Events Secret |
| `Order not found for Wompi reference` | Test data with stale `reference` | Place a fresh order β `reference = order.token` is unique per order |
| 419 errors in logs on webhook | CSRF middleware enabled on webhook | Already fixed β clear route cache: `php artisan route:clear` |
| **Widget mode**: "Wompi Integrity Secret is required" | Integrity Secret field empty | Paste `test_integrity_β¦` / `prod_integrity_β¦` from Wompi dashboard |
| **Widget mode**: 422 init error / modal won't open | Reused order reference (already paid in Wompi) | Place a fresh order β plugin auto-detects existing tx and redirects to /return |
| **Widget mode**: page doesn't auto-redirect | `findTransactionByReference` 401 / Private Key missing | Make sure Private Key (`prv_test_β¦` / `prv_prod_β¦`) is filled β the polling lookup requires it |
| Settings dropdown reverts after save | Old plugin version (pre-2.0) | Update to latest β fixed via `selected` attribute |
Β
---
Β
## ποΈ File Structure
Β
```
platform/plugins/wompi/
βββ plugin.json
βββ composer.json
βββ README.md
βββ helpers/
β βββ constants.php
βββ routes/
β βββ web.php
βββ public/
β βββ images/
β βββ wompi.png
βββ resources/
β βββ lang/
β β βββ en/
β β βββ es/
β β βββ wompi.php
β βββ views/
β βββ methods.blade.php # checkout payment-row
β βββ detail.blade.php # admin order detail (transaction info)
β βββ instructions.blade.php # admin settings instructions
β βββ email.blade.php
β βββ payments.blade.php
βββ src/
βββ Plugin.php
βββ Forms/
β βββ WompiPaymentMethodForm.php # admin form: keys, mode, country
βββ Http/
β βββ Controllers/
β β βββ WompiController.php # return + webhook + create
β βββ Requests/
β βββ WompiPaymentCallbackRequest.php
βββ Providers/
β βββ WompiServiceProvider.php
β βββ HookServiceProvider.php # filters + CSRF exemption
βββ Services/
βββ Abstracts/
β βββ WompiPaymentAbstract.php
βββ Gateways/
βββ WompiPaymentService.php # country router
βββ WompiColombiaService.php # β Colombia (full implementation)
βββ WompiElSalvadorService.php
βββ WompiPanamaService.php
```
Β
---
Β
## π Migrating from earlier versions (1.x β 2.0)
Β
This v2.0 release rewrites the Colombia integration. **No data migration needed** β but you must:
Β
1. After upgrade, go to **Admin β Payment Methods β Wompi** and re-enter your keys in the new fields:
- Old `Client ID` β paste into **Test/Live Public Key** (depending on environment)
- Old `Client Secret` β paste into **Test/Live Private Key**
- Add the new **Events Secret** (CRITICAL for webhooks)
2. Save settings.
3. Run `php artisan route:clear && php artisan view:clear`.
Β
The old `client_id` and `client_secret` keys are still read as fallback β but you should migrate to the new, properly-named fields for clarity and security.
Β
---
Β
## π Why Choose Maryam International LLC
Β
**We are a registered professional software company based in the UAE**, specializing in building world-class digital products for businesses that refuse to settle for average.
Β
### π Technologies We Master
Β
-**Frontend**: React, Next.js, Vue.js, Nuxt.js, Angular, Svelte, HTML5, CSS3, SASS, Tailwind CSS, Bootstrap
-**Languages**: JavaScript, TypeScript, PHP, Python, Go, Ruby, Java, Kotlin, Swift, Dart, C#, C++, Rust
-**Backend**: Laravel, Node.js, Express, NestJS, Django, FastAPI, Flask, Spring Boot, .NET, Ruby on Rails
-**Mobile**: Flutter, React Native, Swift (iOS), Kotlin (Android), Ionic
-**CMS & E-commerce**: Botble CMS, WordPress, Shopify, WooCommerce, Magento, Prestashop
-**Databases**: MySQL, PostgreSQL, MongoDB, Redis, SQLite, Firebase, Supabase
-**DevOps & Cloud**: AWS, Google Cloud, Azure, DigitalOcean, Docker, Kubernetes, CI/CD, Nginx, Apache
-**AI / ML**: OpenAI, LangChain, TensorFlow, PyTorch, HuggingFace, custom LLM integrations
-**Blockchain / Web3**: Solidity, Ethereum, Smart Contracts, NFT marketplaces, crypto payment gateways
-**Design**: Figma, Adobe XD, Photoshop, Illustrator, UI/UX strategy
Β
### πΌ What We Build
Β
- Custom e-commerce platforms and marketplaces
- SaaS products & startup MVPs
- Mobile apps (iOS + Android)
- Progressive Web Apps
- Custom CMS plugins & extensions
- Payment gateway integrations
- AI-powered chatbots & automation
- Blockchain dApps & crypto platforms
- Enterprise dashboards & admin panels
- API development & third-party integrations
Β
### π Why Hire Us
Β
- β **Registered, professional UAE-based company** β real accountability, real contracts, real delivery.
- β **Your satisfaction is our top priority** β we revise until you smile.
- β **We can build anything you imagine** β if you can describe it, we can ship it.
- β **Full-stack mastery** β one team, one invoice, end-to-end delivery.
- β **Fast, transparent communication** in English, Hindi, Urdu and Arabic.
- β **Post-launch support included** β we don't disappear after going live.
- β **Competitive pricing** for enterprise-grade quality.
Β
---
Β
## π Contact Us β Let's Build Something Incredible
Β
-**Company:** Maryam International LLC
-**Website:** [https://codeupp.xyz](https://codeupp.xyz)
-**Email:** [maryaminternationalllc@gmail.com](mailto:maryaminternationalllc@gmail.com) Β· [codeupp.xyz@gmail.com](mailto:codeupp.xyz@gmail.com)
-**WhatsApp:** [+971 55 368 2656](https://wa.me/971553682656)
-**Based in:** United Arab Emirates π¦πͺ
-**Serving:** Worldwide π
Β
>**Have an idea? Send us a WhatsApp. We reply within minutes, not days.**
Β
---
Β
## π‘οΈ License & Support
Β
This plugin is a premium product by **Maryam International LLC**.
Purchase includes:
Β
- βοΈ Lifetime updates
- βοΈ 6 months of priority support
- βοΈ Free installation help via WhatsApp
- βοΈ Compatibility guarantee across Martfury, Shofy, Nest & future Botble releases
Β
**Your success is our signature.**
Β
---
Β
**Β© Maryam International LLC β [codeupp.xyz](https://codeupp.xyz)**
*Your satisfaction is our top priority. We can build anything you imagine.*
Β
Have doubt? Contact us on WhatsApp
Our product is high quality. Contact us for any kind of custom work.