Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pending Balances #937

Unanswered
ams-ryanolson asked this question in Q&A
Apr 17, 2024 · 1 comments · 4 replies
Discussion options

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!

You must be logged in to vote

Replies: 1 comment 4 replies

Comment options

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

You must be logged in to vote
4 replies
Comment options

Now I will describe a short algorithm of how I would implement this.

  1. I would write the "pending" key in the meta;
  2. In the admin panel, using this key in the meta, I would look for raw entries;
  3. In case of cancellation/confirmation of the transaction, the key would be deleted from meta;
  4. Perhaps added additional information to meta after confirmation or cancellation;
Comment options

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)

Comment options

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

Comment options

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /