I have a project that need to use stripe.com. The flow is a bit “non-standard” as in the sense that no off-the-shelf software such as WordPress, OpenCart and etc.
May I explain the payment flow as follow:
customer click on Stripe payment link on a web page to go to Stripe Checkout page and complete the payment
Laravel Cashier will get notified when there are new payments, and can retrieve all the payment details and store in DB
Laravel Cashier allows me to export chosen columns on demand. The must-have columns are: coupon and client_reference_id.
From the doc https://laravel.com/docs/9.x/billing, I can't see there are anything that does the data retrieval. Am I missing something? Any thoughts are welcomed.
After reading the whole page again, especially on #balances, I don't see how transactions records can be retrieved.
I think may be I need to use the SDK https://laravel.com/docs/9.x/billing#stripe-sdk and hopefully, fingers crossed, that "coupon" and "client_reference_id" are both available in the Stripe objects.
The applyBalance method will create new customer balance transactions for the customer. You may retrieve these transaction records using the balanceTransactions method, which may be useful in order to provide a log of credits and debits for the customer to review:
// Retrieve all transactions...
$transactions = $user->balanceTransactions();
foreach ($transactions as $transaction) {
// Transaction amount...
$amount = $transaction->amount(); // .31
// Retrieve the related invoice when available...
$invoice = $transaction->invoice();
}