I am working on a platform offering services. When creating a new subscription, a new transaction for the first billing is created. How can I access the transactions id?
I have a form with Braintree's Drop-in UI and my backend looks currently like this:
if (!auth()->user()->subscribed('main')) {
$subscription = auth()->user()->newSubscription('main', 'membership-monthly')->create($request->payment_method_nonce, []);
dd($subscription);
}
This successfully creates a new subscription!
Now I want to access this subscription's first billing transaction's id.
How can I achieve this?