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.
ossn_com.php).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
Users receive email notifications for every credit or debit transaction, including both successful and failed attempts.
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
CURL https://www.yourwebsite.com/api/v1.0/wallet/debit
CURL https://www.yourwebsite.com/api/v1.0/wallet/credit
| 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 |
{
"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"
}
<?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
4.0

Bubu Ambush
Replied 3 years ago
This is amazing. Sincerely, OSSN has improved upon its functionality, Buddy press doesn't even compete
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. ?
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 
Arsalan Shah
Replied 4 years ago
You need to contact Stripe.com to obtain the keys and PayPal.com for PayPal section.
TamΓ‘s Varga
Replied 4 years ago
What exactly data should be entered? unfortunately i don't understand what the lines mean.

Arsalan Shah
Replied 4 years ago
Sorry due to error it was struck in private mode now its public.
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.
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!