#malphine-connect-transfer
1 messages · Page 1 of 1 (latest)
Hello, here is my code
intent = stripe.PaymentIntent.capture(
p_id,
amount_to_capture = amount,
)
stripe.Transfer.create(
amount=int(amount*0.8),
currency="cad",
source_transaction=intent['latest_charge'],
destination=acct,
)
stripe.Transfer.create(
amount=int(amount*0.2),
currency="cad",
source_transaction=intent['latest_charge'],
destination=acct2,
)
here acct2 is my account
how would i go about transfering this 20% to my account
You are capturing a PaymentIntent and getting funds in your own balance already. The first Transfer creation sends 80% of that to the connected account.
The rest stays in your balance, there's no reason to create another Transfer, it's already right there in your own balance
o
malphine-connect-transfer
so i can just leave it as
intent = stripe.PaymentIntent.capture(
p_id,
amount_to_capture = amount,
)
stripe.Transfer.create(
amount=int(amount*0.8),
currency="cad",
source_transaction=intent['latest_charge'],
destination=acct,
)
the remaniing 20% will be in my balence
yes
You could also simply use Destination Charges https://stripe.com/docs/connect/destination-charges to automatically configure the Transfer to the connected account
https://stripe.com/docs/payouts The funds are pending for 2/7 days by default
Oh, so i wont see the 0.2*amount in my balence for a few days?
correct
You can use those test cards https://stripe.com/docs/testing#available-balance to simulate the funds being available quicker
but in production if you charge on Monday in the US, the funds are only available on Wednesday
Hmm, i see, well i am using the test cards currently
you aren't using the test cards I linked you to
Then the funds are available immediately in your own Stripe balance
if you call https://stripe.com/docs/api/balance/balance_retrieve you should see the balance go up after each payment
hmm well ill trsut that the amount is there (2.192) but i dont see it oddlt
maybe im blind
Unfortunately tough to help without any information 🙂
You can see everything in the API:
- Retrieve your total balance, pending or available, at https://stripe.com/docs/api/balance/balance_retrieve
- List all the BalanceTransactions that each show money moving into your account https://stripe.com/docs/api/balance_transactions/list
- Each BalanceTransaction has an
available_onproperty indicating when the money will be available
so as a developer you can reconcile all of this really quickly
heres
what i get after
print(stripe.BalanceTransaction.list(limit=2))
"data": [
{
"amount": -876,
"available_on": 1684189594,
"created": 1684189594,
"currency": "cad",
"description": null,
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"id": "txn_3N89qLH8GIP1lNIu0oCSt51g",
"net": -876,
"object": "balance_transaction",
"reporting_category": "transfer",
"source": "tr_3N89qLH8GIP1lNIu0KfXXwvR",
"status": "available",
"type": "transfer"
},
{
"amount": 1096,
"available_on": 1684189593,
"created": 1684189593,
"currency": "cad",
"description": null,
"exchange_rate": null,
"fee": 68,
"fee_details": [
{
"amount": 68,
"application": null,
"currency": "cad",
"description": "Stripe processing fees",
"type": "stripe_fee"
}
],
"id": "txn_3N89qLH8GIP1lNIu0I37Dh8E",
"net": 1028,
"object": "balance_transaction",
"reporting_category": "charge",
"source": "ch_3N89qLH8GIP1lNIu0QwBSp5O",
"status": "available",
"type": "charge"
}
],
"has_more": true,
"object": "list",
"url": "/v1/balance_transactions"
}
where would i see 2.192
Please try first, and don't dump the entire jira here
Look closely at the 2 results, it's everything you need: how much you charged (the second one) how much you transferred out (the first one), the diff between the 2 are what you want I assume?
Oh i understand now okay thanks