Odoo-Pelecard Payment Gateway Integration for Subscription Billing

Automating recurring subscription payments with secure, token-based transactions.

Pelecard Payment Gateway
Odoo-Pelecard Payment Gateway Integration for Subscription Billing

Overview

This case study outlines the development of a custom Pelecard payment provider module for Odoo, built to support automated recurring (subscription) billing. The integration connects Odoo's sales, invoicing, and subscription workflows to Pelecard's payment API, enabling tokenized card storage, scheduled monthly/weekly/yearly charges, and end-to-end payment reconciliation without manual intervention.

Business Challenge

The client needed subscription customers to be billed automatically on their renewal date, using a previously saved card, while remaining PCI-compliant by never storing raw card data in Odoo. The existing Odoo payment flow was designed around one-off checkout payments, not recurring token-based charges, so the standard subscription and invoicing pipeline had to be extended and rewired to work with Pelecard's specific API behavior.

Solution & Approach

The development was carried out iteratively, in close coordination with the client and Pelecard's API documentation, moving from a proof of concept to a fully automated recurring payment flow:

  • Built the initial payment flow to generate a Pelecard payment token from a first transaction, and stored the token, transaction ID, and confirmation key against Odoo's payment.token and payment.transaction models.
  • Implemented a scheduled action (cron) that scans active subscription orders, checks each subscription's next invoice date, and automatically generates the corresponding invoice.
  • Connected the generated invoice to its sale order and posted it automatically, then triggered a register payment call against Pelecard using the stored token removing the need for the customer to re-enter card details.
  • Added logic to compute the next invoice date correctly across monthly, weekly, and yearly subscription frequencies.
  • Implemented credit card expiry validation so that expired tokens are detected and excluded from further automatic charges.
  • Worked through Pelecard's different payment action types (J4 debit-regular and J5) to identify the correct method for recurring subscription charges, in consultation with the client.
  • Tested extensively using Pelecard's sandbox and client-provided dummy cards via Postman before wiring the same calls into Odoo.
  • Diagnosed and resolved a series of API-level issues including "necessary value missing", "general error / repeated action", masked card-number formatting, and transaction-amount validation errors — through documentation review and direct coordination with Pelecard support and the client.
  • Validated the complete flow end-to-end on the client's test/staging server, resolved an environment-specific issue not reproducible locally, and delivered a recorded walkthrough of the working module.

Key Technical Highlights

  • Tokenized, PCI-friendly recurring payments no raw card data stored in Odoo.
  • Automated invoice generation and posting tied to subscription renewal dates.
  • Support for multiple billing frequencies (monthly, weekly, yearly) with accurate next-invoice-date logic.
  • Card expiry checks to prevent failed charges on stale tokens.
  • Resolved cross-environment issues (local vs. server) to ensure production-grade reliability.

Outcome

The result is a working Pelecard subscription payment module for Odoo that automatically creates invoices, links them to sales orders, and completes payment using securely stored tokens — removing manual billing effort for recurring customers and giving the client a repeatable, auditable subscription payment flow integrated natively into Odoo.

Technology Stack

Odoo (Sales, Invoicing, Subscriptions), Pelecard Payment Gateway API, Python, Postman (API testing).

Need a Similar Odoo Integration

Talk to our Odoo team about connecting Pelecard, or any other payment gateway, with your Odoo records.

WhatsApp