The Payments API processes payments for orders using a simulated payment engine — no real card processing occurs. CASH_ON_PICKUP orders are always approved instantly; card and PSE payments simulate approval or rejection based on the card number provided.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi-Backend/llms.txt
Use this file to discover all available pages before exploring further.
Payment simulation rules
| Method | Behavior |
|---|---|
CASH_ON_PICKUP | Always APPROVED immediately |
Any card not ending in 0000 | Always APPROVED |
Card ending in 0000 | Always REJECTED |
PSE | Always APPROVED |
Payment object
Unique payment ID.
Associated order ID.
Firebase UID of the payer.
Amount charged.
Payment method used.
One of:
PENDING, APPROVED, REJECTED, REFUNDED.Last 4 digits of the simulated card (for card payments).
Epoch ms.
Epoch ms.
POST /api/v1/payments
Creates and processes a payment for an order. The order must belong to the authenticated user and must not already be paid. Auth required: Yes — CUSTOMERID of the order to pay for.
Payment method:
CREDIT_CARD, DEBIT_CARD, PSE, or CASH_ON_PICKUP.Last 4 digits of card (required for card methods). Use
0000 to simulate rejection.When a payment is approved, the baker receives an FCM notification for non-CASH orders. When rejected, the customer receives a rejection notification and the response HTTP status is 402 Payment Required.
GET /api/v1/payments/order/
Returns the payment record for an order. Auth required: Yes (any authenticated user)Order ID.
POST /api/v1/payments/order//refund
Refunds a payment. Sets both the payment and order toREFUNDED status.
Auth required: Yes — ADMIN
Order ID to refund.