Skip to content

YPTWallet Usage

Daniel Neto edited this page Oct 4, 2024 · 20 revisions

The YPTWallet Plugin acts as a virtual wallet where users can store credits to use on the AVideo platform. These credits can be spent using additional plugins, providing a useful solution to circumvent third-party fees. The YPTWallet plugin integrates seamlessly with PayPal and Stripe.

You can refer to the PayPalYPT plugin setup here and StripeYPT plugin setup here.


πŸ’° Adding Funds

Users can top up their wallets through various means. The site administrator has the option to approve or cancel the request manually. Once approved, the credits are automatically added to the user's wallet.

πŸ›  Configuration

  • decimalPrecision: Set the decimal precision of the currency used (e.g., 2 for USD).
  • wallet_button_title: The label for the wallet button at the top.
  • add_funds_text: Text displayed on the add funds page.
  • add_funds_success_success: Text displayed upon a successful funds addition.
  • add_funds_success_cancel: Text displayed when the user cancels adding funds.
  • add_funds_success_fail: Text displayed when funds addition fails.
  • addFundsOptions: A JSON array with value options for adding funds (e.g., [5,10,20,50]).

πŸ’Έ Withdrawing Funds

The Withdrawing Funds feature allows users to request withdrawals from their wallets, with the funds transferred manually by the administrator to their preferred payment method. This method is recommended for better control and security.

πŸ” Manual Withdrawals (Recommended)

  • How It Works: When users request a withdrawal, the amount is deducted from their wallet and marked as 'pending' until the admin processes the request manually.
  • Processing: The admin can either approve the request (and process the transaction) or cancel it, in which case the funds are refunded to the user's wallet.
  • Withdraw Options: The available withdrawal amounts are configurable using the withdrawFundsOptions parameter (e.g., [5,10,20,50,100,1000]).

πŸ€– Automatic Withdrawals (via PayPal)

  • How It Works: Automated withdrawals can be set up via PayPal, but both the admin and user must have valid PayPal accounts.
  • PayPal Setting: Enable this using enableAutoWithdrawFundsPagePaypal (default is false).

πŸ›  Configuration

  • withdraw_funds_text: Text displayed on the withdrawal request page.
  • withdraw_funds_success_success: Text displayed when a withdrawal request is successfully submitted.
  • withdraw_funds_success_fail: Text displayed if the withdrawal fails.
  • manualWithdrawFundsMenuTitle: Menu label for withdrawals.
  • manualWithdrawFundsPageButton: Button text for withdrawal requests.
  • manualWithdrawFundsNotifyEmail: Admin email for withdrawal notifications.

πŸ’² Virtual Currency

You can enable a virtual currency system within the platform. This currency will not directly correspond to real-world money but can be exchanged and displayed in the wallet.

πŸ›  Configuration

  • virtual_currency: Name of the virtual currency (e.g., HEART).
  • virtual_currency_symbol: Symbol of the virtual currency (e.g., ❀).
  • virtual_currency_exchange_rate: Defines how many virtual currencies equate to one real-world currency unit. For example, an exchange rate of 2 means 1 real currency = 2 virtual currencies.
  • virtual_currency_decimalPrecision: Decimal precision of the virtual currency. For instance, if set to 2.5, purchasing 2 units of real currency will be equivalent to 5 virtual currency units.
  • virtual_currency_enable: Boolean to enable or disable virtual currency. If set to false, this feature is disabled.

πŸ”§ Additional Configuration Options

  • showWalletOnlyToAdmin: Whether to show the wallet only to admins or selected user groups.
  • showWalletOnProfile: Option to display the wallet on the user's profile.
  • showWalletOnTopMenu: Display the wallet on the top menu bar.
  • CryptoWalletName: Label for cryptocurrency wallet (e.g., "Bitcoin Wallet Address").
  • CryptoWalletEnabled: Whether to enable cryptocurrency wallets (false by default).
  • hideTransferFunds: Hide the option to transfer funds between users.
  • hideConfiguration: Hide the configuration page for non-admin users.

πŸ”” Important Note on Payment Gateway Fees

When users add funds to their wallet via PayPal or Stripe, they will see the full amount added to their AVideo wallet. However, it's crucial to understand that payment gateways such as PayPal and Stripe typically charge a processing fee for handling transactions. The fees may vary depending on the location of the user or the specific agreement the website owner has with the payment gateway.

πŸ“Œ How Payment Gateway Fees Work

  • Example 1: Adding Funds via PayPal

    • If a user adds $10 to their AVideo wallet using PayPal, they will receive the full $10 credit in their AVideo wallet. However, PayPal might deduct 3% or $0.30 as a processing fee.
    • This means the website owner (you) will receive $9.70 in your PayPal account, while the user will still see $10 in their AVideo wallet.
  • Example 2: Adding Funds via Stripe

    • Suppose a user adds $50 via Stripe. Stripe might charge a processing fee of 2.9% plus $0.30.
    • In this case, the user will see the full $50 credited to their AVideo wallet, but the website owner will receive $48.25 after Stripe deducts its processing fees.
Clone this wiki locally