#juiceman
1 messages · Page 1 of 1 (latest)
Thanks for the ID, let me take a look
The response of req_O7NaCcLHq2YwtB is 200, can you share with me the ID of the request that got 400 response?
Not problem. The source_transaction param expects a Charge ID, but a PaymentIntent ID was passed in.
thats weird
You can get the Charge ID from a PaymentIntent through latest_charge (https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge)
ok i think i got it to work:
charge = await stripe.paymentIntents.create({
customer: stripeUserId,
amount: amount,
currency: "usd",
payment_method: campaignCreatorCardToken, // buyer
confirm: true,
description: `Campaign id is${campaignId}. Campaign name is ${description}`
});
// // from the charge, give 80% of it to the seller
const transfer = await stripe.transfers.create({
amount: charge.amount * .80,
currency: "usd",
source_transaction: charge.lastest_charge,
destination: channelOwnerStripeBankAccount.stripeBankId, // seller stripe
});
however, I am getting another error now :: Insufficient funds in Stripe account. In test mode, you can add funds to your available balance (bypassing your pending balance) by creating a charge with 4000 0000 0000 0077 as the card number.
the 'transfer' should be coming for the charge. not sure why it says i have insufficient funds
Can you share with me the request ID again?
req_7dlNrNqC84v5MT
Hmm, I don't see source_transaction in this request.
i put the code above, thats what ran
let me try to print it out real quick
oh ur right, latest_charge is coming up blank
charge.lastest_charge is blank
oh i see the issue.
Was the PaymentIntent suceeded?