- 
 
 - 
  Notifications
 
You must be signed in to change notification settings  - Fork 247
 
Pending Balances #937
-
So, in summary this is what I need to accomplish.
- User A sends to User B
 - The transaction needs to be set to pending for a specific cycle of funds. (settlement from the Processor)
 - Once the funds are settled, they are available to User B for withdrawl to their bank account.
 
I have 2 thoughts on how best to accomplish this but I was wondering if the community could explain what others might have done to accomplish this. My 2 thoughts are
Option 1: Create 2 wallets.
- Pending
 - Available to Withdrawl
 
Open 2: Add a pending column to the transaction table.
Both of these come with a number of thoughts around success so that is why I am bringing the question here.
Thanks in Advance!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 4 replies
-
Hello. I made an example for you.
$transfer = $user1->transfer($user2, 500, new Extra( deposit: new Option(null, confirmed: false), withdraw: null, ));
More details in PR: #938
Beta Was this translation helpful? Give feedback.
All reactions
-
Now I will describe a short algorithm of how I would implement this.
- I would write the "pending" key in the meta;
 - In the admin panel, using this key in the meta, I would look for raw entries;
 - In case of cancellation/confirmation of the transaction, the key would be deleted from meta;
 - Perhaps added additional information to meta after confirmation or cancellation;
 
Beta Was this translation helpful? Give feedback.
All reactions
-
ok so you are using the confirmed property to handle pending. So, then I would just batch or iterate through them to change them to confirmed=true when I want to allow the user to withdrawl the funds?
(if I understand this correctly, this is an amazing setup)
Beta Was this translation helpful? Give feedback.
All reactions
-
Also, can I do the same but using $deposit = $user2->deposit and use the Extra and Option?
I ask because deposits can come from a direct purchase, and transfers can come from one user to another but both will need to be pending
Beta Was this translation helpful? Give feedback.
All reactions
-
when I want to allow the user to withdrawl the funds?
yes
Also, can I do the same but using $deposit = $user2->deposit and use the Extra and Option?
$transaction = $user->deposit(100, null, false); // not confirm
Beta Was this translation helpful? Give feedback.