test mercado pago
Showing
| ... | @@ -43,15 +43,15 @@ class CartController extends Controller | ... | @@ -43,15 +43,15 @@ class CartController extends Controller |
| public function __construct() | public function __construct() | ||
| { | { | ||
| if (!\Session::has('cart')) { | if (!\Session::has('cart')) { | ||
| \Session::put('cart', array()); | \Session::put('cart', array()); | ||
| } | } | ||
| setlocale(LC_MONETARY, 'en_US'); | setlocale(LC_MONETARY, 'en_US'); | ||
| $this->util = new Util(); | $this->util = new Util(); | ||
| } | } | ||
| public function show() | public function show() | ||
| { | { | ||
| $total = $this->total(); | $total = $this->total(); | ||
| $cart = \Session::get('cart'); | $cart = \Session::get('cart'); | ||
| ... | @@ -399,18 +399,14 @@ public function shipping() | ... | @@ -399,18 +399,14 @@ public function shipping() |
| $detail = $detail." Envio ". $addres->shipping_price->name ." $". $addres->shipping_price->cost .".00"; | $detail = $detail." Envio ". $addres->shipping_price->name ." $". $addres->shipping_price->cost .".00"; | ||
| $mp = new MP(env('AC_MERCADO_PAGO')); | $mp = new MP('TEST-7957752184054483-101318-9bbc7ef53f975318d2521f05257cb66a__LB_LC__-60150825'); | ||
| $payment_data = array( | $payment_data = array( | ||
| "transaction_amount" => $this->total() + $addres->shipping_price->cost, | "transaction_amount" => 100, | ||
| "description" => "Title of what you are paying for", | |||
| "description" => $detail, | "payment_method_id" => "oxxo", | ||
| "payment_method_id" => $request->payment_id, | |||
| "payer" => array ( | "payer" => array ( | ||
| "email" => $client->email, | "email" => "[email protected]" | ||
| "first_name"=>$client->name, | |||
| "last_name"=>$client->lastname | |||
| ) | ) | ||
| ); | ); | ||
| ... | @@ -812,12 +808,12 @@ public function shipping() | ... | @@ -812,12 +808,12 @@ public function shipping() |
| } | } | ||
| } else{ | } else{ | ||
| $msg = 'Lo sentimos este código de descuento ya expiró :('; | $msg = 'Lo sentimos este código de descuento ya expiró :('; | ||
| } | } | ||
| } | } | ||
| $data = [ | $data = [ | ||
| 'valid'=>$valid, | 'valid'=>$valid, | ||
| 'msg'=>$msg, | 'msg'=>$msg, | ||
| 'amount'=>money_format('%(#10n',$descuento), | 'amount'=>money_format('%(#10n',$descuento), | ||
| ... | ... |
Please
register
or
sign in
to comment