Package installation

Require the Package via Composer

$ composer require danielmlozano/laravel-conektaLenguaje del código: JavaScript (javascript)

Publish the configuration file

$ php artisan vendor:publish --tag="conekta-config"Lenguaje del código: JavaScript (javascript)

If necessary, publish the migrations as well

php artisan vendor:publish --tag="conekta-migrations"Lenguaje del código: JavaScript (javascript)

Add your Conekta public and secret key to your .env file and your currency in ISO format

CONEKTA_KEY=key_your_conekta_public_key
CONEKTA_SECRET=key_your_conekta_private_key
CONEKTA_CURRENCY=usd

If you’re using a custom User Model, add it to your .env as well

CONEKTA_USER_MODEL="App\Models\CustomModel"Lenguaje del código: JavaScript (javascript)

If your application will accept Oxxo Pay (Mexico only), then you wil find these configuration params in config/conecta.php

/*
<em>    |--------------------------------------------------------------------------</em>
<em>    | Oxxo Pay</em>
<em>    |--------------------------------------------------------------------------</em>
<em>    |</em>
<em>    | This configuration is used for the Oxxo pay method</em>
<em>    |</em>
<em>    </em>*/
    'webhook' => <em>env</em>('CONEKTA_WEBHOOK_URL',<em> </em>'/conekta/webhook'),
    'oxxo_reference_lifetime' => [
        'amount' => 0, //<em>Leave in 0 for no expiration at all</em>
        'type' => 'hours' //<em> accepts: 'hours', 'days'</em>
    ],Lenguaje del código: HTML, XML (xml)

It’s recommended that you let the default webhook url, unless you want to define your own custom URL. Also, you may write your own controller for handling Conekta Webhooks.

In oxxo_reference_lifetime you may configure the lifespan for the references.

Add the Purchaser trait to your User model

use Danielmlozano\LaravelConekta\Purchaser;

class User extends Authenticatable implements MustVerifyEmail
{
    use Notifiable, HasFactory, Purchaser;Lenguaje del código: PHP (php)
Was this page helpful?
Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.