Answer the question
In order to leave comments, you need to log in
Correct error handling in financial transactions?
Scenario.
1. The user enters card details into the Stripe form on the website.
2. The backend "billits" it and enters data into the database that the payment has passed.
Pseudocode
$result = Stripe::charge($customerId, $amount);
if ($result->paid) {
Billing::create($customerId, $amount);
}
Answer the question
In order to leave comments, you need to log in
Solution: a script that once every N minutes receives a list of the last successful transactions from Stripe and compares them with those that we do not have yet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question