# ๐ณ Wava Payment Gateway for Botble โ by Codeupp
ย
> Accept real payments through **Wava** (Nequi, Daviplata, Breb, and Stripe card payments) directly in your Botble / Martfury / Shofy / Nest store โ with full **Test โ Live** mode switching from the admin panel.
ย
**Plugin ID:**`codeupp/wava`
**Namespace:**`Codeupp\Wava\`
**Install path:**`platform/plugins/WAVABYCODEUPP/`
ย
---
ย
## โจ Features
ย
- โ Full **Wava API v1** integration (`https://api.wava.co/v1` live + `https://api.dev.wava.co/v1` sandbox)
- โ **Admin-selectable Test / Live mode** from Payment Methods settings โ just like Stripe
- โ **Two integration modes** โ selectable per-store from the admin panel:
-**Option A โ Payment Links** (hosted checkout on `pay.wava.co`) โ simplest, requires `links` scope on your Wava key
-**Option B โ Direct API** (custom checkout on **your** site โ Nequi push / Daviplata OTP / Breb QR) โ requires `orders` scope
- โ Separate **Test Merchant Key** and **Live Merchant Key** fields
- โ Built-in **custom checkout form** for Direct API mode (Wava-branded, mobile-ready, standalone HTML โ no theme conflicts)
- โ Built-in **waiting page** with live status polling โ auto-detects gateway and renders:
-**Nequi** โ "Open your Nequi app" + spinner + masked phone
-**Daviplata** โ 6-digit OTP input with AJAX submission to `/orders/{id}/daviplata/otp`
-**Breb (Bre-B)** โ base64 QR code + transfer key
- โ Automatic **webhook handler** at `/payment/wava/webhook` (CSRF-exempt) for `order.confirmed`, `order.cancelled`, `order.refunded`, `order.failed`
- โ **Server-side verification** of every webhook via `GET /v1/orders/{id}` (never trust the payload alone)
- โ **Callback/return URL** handler at `/payment/wava/callback`
- โ **Refund** support from Botble admin โ Order detail โ Refund button
- โ **Idempotent** webhook processing using `id_external` (Botble order ID)
- โ Uses Wava's standardized error codes (`api_code`, `code`, `gateway_name`) for clear debug messages
- โ Auto-resized payment method **logo** on checkout (works with admin-uploaded logos of any size)
- โ Compatible with **Martfury, Shofy, Nest**, and every Botble theme
- โ Clean Botble design โ integrates as a native payment method alongside Stripe, PayPal, Tabby, Mollie, etc.
ย
---
ย
## ๐ฆ Installation
ย
1. Copy the `WAVABYCODEUPP` folder into `platform/plugins/` of your Botble installation.
2. Go to **Admin โ Platform Administration โ Plugins**.
3. Find **Wava Payment Gateway by Codeupp** and click **Activate**.
4. Go to **Admin โ Settings โ Payment Methods โ Wava** and configure:
-**Environment Mode** โ `Test` or `Live`
-**Integration Mode** โ `A) Payment Links` or `B) Direct API` (see below)
-**Test Merchant Key** (from Wava dev dashboard)
-**Live Merchant Key** (from Wava production dashboard)
- Optional: default `payment_gateway` ID (e.g. `1` = Nequi)
- Optional: default buyer country (ISO 2-letter, e.g. `CO`)
5. Copy the **Webhook URL** shown in the admin panel and paste it into
**Wava Dashboard โ Settings โ Integrations โ API โ Webhook URL**.
6. Enable the payment method (status = ON) and save.
ย
---
ย
## ๐ Integration Modes โ A vs B
ย
The plugin ships with **two complete integration flows**. You pick which one to use from the admin panel โ switching is instant, no code changes required.
ย
### ๐ Option A โ Payment Links (Hosted Checkout)
ย
The **simplest** flow โ Wava hosts the entire checkout UI for you.
ย
**Flow:**
1. Customer clicks **Place Order** with Wava selected
2. Plugin calls `POST /v1/links` to create a payment link
3. Customer is redirected to `https://pay.wava.co/{link_id}` (Wava-hosted checkout)
4. Customer picks **Nequi / Daviplata / Breb / Card** on Wava's page and completes payment
5. Wava redirects back to `/payment/wava/callback`
6. Plugin verifies + marks order as paid
ย
**Required Wava scope:**`links`
**Best for:** stores that want zero PCI/KYC handling on their own server.
ย
---
ย
### ๐ Option B โ Direct API (Custom Checkout on Your Site)
ย
A **fully branded** checkout experience โ customer never leaves your domain.
ย
**Flow:**
1. Customer clicks **Place Order** with Wava selected โ redirected to `/payment/wava/form/{orderId}` (your own domain)
2.**Custom checkout form** asks for:
- Payment method (Nequi / Daviplata / Breb โ auto-loaded from `GET /v1/orders/paymentGateways`)
- First name, Last name, Email, Phone (+57โฆ)
- Document type (CC / CE / TI from `GET /v1/national-document-types/CO`)
- National ID number
3. Plugin calls `POST /v1/orders` with the buyer data
4. Customer lands on `/payment/wava/waiting/{orderId}` โ a **live-polling page** that:
- For **Nequi** โ shows "Open your Nequi app" + spinner + masked phone
- For **Breb** โ renders the base64 QR code + transfer key from Wava response
- For **Daviplata** โ shows OTP input โ AJAX-submits to `POST /v1/orders/{id}/daviplata/otp`
5. JS polls `/payment/wava/status/{remoteOrderId}` every 3 s โ auto-redirects to checkout-success when Wava confirms
ย
**Required Wava scope:**`orders`
**Best for:** stores that want full brand control + a one-page checkout experience.
ย
---
ย
### Comparison
ย
| Feature | Option A (Links) | Option B (Direct API) |
|---|---|---|
| Setup difficulty | Easiest | Medium |
| Customer leaves your site? | Yes (to `pay.wava.co`) | **No** (custom form on your domain) |
| Branding control | Wava-branded | **Fully your brand** |
| Required Wava API scope | `links` | `orders` |
| Mobile UX | Excellent (Wava-optimized) | Excellent (responsive Bootstrap form) |
| Daviplata OTP handled by | Wava | This plugin |
| Breb QR rendered by | Wava | This plugin |
ย
---
ย
## ๐ API Keys โ where to get them
ย
| Mode | Endpoint | Dashboard |
|------|----------|-----------|
| **Test** | `https://api.dev.wava.co/v1` | [https://app.dev.wava.co](https://app.dev.wava.co) |
| **Live** | `https://api.wava.co/v1` | [https://app.wava.co](https://app.wava.co) |
ย
Get your `merchant-key` from **Settings โ Integrations โ API**.
ย
---
ย
## โ ๏ธ Wava Account Setup โ IMPORTANT
ย
A freshly-created Wava merchant key starts with **NO API scopes enabled**. Both integration modes will return `INSUFFICIENT_SCOPE` until Wava activates the required scopes on your key.
ย
**You must email `soporte@wava.co` and request scope activation:**
ย
```
Please enable the following scopes on our merchant key:
โ orders (for Direct API โ Option B)
โ links (for Payment Links โ Option A)
โ orders:refund (for admin refunds)
```
ย
Provide both your **sandbox** key (from `app.dev.wava.co`) and your **production** key (from `app.wava.co`). Wava typically responds within 1 business day.
ย
Until scopes are granted, the plugin code is fully functional โ but Wava's servers will refuse the API calls.
ย
---
ย
## ๐งช Testing (Sandbox)
ย
In **Test mode**, Wava simulates payments โ no real money is charged. Use these values:
ย
### Nequi
| Field | Test Value |
|-------|------------|
| Phone | `+573001234567` |
| Gateway ID | `1` |
ย
To confirm a Nequi sandbox order, Wava auto-confirms when you fetch it via `GET /v1/orders/{id}` โ the plugin's callback handler does this automatically.
ย
### Daviplata OTPs
| OTP | Result |
|-----|--------|
| `123456` | โ Success |
| `000000` | โ Success |
| `111111` | โ Success |
| `999999` | โ Invalid OTP |
ย
### Test documents
| Field | Value |
|-------|-------|
| National ID | `12345678` |
| Document Type | `1` (CC) / `2` (CE) / `3` (TI) |
ย
---
ย
## ๐ URLs registered by this plugin
ย
### Common (both modes)
ย
| Purpose | Route | URL |
|---------|-------|-----|
| Hosted-checkout callback | `payment.wava.callback` | `/payment/wava/callback` |
| Incoming webhook | `payment.wava.webhook` | `/payment/wava/webhook` |
| Test-connection button | `payment.wava.test-connection` | `/payment/wava/test-connection` |
ย
### Direct API mode only (Option B)
ย
| Purpose | Route | URL |
|---------|-------|-----|
| Custom checkout form | `payment.wava.form` | `/payment/wava/form/{orderId}` |
| Form submit | `payment.wava.form.submit` | `POST /payment/wava/form/{orderId}` |
| Waiting page | `payment.wava.waiting` | `/payment/wava/waiting/{orderId}` |
| Status polling (AJAX) | `payment.wava.status` | `/payment/wava/status/{remoteOrderId}` |
| Daviplata OTP submit | `payment.wava.daviplata-otp` | `POST /payment/wava/daviplata-otp/{remoteOrderId}` |
ย
The webhook URL is automatically shown inside the admin settings page โ just copy-paste it into Wava.
ย
---
ย
## ๐ Webhook events handled
ย
| Wava Event | Mapped Botble Status |
|------------|----------------------|
| `order.confirmed` | **COMPLETED** โ order marked paid |
| `order.refunded` | **REFUNDED** |
| `order.cancelled` | **FAILED** |
| `order.failed` | **FAILED** |
ย
Every webhook is **re-verified** against `GET /v1/orders/{id}` before the order is marked paid โ so spoofed webhooks are safely ignored.
ย
---
ย
## ๐๏ธ File Structure
ย
```
platform/plugins/WAVABYCODEUPP/
โโโ plugin.json
โโโ README.md
โโโ helpers/
โ โโโ constants.php
โโโ routes/
โ โโโ web.php
โโโ public/
โ โโโ images/
โ โโโ wava.svg
โโโ resources/
โ โโโ views/
โ โโโ methods.blade.php # checkout payment-row + auto-sized logo
โ โโโ detail.blade.php # admin order detail (payment info)
โ โโโ instructions.blade.php # admin settings instructions
โ โโโ checkout-form.blade.php # โ Option B custom checkout form (standalone)
โ โโโ waiting.blade.php # โ Option B waiting/polling page (Nequi / Daviplata / Breb)
โโโ src/
โโโ Plugin.php
โโโ Forms/
โ โโโ WavaPaymentMethodForm.php
โโโ Http/Controllers/
โ โโโ WavaController.php
โโโ Providers/
โ โโโ WavaServiceProvider.php
โ โโโ HookServiceProvider.php
โโโ Services/
โโโ Abstracts/WavaPaymentAbstract.php
โโโ Gateways/WavaPaymentService.php
```
ย
---
ย
## ๐ 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.
This item was featured on Marketplace.Codeupp.xyz