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

Yanick beaulieu
Replied 2 years ago
Will you be able to add it or I have to integrate more precise things to install it I tried to add visa directly they did not want to provide me with the necessary information to add it to the surplus plugins to the component or as you did with paypal and stripe it will really be an even more powerful tool than it already has
Arsalan Shah
Replied 2 years ago
Is it possible to add Globalpayments and Interac?
It can be integrated with any gateway
Yanick beaulieu
Replied 2 years ago
Is it possible to ask for an improvement because in real life, I love this magical plugins you made
Is it possible to add Globalpayments and Interac?
Will it be possible to add an admin control in the event that a refund can be made possibly we could rebalance the person's account, I know that it may seem like a request but is it a possible thing
Arsalan Shah
Replied 3 years ago
@James glad you got it working.
James Maynard
Replied 3 years ago
nevermind, got it working
James Maynard
Replied 3 years ago
trying to set this up, got userid and key put in, but its not working, i dunno what im doing wrong..
Arsalan Shah
Replied 3 years ago
@Zack tell me how much is 1+3 ? I doubt you are a bot
Zack Aguilar
Replied 3 years ago
This is a great feature. I was able to make it function. However, it is not allowing an input of the credit or debit card at all. The input area is not working. Please advise further. Thanks
Arsalan Shah
Replied 3 years ago
@Maurice
How to use this component is mentioned in the component description and that is for developers. You can use this component if it is required by a 3rd component example PaidAccess. Otherwise its of no use if you don't have the API and wanted to use (writing own component).
MAURICE TAYLOR
Replied 3 years ago
1 other person including myself asked a question and was ignored. Why is that when people don't understand something, we are often ignored? I thought this was a community, not an elitest club. I'm pretty sure no one came into this work knowing everything, and they had someone to answer their questions. I can understand it may not be something you want to do, state that. In the long term it hurts your product because the longer it takes for us to learn they less we spend on other components and modules being created. Also the more we learn, the more we can help others and increase the community.
Just a thought.