Wallet Download 9.6

This component/theme works with latest OSSN version.
5.0
Indonesian Arsalan Shah 4 years ago

A general-purpose wallet system for users, allowing them to add balance to their account. The site administrator can utilize the user's wallet balance through a set of available APIs.

  • Supported Payment Method: PayPal/Stripe/Iyzipay
  • Minimum Deposit: The minimum allowed deposit is 10.
  • Currency: The default currency is USD (editable in ossn_com.php).
  • Amount Format: Amount example 10, 20, 10.5, 5.50 etc

πŸ” Seamless Payments (Stripe Only)

Wallet now supports seamless payments, allowing users to securely save their card for future charges. This feature is only available when Stripe is configured as the payment gateway. The card is blocked after 3 failed attempts and admin need to delete card before user can add same card or new card. Make sure you disable Stripe Link integration https://support.stripe.com/questions/how-to-turn-off-link

πŸ“§ Transaction Notifications

Users receive email notifications for every credit or debit transaction, including both successful and failed attempts.

βš™οΈ Configuration Constants

Tax collection is possible in settings only if you have configured to card stripe, and configured tax in stripe.

define('WALLET_CURRENCY_CODE', 'USD');         // Your 3-letter currency code (e.g., USD)
define('WALLET_MINIMUM_LOAD', 10);             // Minimum wallet load (integer only)
define('WALLET_SEAMLESS_CHARGE', 1);           // Minimum charge to store card for seamless payments

API ENDPOINTS

βž– Debit

CURL https://www.yourwebsite.com/api/v1.0/wallet/debit

βž• Credit

CURL https://www.yourwebsite.com/api/v1.0/wallet/credit

πŸ“₯ Parameters & Responses

Parameter Type Description Required
api_key_token string Your API token Yes
guid integer User GUID Yes
amount float/integer Amount to debit or credit Yes
description string Transaction description Yes

βœ… Sample JSON Response

{
  "merchant": "Open Source Social Network",
  "url": "https:\/\/yourwebsite.com\/",
  "time_token": 1637513403,
  "payload": {
    "status": "success",
    "amount": "50",
    "guid": "1"
  },
  "code": "100",
  "message": "Request successfully executed"
}

🧩 Access Using PHP

<?php
// Credit wallet
try {
    $user_guid = ossn_loggedin_user()->guid;
    $wallet = new Wallet\Wallet($user_guid);
    $amount = 20;
    $description = 'Some description';
    var_dump($wallet->credit($amount, $description));
} catch (Wallet\NoUserException $e) {
    echo $e->getMessage();
} catch (Wallet\CreditException $e) {
    echo $e->getMessage();
}

// Debit wallet
try {
    $user_guid = ossn_loggedin_user()->guid;
    $wallet = new Wallet\Wallet($user_guid);
    $amount = 20;
    $description = 'Some description';
    var_dump($wallet->debit($amount, $description));
} catch (Wallet\NoUserException $e) {
    echo $e->getMessage();
} catch (Wallet\DebitException $e) {
    echo $e->getMessage();
}

// Get wallet balance
$user_guid = ossn_loggedin_user()->guid;
$wallet = new Wallet\Wallet($user_guid);
echo $wallet->getBalance();

// Set new balance
$user_guid = ossn_loggedin_user()->guid;
$wallet = new Wallet\Wallet($user_guid);
echo $wallet->setBalance(<new amount>);

9.0

  • Updated API
  • Allow you to configure tax compliance if using card stripe

4.0

  • Allow seamless payments so if wallet balance is insufficient it charge card automatically if saved.

Image

Comments
ng Bubu Ambush Replied 3 years ago

This is amazing. Sincerely, OSSN has improved upon its functionality, Buddy press doesn't even compete

us MAURICE TAYLOR Replied 4 years ago

I apologize I want to ensure i fully understand the use of this component. Is this for charging members or business specifically for ads. ?

us Kamuden 07 Replied 4 years ago

I've added the Client ID and securty secret with the PayPal box checked, but it keeps on comingup with a error enter image description here

Indonesian Arsalan Shah Replied 4 years ago

You need to contact Stripe.com to obtain the keys and PayPal.com for PayPal section.

Hungarian TamΓ‘s Varga Replied 4 years ago

What exactly data should be entered? unfortunately i don't understand what the lines mean.

enter image description here

Indonesian Arsalan Shah Replied 4 years ago

Sorry due to error it was struck in private mode now its public.

Indonesian Arsalan Shah Replied 4 years ago

It seems it was set Private when created. I added PayPal because it was quick. Others methods requires bit attention to add with credit card handling.

Breton Rafael [redcrested.net] Replied 4 years ago

Great component! Fits exactly whith my needs.

I can't open github repository to contribute with translations. At this moment, this is I can do.

In the future, I intend to add MercadoPago (an PayPal equivalent) support.

If anyone wants to do this adding, I can help.

Regards!