#myz123

1 messages · Page 1 of 1 (latest)

stark marshBOT
pastel quartz
sacred ginkgo
#

@pastel quartz I mean, for example, my application allows users to deposit some money in their account balance. What should I do if a user deposit and then request a refund? I need to update this user's account balance.

pastel quartz
#

Which account balance are you referring to? Are you referring to the balance in a connected account or the balance maintained in your own system?

sacred ginkgo
#

@pastel quartz Yes, my own system.

#

What should I to solve this issue?

pastel quartz
#

This should be managed in your system.

  1. When the customer placed the deposit, it will create a payment with Stripe.
  2. When the customer request a refund, then the refund request will be initiated on the payment in Step 1

The balance should be maintained in your own database.

sacred ginkgo
#

I mean it doesn't apply a refund or withdraw from my side, users apply refund from bank side.

#

@pastel quartz For example, a user makes a success payment, then request a refund from bank side. After that, this user can withdraw his account balance because I don't his payment was canceled.

pastel quartz
sacred ginkgo
#

No, I mean sometimes people use stolen bank cards to pay.

pastel quartz
stark marshBOT
sacred ginkgo
#

@pastel quartz Hello river, sorry for the late reply. Can I listen to charge.dispute.created or charge.refunded event? How can I get related user id from these event?

mild shadow
#

Hi @sacred ginkgo I'm taking over the thread

#

Are you asking if you can get customer ID from a charge.dispute.created event?

sacred ginkgo
#

user id from my app, I want to delete the transaction record and update the account balance.

mild shadow
#

Is this an ID you set by yourself? or an ID from Stripe?

sacred ginkgo
#

my id

#

user id from firebase, I want know which user made a refund.

mild shadow
#

Did you attach the ID to charge or PaymentIntent object as a metadata?

sacred ginkgo
#

I have developed a small-scale financing platform that allows individuals to deposit money into their own accounts, with payments being processed through Stripe. However, a problem that's currently troubling me is that people may use stolen bank cards to make transactions, and then these transfers get cancelled by the banks. At the moment, my application credits the user's account with the corresponding amount as soon as the Stripe payment is confirmed successful. Moreover, I allow users to withdraw their money. But, if a user uses a stolen credit card and the payment succeeds, the transfer gets reversed but I do not receive any information. This results in the user's balance not being updated on my platform, and the user is still able to withdraw the money. How should I handle this issue?

#

Yes, I attech the userid and amount as meta data in stripe payment

mild shadow
#

Ok, then you can get the metadata that you attach to the PaymentIntent object from dispute->charge->payment_intent->metadata

sacred ginkgo
#

I only pass metadata to stripe payment, how can get metadata from refund?

mild shadow
#

Depend how you create the refund, you can get charge or payment_intent from a refund object as well

sacred ginkgo
#

I mean I only pass metadata in payment event, how can I get metadata from refund event?

mild shadow
#

Is there an ID of event that I can take a look?

sacred ginkgo
#

I didn't create refund, I listen to charge.refunded event from webhook

#

@mild shadow Hello, how can get payment's metadata from charge.refunded event?

mild shadow
#

The charge.refunded event contains a charge object, so you can get the metadata from charge->payment_intent->metadata, if the metadata as set on the payment_intent object.

sacred ginkgo
#

@mild shadow sorry the late reply. I didn't see your message. How can manually trigger a charge.refunded event to test if it works?