Update showcomprar.blade.php
This commit is contained in:
@@ -15,30 +15,35 @@
|
||||
// Agrega credenciales
|
||||
MercadoPago\SDK::setAccessToken(config('services.mercadopago.token'));
|
||||
|
||||
|
||||
// Crea un objeto de preferencia
|
||||
$preference = new MercadoPago\Preference();
|
||||
|
||||
//$payment_methods = MercadoPago::get("/v1/payment_methods");
|
||||
// Crea un ítem en la preferencia
|
||||
$item = new MercadoPago\Item();
|
||||
$item->id = $historial_id;
|
||||
$item->title = 'Compra SrPremium';
|
||||
$item->quantity = 1;
|
||||
$item->unit_price = $monto;
|
||||
$preference->back_urls = array(
|
||||
|
||||
$preference->back_urls = array(
|
||||
"success" => url('/compras/'),
|
||||
"failure" => url('/compras/error'),
|
||||
"pending" => url('/compras/pendiente')
|
||||
);
|
||||
$preference->auto_return = "approved";
|
||||
|
||||
// Excluye el método de pago con tarjeta de crédito
|
||||
$preference->payment_methods = array(
|
||||
"excluded_payment_types" => array(
|
||||
array("id" => "credit_card")
|
||||
)
|
||||
);
|
||||
|
||||
$preference->items = array($item);
|
||||
$preference->save();
|
||||
|
||||
|
||||
@endphp
|
||||
|
||||
|
||||
<div class="grid grid-cols-1 mb-8">
|
||||
<div class="bg-white w-full sm:w-[26rem] m-auto justify-center rounded-xl shadow-md">
|
||||
<div class="text-center bg-[#000029] text-white text-lg font-semibold rounded-lg py-2 mb-4">
|
||||
@@ -61,7 +66,8 @@
|
||||
|
||||
<div class="bg-white px-4 py-3 md:flex justify-center mt-2 mb-4">
|
||||
<a href="javascript:location.reload()">
|
||||
<button class="inline-flex justify-center w-full rounded-md border border-transparent px-12 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Continuar</button>
|
||||
<button
|
||||
class="inline-flex justify-center w-full rounded-md border border-transparent px-12 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Continuar</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user