User to Bolbhav

This page describes how payments are made for purchasing membership plan in the Bolbhav App.

We are utilizing the PhonePe Payment Gateway to facilitate user payments for the Bolbhav App directly from their accounts.

For more information on how PhonePe is integrated into the Bolbhav app, visit the PhonePe page in Chapter 10 - SaaS Products

Membership Plan Purchase Page:

Payment scenarios

In the Bolbhav App, users can make payments to purchase Membership Plans. Each membership plan has associated tokens to grant. Once a membership plan is purchased, the corresponding tokens are added to the user wallet.

Active Membership Plans:

  1. 25-Day Plan:

    • Price: Rs. 100

    • Benefits: Offers 400 Silver Tokens

    • Availability: Available for purchase directly from Bolbhav or listed users.

    • Purpose: Designed for users or farmers who frequently check prices during the harvesting season or prefer not to use tokens on a per-usage basis. This plan provides convenience by offering a bulk amount of tokens for a fixed price.

  2. Yearly Plan:

    • Price: Exclusively available for purchase from Bolbhav (currently priced at Rs 1460)

    • Validity: 365 days

    • Purpose: Tailored for traders or users who rely on the Bolbhav app for daily price viewing. This plan eliminates the hassle of frequent token purchases and daily token deductions, offering a seamless experience for users who need tokens for daily use.

API endpoints used to initiate payments:

  1. Fetch PhonePe Payment Gateway Credentials: This API endpoint ({{base_url}}/get-payment-credentials) is utilized to retrieve payment credentials from the PhonePe payment gateway.

  2. Get Payment Payload for Plan Purchase: The API ({{base_url}}/get-payment-payload) is employed to obtain the payment payload for the plan to be purchased. This API returns the payment amount required for the specified plan.

  3. Check Payment Transaction Endpoint: The endpoint ({{base_url}}/payment-complete) serves the purpose of verifying payment transactions. It is used to ensure the completion and status of payment transactions.

These endpoints collectively facilitate the initiation, verification, and processing of payment transactions within the system.

Payment Workflow for the Yearly Plan:

  1. User Selection: The user selects the Yearly Plan option within the Bolbhav App.

  2. Redirect to Payment Gateway: Upon selection, the user is automatically redirected to the PhonePe Pay Page Screen, where they can proceed with the payment process.

  3. Payment Options: On the PhonePe Pay Page Screen, the user is presented with various payment options such as UPI Apps, Cards, and Net Banking.

  4. Payment Processing: The user selects their preferred payment method and completes the payment transaction.

  5. Payment Confirmation: Once the payment is successfully processed, the user receives a confirmation message or notification indicating the successful completion of the payment.

  6. Subscription Activation: After successful payment, the Bolbhav App automatically extends the user's subscription validity by 365 days, thereby activating the Yearly Plan subscription.

  7. Access Granted: The user now has full access to the features and benefits associated with the Yearly Plan for the next 365 days.

  1. Validity Date : User can verify the plan validity date in the profile screen

Note: For Yearly plan purchases, transactions are not processed through user wallets. Instead, users can review their payment history on the Payment Passbook page.

Endpoint Triggered: {{base-url}}/payment-passbook

Purpose of this API: This API retrieves all payment transactions completed by the user, providing comprehensive visibility into their financial activity

