Loading

REST API · 2024

Multi-Provider Payment API

Unified payment solution combining 5 different crypto payment gateways under a single API

Year

2024

Type

REST API

Role

Backend Developer

Tech Stack

  • Python
  • Flask
  • REST API
  • CORS
  • JSON
NDAClient work. Source code for this project cannot be shared due to a non-disclosure agreement.

Project Summary

Multi-Provider Payment API is a unified payment solution that consolidates popular crypto payment gateways like Coinbase Commerce, Binance Pay, CoinGate, BitPay, and NOWPayments under a single RESTful API.

Frontend applications can use the same endpoint structure regardless of which gateway they prefer. The API standardizes payment initiation, status checking, cancellation, and webhook verification processes. With multi-currency support, payments can be accepted in popular cryptocurrencies like BTC, ETH, SOL.

Problem & Solution

Problem
  • Each gateway's API was different
  • Multiple integrations were required on the frontend
  • Webhook handling was complex
  • Adding new gateways was difficult
  • Error handling was inconsistent
Solution
  • Single unified API endpoint
  • Frontend integrates once for 5 gateways
  • Standard webhook verification
  • Modular gateway addition system
  • Consistent error response format

Key Features

01

Unified API

Single endpoint structure for 5 gateways. /process-payment/{provider} format.

02

Multi-Currency

BTC, ETH, SOL and more. Automatic rate calculation and conversion.

03

Webhook System

Provider-agnostic webhook verification. Signature verification and payload parsing.

04

Status Tracking

Real-time transaction status. Pending, completed, failed, cancelled states.

05

Cancel & Refund

Payment cancellation endpoint. Transaction lifecycle management.

06

Transaction Logging

In-memory transaction storage. Status history and audit trail.

API Endpoints

POST /process-payment/{provider}

Initiate payment. cardInfo, customerInfo, amount parameters. Provider: coinbase, binance, coingate, bitpay, nowpayments.

GET /check-status/{provider}/{txId}

Check transaction status. Returns status, paymentStatus, cryptoAmount, cryptoCurrency.

POST /cancel-payment/{provider}/{txId}

Cancel payment. Updates transaction status to cancelled.

POST /verify-webhook/{provider}

Verify webhook signature. Payload and signature validation.

Have a project? Let's talk.

Have a project in mind or a question about my work? Email or LinkedIn is the best way to reach me.