public function EnviaEmailWebpay($user_id) { //Get a certificationBag with certificates and private key of WebpayNormal for integration environment. $bag = CertificationBagFactory::integrationWebpayNormal(); $plus = TransbankServiceFactory::normal($bag); //For normal transactions, you can just add one TransactionDetail //Para transacciones normales, solo se puede añadir una linea de detalle de transacción. $plan_id = Mensualidad::where('user_id', $user_id)->first()->plan_id; $mensualidad_id = Mensualidad::where('user_id', $user_id)->first()->id; $pago = Planes::find($plan_id)->valor; $plus->addTransactionDetail($pago, $user_id . '-' . $mensualidad_id . '-' . date("Ymd")); //Amount and BuyOrder //TODO redireccionar una página de resumen del pago del usuario, enviar user_id $response = $plus->initTransaction(\URL::to('/pago_email/response_webpay'), \URL::to('/pago_email/thanks')); // $response = $plus->initTransaction(\URL::to('/transbank/response_webpay'), \URL::to('/transbank/thanks')); echo RedirectorHelper::redirectHTML($response->url, $response->token); }
public function CrudMensualidad() { $options = range(0, 28); $edit = DataEdit::source(new Mensualidad()); $edit->link("/mensualidad/lista", "Pendientes Mes Actual", "TR")->back(); $edit->add('plan_id', 'Plan', 'select')->options(Planes::lists('nombre', 'id')); $edit->add('alumno.fullname', 'Alumno', 'autocomplete')->remote('fullname', "id", url('/') . "/alumnos/searchname")->rule('required'); $edit->add('dia_pago', 'Día de pago', 'select')->options($options); $edit->add('observacion', 'Observación', 'textarea'); return $edit->view('mensualidad/crud', compact('edit')); }