#xxxxx-payouts
1 messages · Page 1 of 1 (latest)
Hey! Can you share an example?
To be clear, if you're using a manual payout schedule then only you (or your API keys) can create these payouts
yes sure.
as its a simple logic.
I think its correct then why its creating multiple payout. I am not able to figure out why since yesterday.
I also added another another condition !order.payout_id but still the problem is not resolved.
It's really difficult for us to understand what's going on there without any context of your application
what we are doing basically we are fetching those orders whose status is complete then for a particular order just calling the payout api, thats it .
And is it creating multiple payouts for a single order (order.order_number)?
My guess is this is a race condition, and something is calling sendPayouts multiple times before you can update the payout_id, which is the only safe guard
so what should i do ?
You need to debug this I'm afraid. This isn't a Stripe issue
you mean to say the payout api is called multiple times before updating the payout_id.
That's my guess, yes
You're looking up multiple orders, right:
.findWithRelationsByCondition(
{
is_payout_done: false,
completed_date: Not(IsNull()),
payout_id: IsNull(),
},
['products'],
)
Do you have any idea to solve this race around condition?
Yes.
What is the output of your orders callback variable there?
an array of orders.
Log the output and share it
ORDERS [
Order {
id: 164,
order_number: 164,
buyer_user_id: 7,
shipping_method_id: 3,
buyer_user_address_id: null,
order_status_id: 3,
seller_user_id: 17,
shipping_partner_id: null,
shipment_tracking_id: null,
payment_method_id: 1,
payment_gateway_id: 1,
payment_status_id: null,
payment_method_token: {
id: 'card_1KP6ZPHFt6qIi7wnyeKFa4hM',
last4: '0077',
brand: 'visa'
},
tax_id: 20,
tax_value: 0,
payment_id: 'pi_3KWfINHFt6qIi7wn0NIq3BsY',
order_cancel_reason: null,
shipping_cost: '0.00',
product_total: 6,
is_refund_fee_charged: false,
delivery_date: null,
completed_date: 2022-03-03T11:25:32.641Z,
canceled_date: null,
canceled_by: null,
is_payout_done: false,
is_refund_done: false,
payout_failure_status: null,
refund_failure_status: null,
shipping_date: null,
payout_id: null,
refund_id: null,
shipment_id: null,
rate: null,
label_url: null,
easy_post_tracking_code: null,
transfer_id: 'tr_3KWfINHFt6qIi7wn0NItc7pK',
is_offer_accepted: null,
quantity: 1,
created_at: 2022-02-23T21:45:38.027Z,
updated_at: 2022-03-02T21:55:32.640Z,
deleted_at: null,
is_read: false,
products: [ [Product] ],
formatted_order_number: 'GTO00000000164'
}
]
this is my order array.
So there's a single entry. And did that create multiple payout objects with Stripe?