Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi/llms.txt

Use this file to discover all available pages before exploring further.

Payment in Panahashi is handled after an order is created. For cash orders, the backend creates the order and returns a QR code immediately — no extra payment step is needed. For card and PSE payments, the user is directed to PaymentScreen to complete the transaction before the confirmation screen appears.

Supported payment methods

MethodCode
Cash on pickupCASH_ON_PICKUP
Credit cardCREDIT_CARD
Debit cardDEBIT_CARD
PSE (bank transfer)PSE

Payment flow

1

Select method in cart

The user selects a payment method in CartScreen before placing the order. Cash on pickup skips PaymentScreen entirely and navigates directly to OrderConfirmationScreen.
2

Enter payment details

For CREDIT_CARD and DEBIT_CARD, PaymentScreen presents a card form with fields for card number (16 digits), cardholder name, expiry date (MM/YY), and CVV. A card preview updates as the user types.For PSE, no form is shown — the screen confirms that the bank transfer will be auto-approved in demo mode.
3

Submit payment

Tapping the pay button calls createPayment():
createPayment({ orderId, method, simulatedCardLast4 })
FieldTypeDescription
orderIdstringID of the order created in the previous step
methodstringPayment method code (e.g. CREDIT_CARD)
simulatedCardLast4stringLast 4 digits of the card number (card payments only)
4

Result

If payment.status === 'APPROVED', the user is taken to OrderConfirmationScreen with the order QR code. If the payment is declined, a native alert is shown and the user can try again.

Simulated card decline

Panahashi runs in demo mode — no real payment processor is used. The backend simulates approval and decline based on the last 4 digits of the card number passed in simulatedCardLast4.
In test mode, any card number ending in 0000 will be declined. Use a different ending to simulate approval.
This logic is documented in services/api.js:
// simulatedCardLast4: últimos 4 dígitos (solo para tarjeta)
//   → Si terminan en '0000' el pago es RECHAZADO (simulación)
PSE payments always succeed in demo mode regardless of input.

Checking payment status

To retrieve the payment record for a given order — useful in OrderDetailScreen to show payment method and approval status — use:
fetchPaymentByOrder(orderId)
This calls GET /payments/order/:orderId and returns the payment object including status (PENDING, APPROVED, REJECTED, or REFUNDED) and the payment method used.

Build docs developers (and LLMs) love