<p> {!! isset($order_list->tracking_number) && ($order_list->tracking_number !='')?'<strong>Tracking Number: </strong>'.$order_list->tracking_number :''; !!}</br> {!! isset($order_list->shipping_carrier) && ($order_list->shipping_carrier !='')?'<strong>Shipping Carrier: </strong>'.$order_list->shipping_carrier :''; !!} </p> </div> </div> </div> <div class="col-sm-6"> <div class="order_box"> <h6>Shipping Address</h6> <div class="bottom_panel_ship"> <?php if (isset($serialize_address['zone_id'])) { if (is_numeric($serialize_address['zone_id'])) { $state = $obj->get_state($serialize_address['zone_id']); } else { $state = $obj->get_state_name($serialize_address['zone_id'], $serialize_address['country_id']); } } if (isset($serialize_address['country_id'])) { if (is_numeric($serialize_address['country_id'])) { $country = $obj->get_country($serialize_address['country_id']); } else { $country = $obj->get_country_name($serialize_address['country_id']); } } ?> <p> {!! $serialize_address['first_name'].' '.$serialize_address['last_name'] !!}<br> {!! $serialize_address['address']; !!}<br>
public function brand_creditcard_details() { $obj = new helpers(); if (!$obj->checkBrandLogin()) { return redirect('brandLogin'); } $country = DB::table('countries')->orderBy('name', 'ASC')->get(); $alldata = array(); foreach ($country as $key => $value) { $alldata[$value->country_id] = $value->name; } $brand_details = Brandmember::find(Session::get('brand_userid')); $brand_details->auth_payment_profile_id; $brand_details->auth_address_id; $allstates = array(); if (Request::isMethod('post')) { $request = new AuthorizeNetCIM(); $paymentProfile = new AuthorizeNetPaymentProfile(); if ($brand_details->auth_profile_id == '') { $country = DB::table('countries')->where('country_id', '=', Request::input('card_country_id'))->first(); $shipping_card_addr = array('card_holder_fname' => Request::input('card_holder_fname'), 'card_holder_lname' => Request::input('card_holder_lname'), 'expiry_month' => Request::input('expiry_month'), 'expiry_year' => Request::input('expiry_year'), 'cvv' => Request::input('cvv'), 'card_shiping_name' => Request::input('card_shiping_name'), 'card_shiping_address' => Request::input('card_shiping_address'), 'card_country_id' => Request::input('card_country_id'), 'card_shiping_city' => Request::input('card_shiping_city'), 'card_shipping_phone_no' => Request::input('card_shipping_phone_no'), 'card_state' => Request::input('card_state'), 'card_shipping_postcode' => Request::input('card_shipping_postcode'), 'email' => Request::input('email'), 'card_number' => Request::input('card_number'), 'country' => $country->name); $shipping_card_addr['company_name'] = Request::input('company_name'); $shipping_card_addr['card_shipping_fax'] = Request::input('card_shipping_fax'); $res = Authorizenet::createprofile($shipping_card_addr); if ($res['status'] == 'success') { $brand = array('auth_profile_id' => $res['customer']['profile_id'], 'auth_payment_profile_id' => $res['customer']['payment_profile_id'], 'auth_address_id' => $res['customer']['address_id']); $shipping_card_addr_serial = serialize($shipping_card_addr); $brand['card_details'] = $shipping_card_addr_serial; $brandresult = Brandmember::find(Session::get('brand_userid')); $brandresult->update($brand); Session::flash('success', 'Your credit card information is created successfully.'); return redirect('brand-creditcards'); } else { Session::flash('error', 'Something went wrong to update credit card.'); return redirect('brand-creditcards'); } } else { if (strstr(Request::input('card_number'), 'XXXX') != false) { $paymentProfile->payment->creditCard->cardNumber = Request::input('card_number'); } $paymentProfile->payment->creditCard->expirationDate = Request::input('expiry_year') . "-" . Request::input('expiry_month'); $response = $request->updateCustomerPaymentProfile($brand_details->auth_profile_id, $brand_details->auth_payment_profile_id, $paymentProfile); $address = new AuthorizeNetAddress(); $address->firstName = Request::input('card_holder_fname'); $address->lastName = Request::input('card_holder_lname'); if (Request::input('company_name')) { $address->company = Request::input('company_name'); } // if(strstr(Request::input('card_number'),'XXXX')!=false) //$address->card_number = Request::input('card_number'); $address->address = Request::input('card_shiping_address'); $address->city = Request::input('card_shiping_city'); $address->state = $obj->get_state(Request::input('card_state')); $address->zip = Request::input('card_shipping_postcode'); $country = DB::table('countries')->where('country_id', '=', Request::input('card_country_id'))->first(); $address->country = $country->name; $address->phoneNumber = Request::input('card_shipping_phone_no'); if (Request::input('card_shipping_fax')) { $address->faxNumber = Request::input('card_shipping_fax'); } // print_r($address); // exit; $response2 = $request->updateCustomerShippingAddress($brand_details->auth_profile_id, $brand_details->auth_address_id, $address); if ($response->isOk() && $response2->isOk()) { $shipping_card_addr = array('card_holder_fname' => Request::input('card_holder_fname'), 'card_holder_lname' => Request::input('card_holder_lname'), 'expiry_month' => Request::input('expiry_month'), 'expiry_year' => Request::input('expiry_year'), 'card_shiping_address' => Request::input('card_shiping_address'), 'card_country_id' => Request::input('card_country_id'), 'card_shiping_city' => Request::input('card_shiping_city'), 'card_shipping_phone_no' => Request::input('card_shipping_phone_no'), 'card_state' => Request::input('card_state'), 'card_shipping_postcode' => Request::input('card_shipping_postcode')); $shipping_card_addr_serial = serialize($shipping_card_addr); $brand['card_details'] = $shipping_card_addr_serial; $brandresult = Brandmember::find(Session::get('brand_userid')); $brandresult->update($brand); Session::flash('success', 'Your credit card information is updated successfully.'); return redirect('brand-creditcards'); } else { Session::flash('error', 'Something went wrong to update credit card.'); return redirect('brand-creditcards'); } } } $request = new AuthorizeNetCIM(); $creditcard = $request->getCustomerProfile($brand_details->auth_profile_id); if (isset($creditcard->xml->profile)) { $carddetails['profile_id'] = $creditcard->xml->profile->customerProfileId; $carddetails['first_name'] = $creditcard->xml->profile->shipToList->firstName; $carddetails['last_name'] = $creditcard->xml->profile->shipToList->lastName; $carddetails['card_number'] = $creditcard->xml->profile->paymentProfiles->payment->creditCard->cardNumber; $cc = unserialize($brand_details->card_details); $carddetails['expiry_month'] = $cc['expiry_month']; $carddetails['expiry_year'] = $cc['expiry_year']; $carddetails['company_name'] = $creditcard->xml->profile->shipToList->company; $carddetails['card_shiping_address'] = $creditcard->xml->profile->shipToList->address; $carddetails['card_country_id'] = $cc['card_country_id']; $carddetails['card_state'] = $cc['card_state']; $carddetails['card_shiping_city'] = $creditcard->xml->profile->shipToList->city; $carddetails['card_shipping_postcode'] = $creditcard->xml->profile->shipToList->zip; $carddetails['card_shipping_phone_no'] = $creditcard->xml->profile->shipToList->phoneNumber; $carddetails['card_shipping_fax'] = $creditcard->xml->profile->shipToList->faxNumber; $states = DB::table('zones')->where('country_id', $carddetails['card_country_id'])->orderBy('name', 'ASC')->get(); $allstates = array(); foreach ($states as $key => $value) { $allstates[$value->zone_id] = $value->name; } } else { $carddetails['profile_id'] = ''; $carddetails['first_name'] = ''; $carddetails['last_name'] = ''; $carddetails['card_number'] = ''; $carddetails['expiry_month'] = ''; $carddetails['expiry_year'] = ''; $carddetails['company_name'] = ''; $carddetails['card_shiping_address'] = ''; $carddetails['card_country_id'] = ''; $carddetails['card_state'] = ''; $carddetails['card_shiping_city'] = ''; $carddetails['card_shipping_postcode'] = ''; $carddetails['card_shipping_phone_no'] = ''; $carddetails['card_shipping_fax'] = ''; } return view('frontend.brand.brand_creditcard', compact('brand_details', 'alldata', 'allstates', 'carddetails'), array('title' => 'Creditcard Information')); }
Placed on {!! date('m d,Y g:i:s A e ',strtotime($order_list[0]->created_at)) !!} </p></td> <!-- July 14, 2015 7:20:48 AM GMT --> </tr> <tr> <td><table border="0" cellpadding="0" cellspacing="0" style="width:100%;margin-bottom:30px;"> <tbody> <tr> <th align="left" scope="col" style="font-size:16px;line-height:20px;color:#4e4e4e;font-family:'Lato', sans-serif;font-weight:700;padding-bottom:10px;">Shipping Address :</th> </tr> <tr> <td style="font-size:15px;line-height:22px;color:#4e4e4e;font-family:'Lato', sans-serif;"> <?php if (isset($shipping_address['zone_id'])) { if (is_numeric($shipping_address['zone_id'])) { $state = $obj->get_state($shipping_address['zone_id']); } else { $state = $shipping_address['zone_id']; } } if (isset($shipping_address['country_id'])) { if (is_numeric($shipping_address['country_id'])) { $country = $obj->get_country($shipping_address['country_id']); } else { $country = $shipping_address['country_id']; } } ?> {!! (isset($receiver_name) && ($receiver_name!=''))?ucwords($receiver_name):'' !!}<br> {!! (isset($shipping_address['address']) && ($shipping_address['address']!=''))?$shipping_address['address']:'' !!}<br>