Skip to main content

Payments

Payments - Functional flow

  1. Customer clicks the "Buy" button on a website or app, triggering an event in the frontend.
  2. Frontend captures customer and order details, such as product information, price, and user information.
  3. Frontend sends a request to the backend server to initiate the payment process.
  4. Backend server receives the request and validates the order details, ensuring the data is accurate and complete.
  5. Backend server creates a payment intent or token via the payment gateway's API, passing in the necessary order details (e.g., Stripe or Square API).
  6. Payment gateway API returns a unique token or intent ID, representing the payment information securely.
  7. Backend server sends the token or intent ID back to the frontend.
  8. Frontend securely embeds the token or intent ID in the payment form, ensuring sensitive information is not exposed.
  9. Customer enters their payment information, such as credit card number, expiration date, and CVV, in the payment form.
  10. Frontend submits the form, sending the payment information along with the token or intent ID to the payment gateway.
  11. Payment gateway processes the transaction by authenticating the customer's payment information, performing fraud checks, and verifying the funds' availability.
  12. If necessary, the payment gateway routes the transaction to the acquiring bank (the merchant's bank) for further processing.
  13. Acquiring bank forwards the transaction to the issuing bank (the customer's bank) via card networks (e.g., Visa, Mastercard, etc.).
  14. Issuing bank validates the transaction, verifies the funds, and either approves or declines the transaction.
  15. Issuing bank sends the transaction response (approved or declined) back to the acquiring bank.
  16. Acquiring bank relays the transaction response to the payment gateway.
  17. Payment gateway sends the transaction response to the backend server.
  18. Backend server processes the response, updating the order and payment status accordingly (e.g., marking the order as paid or informing the customer of a declined transaction).
  19. Backend server sends a confirmation or error message to the frontend, depending on the transaction response.
  20. Frontend displays the appropriate message to the customer, confirming the successful purchase or prompting them to try again in case of a declined transaction.

Payment Features

1. Authentication:

  • Securely authenticate API requests using API keys, OAuth tokens, or other authentication mechanisms.

2. Discounts/Coupons:

  • Apply discounts or coupon codes to reduce the order amount or offer special promotions.

3. Shipping fees:

  • Calculate and include shipping costs based on delivery address, shipping method, and product weight/dimensions.

4. Taxes:

  • Calculate and apply appropriate sales tax, VAT, or other taxes based on the customer's location and applicable regulations.

5. Currency conversion:

  • Support multi-currency transactions and automatic currency conversion based on current exchange rates.

6. Payment methods:

  • Accept various payment methods, such as credit/debit cards, digital wallets, bank transfers, and cryptocurrencies.

7. Subscription billing:

  • Manage recurring payments and subscriptions with options for trial periods, billing intervals, and flexible pricing.

8. Refunds:

  • Process full or partial refunds, including the ability to issue refunds automatically or manually.

9. Fraud prevention:

  • Implement fraud detection and prevention mechanisms, such as risk scoring, address verification, and 3D Secure.

10. Custom metadata:

  • Allow attaching custom metadata to transactions for better tracking, reporting, and analysis.

11. Webhooks:

  • Send event-driven notifications to configured endpoints for real-time updates on payment events, such as successful payments or failed transactions.

12. Customer profiles:

  • Manage customer information, including payment methods, addresses, and preferences, for a smoother checkout experience.

13. Reporting and analytics:

  • Access detailed transaction reports, payment summaries, and analytical insights to monitor performance and optimize the payment process.

14. Invoice generation:

  • Automatically generate and send invoices to customers via email or other communication channels.

15. Payment plans:

  • Offer flexible payment plans, such as installment plans or pay-later options, to customers during the checkout process.

16. Split payments:

  • Enable splitting payments between multiple parties, such as merchants and affiliates, or handling marketplace transactions.

17. Tokenization:

  • Securely store sensitive payment information using tokens, reducing PCI compliance requirements and enhancing security.

18. Internationalization:

  • Support localization features, such as displaying prices in local currencies, language translations, and regional tax rules.

19. Error handling:

  • Provide detailed error messages and appropriate status codes for easy identification and resolution of issues during the payment process.

20. API rate limiting:

  • Implement rate limiting and throttling mechanisms to ensure fair usage of the API and prevent abuse or performance issues.

21. Customizable checkout:

  • Offer customizable checkout experiences, including the ability to add branding, modify UI elements, and integrate custom functionality.

22. Card updater:

  • Automatically update expired or changed card details for customers with saved payment methods, reducing the risk of failed transactions.

23. Saved cards:

  • Allow customers to save their card information for faster and more convenient future transactions.
  • Generate and share unique payment links for customers to complete transactions without the need for a full checkout process.

25. Pre-authorization:

  • Reserve funds on a customer's card without charging them immediately, allowing for delayed captures or adjustments to the transaction amount.

26. Partial captures:

  • Support partial captures for situations where only a portion of the authorized amount needs to be charged (e.g., backordered items).

27. Void transactions:

  • Cancel authorized transactions that have not yet been captured, releasing the reserved funds back to the customer.

28. Delayed settlements:

  • Delay the transfer of funds to the merchant account, providing time for additional checks or verifications.

29. Account updater:

  • Automatically update customers' saved payment methods when they receive a new card or their card information changes.

30. Level 2/3 processing:

  • Support enhanced data processing for business-to-business (B2B) transactions, potentially lowering interchange fees and improving reporting.

31. Chargebacks and disputes:

  • Handle chargeback and dispute processes, providing merchants with tools to contest and resolve customer claims.

32. Payouts:

  • Automate and manage payouts to merchants or other recipients, including options for scheduling, batching, and customizing payout amounts.

33. Recurring billing reminders:

  • Send notifications to customers before their recurring payments are due, helping to reduce chargebacks and improve customer satisfaction.

34. Multi-account management:

  • Manage multiple merchant accounts or sub-accounts under a single API integration, simplifying the management of multi-store or multi-vendor platforms.

35. ACH processing:

  • Accept Automated Clearing House (ACH) payments, enabling customers to pay directly from their bank accounts.

36. Gift cards:

  • Support the integration and management of gift cards as a payment method, including balance inquiries, redemptions, and reloads.

37. Mobile SDKs:

  • Offer mobile software development kits (SDKs) for seamless integration of the payment API into native mobile apps.

38. Payment Request API:

  • Leverage the Payment Request API to simplify the checkout process for users on supported browsers and platforms.

39. Compliance and regulatory support:

  • Provide tools and resources to help merchants comply with industry regulations, such as PCI DSS, GDPR, and PSD2.

40. Sandbox environment:

  • Offer a sandbox environment for developers to test and experiment with the API without affecting real transactions or incurring fees.