Payment Workflow for the Rs. 100 Membership Plan purchase:

  1. Plan Selection: Within the Membership Plan purchase screen, users have the option to choose between the Rs. 100 or Rs. 1460 plan.

  2. User's Choice: Upon selecting the Rs. 100 plan, users are prompted to choose whether to purchase from a listed user or directly from Bolbhav.

  3. Payment Gateway Integration: Upon selection of the preferred purchase option, users are directed to the PhonePe Pay Page Screen, where they can select their desired payment method, such as UPI or wallet apps.

  4. Transaction Logging: Upon opening the Pay Page, a transaction entry is recorded in the Payment Transaction Table, capturing user ID details and transaction specifics.

  5. Payment Processing: If the user successfully completes the payment, 400 silver tokens are credited to their account. In case of payment failure or pending status, the transaction details, including the reason for failure, are meticulously logged in the Payment Transaction Table. Silver tokens are not granted in these cases.

  6. Pending Payment Handling: In the event of pending status, a cron job continuously monitors payment statuses. Once payment is received or marked as complete, the user is granted the corresponding silver tokens.

  7. Listing Users' Participation: The inclusion of listed users in the subscription plan screen facilitates transactions within the user community. When a buyer purchases from a listed user, the payment initially goes to Bolbhav's account. After successful payment received, the seller user receives the plan amount via the RazorPayX Gateway, user receives payment from Bolbhav.

Logic to calculate users from which a buyer can purchase tokens

To determine eligible users from whom a buyer can purchase tokens, the following criteria are considered:

  1. Silver Token Balance: Only users with 1000 or more silver tokens are displayed.

  2. Profile Completion: Users must have completed their profile details, including name, address, profile image, and account information.

  3. Consent for Selling Tokens: Users who meet the above criteria can enable consent for selling silver tokens from the Silver Token Passbook screen.

Users meeting these criteria are showcased, ensuring transparency and facilitating token transactions within the community.

Criteria for displaying users to the buyers for purchasing silver tokens

  1. The highest contributor in the mandi, viewed by the buyer in descending order from the most viewed mandi to the least viewed mandi

Database transactions between a buyer and Bolbhav

  1. When a buyer selects a membership plan and initiates a payment transaction, Bolbhav records the transaction details in the payment_transaction table within its database.

  2. The payment_transaction table maintains a comprehensive record of all payment transactions between buyers and Bolbhav.

  3. Users can access their payment transaction history via the "My Payments" screen.

  4. The transaction history provides users with a detailed overview of past transactions, including:

    • Transaction Date: The date and time when the transaction occurred.

    • Amount: The monetary value associated with the transaction.

    • Payment Status: Indicates whether the payment was successful, pending, or failed.

  5. Bolbhav promotes transparency and accountability by providing users with access to their transaction history.This access empowers users to effortlessly monitor their payment activities.

  6. Users can stay updated on the status of their transactions through this feature.

  7. For the Rs. 100 plan, upon successful payment, an entry is logged in the wallet ledger, specifically against the user's membership wallet, which is their silver token wallet. Here's how the entry is recorded in the wallet_ledgers table:

    • Source Wallet ID: The Buyer membership wallet ID is designated as the source.

    • Target Wallet ID: The bank's membership wallet ID serves as the target.

    • Amount: The amount credited to the membership wallet corresponds to the credit associated with the membership plan. For Rs. 100, the credit amount is 400 tokens.

    • Reason: The reason field indicates the purpose of the transaction, specifying the membership plan purchased with money. This could be formatted as {membership_plan_id} purchased by money (e.g., new_unique_days_100 purchased by money).

    • Ref ID: A unique identifier is generated to reference the payment transaction, typically in the format of payment_transaction_id_{payment_transaction.id} (e.g., payment_transaction_id_198).

  8. When a user purchases a plan from another Bolbhav user through successful payment, the transaction involves debiting tokens from the seller user's membership wallet and crediting them to the buyer user's membership wallet. Simultaneously, the payout amount equivalent to the membership plan purchased is credited to the seller user's account and payback wallet briefly described in this page

It's important to note that for the Yearly Membership plan, no wallet ledger entries are made, as this plan does not involve credit transactions with tokens.

To do:

  1. Details about the different transaction status for yearly plan purchase show in Meri Payment section

  2. Pop up box displayed (screen shot and description) when yearly plan purchase transaction failure occurs

  3. Need to add scenario where silver tokens are reduced from the user account, but money is not received in his account, then silver tokens are reverted back to his wallet

  4. Pop up box displayed (screen shot and description) when failure occurs in purchasing silver token from the user

Last updated