#hemabh_code

1 messages ¡ Page 1 of 1 (latest)

bleak fulcrumBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1217733064046936104

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

nova ventureBOT
serene sable
#

Can you share the example Payment Intent ID (pi_xxx) which you expect a receipt?

hot gyro
#

sure - pi_3Ou8NjA8aVMYKuKm08MXAdF0

#

associated transfer - tr_1Ou8NkA8aVMYKuKmQAHc1j1L

serene sable
#

Receipt email will only be sent if the payment is made successfully: https://docs.stripe.com/receipts?payment-ui=direct-api#automatically-send-receipts

However, https://dashboard.stripe.com/test/payments/pi_3Ou8NjA8aVMYKuKm08MXAdF0 is still in requires_payment_method status

Send payment or refund receipts automatically.

hot gyro
#

oh okay. But the balances for both the platform account and connect account have been updated. Shouldn't that mean the payment is completed?

Will I have to perform any action to change the status from requires_payment_method or do we just wait?

serene sable
#

Payment Intent will not change status until a payment method is collected and confirmed

hot gyro
#

Nope I'm very confident that the balance got updated due to the payment intent + transfer flow

#

here are the logs for one payment flow -

#

Initial balances

platform account balance :: {
object: 'balance',
available: [ { amount: 8006000, currency: 'usd', source_types: [Object] } ],
connect_reserved: [ { amount: 0, currency: 'usd' } ],
livemode: false,
pending: [ { amount: 0, currency: 'usd', source_types: [Object] } ]
}
connect account balance :: {
object: 'balance',
available: [ { amount: 2101062, currency: 'usd', source_types: [Object] } ],
instant_available: [ { amount: 2101062, currency: 'usd', source_types: [Object] } ],
livemode: false,
pending: [ { amount: 0, currency: 'usd', source_types: [Object] } ]
}

#

.

Creating Payment Intent (from connect account) -

paymentIntent :: {
id: 'pi_3Ou95lPOMrhj0QRS03BmNvR4',
object: 'payment_intent',
amount: 1000000,
amount_capturable: 0,
amount_details: { tip: {} },
amount_received: 0,
application: 'ca_PS3VYLX4WzCcQ94S7T4fM910Olr9rlGX',
application_fee_amount: null,
automatic_payment_methods: { allow_redirects: 'always', enabled: true },
canceled_at: null,
cancellation_reason: null,
capture_method: 'automatic',
client_secret: 'pi_3Ou95lPOMrhj0QRS03BmNvR4_secret_Bpg9UAi20J4OMWRuXjeSPp0gp',
confirmation_method: 'automatic',
created: 1710402765,
currency: 'usd',
customer: null,
description: null,
invoice: null,
last_payment_error: null,
latest_charge: null,
livemode: false,
metadata: { type: 'payment-intent-from-connect' },
next_action: null,
on_behalf_of: null,
payment_method: null,
payment_method_configuration_details: {
id: 'pmc_1OkLdDPOMrhj0QRSJrEL5rWq',
parent: 'pmc_1Od9O7A8aVMYKuKmhhinYypI'
},
payment_method_options: {
card: {
installments: null,
mandate_options: null,
network: null,
request_three_d_secure: 'automatic'
},
link: { persistent_token: null }
},
payment_method_types: [ 'card', 'link' ],
processing: null,
receipt_email: null,
review: null,
setup_future_usage: null,
shipping: null,
source: null,
statement_descriptor: null,
statement_descriptor_suffix: null,
status: 'requires_payment_method',
transfer_data: null,
transfer_group: 'test-transfer-group-05'
}

#

.

Creating transfer with same amount and transfer_group as payment intent -

transfer :: {
id: 'tr_1Ou95mPOMrhj0QRSr5qPUHDg',
object: 'transfer',
amount: 1000000,
amount_reversed: 0,
balance_transaction: 'txn_1Ou95mPOMrhj0QRSRjyOM35c',
created: 1710402766,
currency: 'usd',
description: null,
destination: 'acct_1FrJGNA8aVMYKuKm',
destination_payment: 'py_1Ou95mA8aVMYKuKmwfHXDzd0',
livemode: false,
metadata: { type: 'transfer-from-connect-payment-intent' },
reversals: {
object: 'list',
data: [],
has_more: false,
total_count: 0,
url: '/v1/transfers/tr_1Ou95mPOMrhj0QRSr5qPUHDg/reversals'
},
reversed: false,
source_transaction: null,
source_type: 'card',
transfer_group: 'test-transfer-group-05'
}

Final account balances -

platform account balance :: {
object: 'balance',
available: [ { amount: 9006000, currency: 'usd', source_types: [Object] } ],
connect_reserved: [ { amount: 0, currency: 'usd' } ],
livemode: false,
pending: [ { amount: 0, currency: 'usd', source_types: [Object] } ]
}
connect account balance :: {
object: 'balance',
available: [ { amount: 1101062, currency: 'usd', source_types: [Object] } ],
instant_available: [ { amount: 1101062, currency: 'usd', source_types: [Object] } ],
livemode: false,
pending: [ { amount: 0, currency: 'usd', source_types: [Object] } ]
}

serene sable
#

The payment intent isn't completed, so the funds doesn't get added to the platform.

Tha balance is updated from the platform to connected account balance through Transfers - yes.

So,

  • Platform balance - not updated
  • Connected balance - updated via transfers
#

The correct flow should be:

  1. Complete the payment successfully in the platform in Payment Intents - so that funds can be added to the platform balance
  2. Transfer the funds from platform balance to connected account balance
hot gyro
#

but the platform balance also got updated from 8006000 to 9006000

#

while the connect account balance got updated from 2101062 to 1101062

#

this worked fine

#

I just need a receipt for it

serene sable
#

It has nothing to do with the account balance

#

Receipt is only sent upon successful payment on a Payment Intent

hot gyro
#

I want the payment to happen internally and not involve any external payments.

serene sable
#

I'm afraid that will not be possible

hot gyro
serene sable
#

It's only possible if the first step - Charge flow using Payment Intent is completed

#

However, the payment intent you shared wasn't completed

hot gyro
#

is there a way to just mark it as completed using any api without the payer having to undertake any steps?

serene sable
#

This will not be possible

hot gyro
#

Cool I'll see if we can create receipts internally without leveraging stripe for this.

#

Is there any way in stripe for us to generate receipts manually by specifying the payer and payee details along with amount, date, and any other required details?

serene sable
#

Unless the payments are made within Stripe, it's not possible to generate a receipt with the payer and payee information. Can you share what you're trying to achieve here?

hot gyro
#

no I was just wondering if we can just create custom receipts even without payments. But I think that is not possible. Its okay we should be able to generate receipts on our end.

Thank you for your time.