Closed OzanKurt closed 8 years ago
Items are linked to orders not transactions. Access the items through the order variable. On Dec 2, 2015 12:13 PM, "Ozan Kurt" notifications@github.com wrote:
$apiContext = new ApiContext(new OAuthTokenCredential( config('services.paypal.client_id'), config('services.paypal.secret') )); if (!config('services.paypal.sandbox')) $apiContext->setConfig(['mode' => 'live']); $transactions = collect(); foreach (auth()->user()->orders as $order) { $transactions = $transactions->merge($order->transactions()->where('detail', 'Success')->get()); } foreach ($transactions as $transaction) { $payments[] = Payment::get($transaction->transaction_id, $apiContext)->toArray(); }
This following code allows me to get all the payments done by the user but somehow their items are always empty.
— Reply to this email directly or view it on GitHub https://github.com/amsgames/laravel-shop/issues/24.
Awesome! Thanks a lot mate
This following code allows me to get all the payments done by the user but somehow their
items
are always empty. Do you have any idea about why this is happening?