diff --git a/app/Http/Controllers/NinjaController.php b/app/Http/Controllers/NinjaController.php index 520551578d..14614c07de 100644 --- a/app/Http/Controllers/NinjaController.php +++ b/app/Http/Controllers/NinjaController.php @@ -294,6 +294,7 @@ class NinjaController extends BaseController } $user = Auth::user(); + $account = $user->account; $url = NINJA_APP_URL . '/buy_now'; $contactKey = $user->primaryAccount()->account_key; @@ -301,9 +302,17 @@ class NinjaController extends BaseController 'account_key' => NINJA_LICENSE_ACCOUNT_KEY, 'contact_key' => $contactKey, 'product_id' => PRODUCT_WHITE_LABEL, - 'first_name' => Auth::user()->first_name, - 'last_name' => Auth::user()->last_name, - 'email' => Auth::user()->email, + 'first_name' => $user->first_name, + 'last_name' => $user->last_name, + 'email' => $user->email, + 'name' => $account->name, + 'address1' => => $account->address1, + 'address2' => $account->address2, + 'city' => $account->city, + 'state' => $account->state, + 'postal_code' => $account->postal_code, + 'country_id' => $account->country_id, + 'vat_number' => $account->vat_number, 'return_link' => true, ]; diff --git a/app/Http/Controllers/OnlinePaymentController.php b/app/Http/Controllers/OnlinePaymentController.php index d6847fe038..f456678938 100644 --- a/app/Http/Controllers/OnlinePaymentController.php +++ b/app/Http/Controllers/OnlinePaymentController.php @@ -356,12 +356,14 @@ class OnlinePaymentController extends BaseController return redirect()->to("{$failureUrl}/?error=" . $validator->errors()->first()); } - $data = [ - 'currency_id' => $account->currency_id, - 'contact' => Input::all(), - 'custom_value1' => Input::get('custom_client1'), - 'custom_value2' => Input::get('custom_client2'), - ]; + $data = request()->all(); + $data['currency_id'] = $account->currency_id; + $data['custom_value1'] = request()->custom_client1; + $data['custom_value2'] = request()->custom_client2; + $data['contact'] = request()->all(); + $data['contact']['custom_value1'] = request()->custom_contact1; + $data['contact']['custom_value2'] = request()->custom_contact2; + if (request()->currency_code) { $data['currency_code'] = request()->currency_code; }