# Foxmayn Shopify Pay: COD and card checkout for Algeria

> Payment and shipping middleware for Algerian Shopify stores: cash on delivery with phone confirmation, Chargily cards and Yalidine delivery. Live at Cosmekarn.

Updated: 2026-10-27

- **Details:** Foxmayn Shopify Pay
- **Client:** Cosmekarn
- **Year:** 2026
- **Status:** Live pilot
- **Stack:** TypeScript, Hono, PostgreSQL, Shopify, Chargily, Yalidine

## The problem

Shopify does not ship with the payment and delivery methods that Algerian shoppers use. Most customers want to pay cash on delivery. Others want to pay online with a CIB or Edahabia card. Delivery goes through local carriers such as Yalidine, to the home or to a stop desk.

Cash on delivery has a cost. Parcels that nobody confirmed come back, and a returned parcel is paid for twice. So stores call each customer before shipping. That call usually lives in a notebook or a chat thread, separate from the order.

Cosmekarn, an Algerian cosmetics store on Shopify, needed all of this in one flow.

## What we built

Foxmayn Shopify Pay (FSP) is payment and shipping middleware for Shopify stores in Algeria. It has three parts.

- **A backend** that handles payments, shipping and orders for several merchants.
- **An admin dashboard** with merchants, transactions, shipping and reconciliation.
- **A Shopify app, "Foxmayn Pay",** embedded in the Shopify admin, with a custom checkout extension.

It supports:

- Cash on delivery.
- Online card payment through Chargily (CIB and Edahabia).
- Yalidine delivery, to the home or to a stop desk, plus manual shipments.
- Confirmation of every cash-on-delivery order by a person, before the parcel is created.

## How it works

For a card payment, the checkout creates a Shopify draft order and sends the customer to Chargily. When Chargily confirms the payment, FSP completes the draft order in Shopify. For cash on delivery, the order waits for a confirmation call. The system will not create a parcel for a cash-on-delivery order until a person has confirmed it.

The backend is TypeScript on Node 24 with Hono and Drizzle ORM over PostgreSQL. The server keeps no session state. One image runs the server and a scheduled worker, with Postgres behind it. Each merchant gets its own Shopify custom app, and each merchant's credentials are encrypted with AES-256-GCM using a separate nonce for every row. The embedded app uses React Router v7 and Prisma.

Gateways and carriers sit behind registries. This keeps each gateway and carrier in its own module.

## Where it stands

FSP is live at Cosmekarn and takes real orders. The merchant has been active since 26 July 2026, and the Yalidine provider is enabled and syncing for it.

By October 2026, FSP had carried thousands of orders from checkout to Shopify, most of them paid cash on delivery and the rest by card through Chargily. Cosmekarn is the first live merchant.

Direct SATIM and CIB payment is registered in the code, but it is not accepted live. Card payments run through Chargily.

## What we learned

**Test before launch, and audit.** The backend has hundreds of automated tests, including end-to-end tests with the outside services mocked. Before launch, we ran a full security audit of the code and fixed its critical and high findings before real money depended on it.

**Keep people in the loop.** The confirmation call is a business rule. Putting it inside the system, in front of the parcel step, is what makes the rest safe to automate.

## Next

More carriers, and more Algerian Shopify stores. If you run a Shopify store in Algeria, see our [other Algerian products](https://foxmayn.com/en/dz) or [read about Foxmayn Track](https://foxmayn.com/en/dz/work/track), our delivery-note tracking, also live at Cosmekarn.

---
Contact: foxmayn@protonmail.com · https://foxmayn.com/en/dz#contact
HTML: https://foxmayn.com/en/dz/work/shopify-pay · [fr](https://foxmayn.com/fr/dz/work/shopify-pay.md) · [ar](https://foxmayn.com/ar/dz/work/shopify-pay.md)
