Laravel package that provides a simple, easy-to-use interface to Conekta Payment services.
- First of all, require the Package via Composer
$ composer require danielmlozano/laravel-conekta
- Publish the configuration file
$ php artisan vendor:publish --tag="conekta-config"
- If necessary, publish the migrations as well
$ php artisan vendor:publish --tag="conekta-migrations"
- 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"
- Add the Purchaser trait to your User model
use Danielmlozano\LaravelConekta\Purchaser;
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable, HasFactory, Purchaser;
- Now, you can access to the API.
$user = User::first();
// Create a new Conekta Customer
$user->createAsConektaCustomer();
//Add a payment method
$user->addPaymentMethod('payment_method_token', 'card');
You can read the entire documentation here: https://danielmlozano.dev/docs/laravelconekta/
I created this package for a project and in its first version, only contain the functionality that I needed. For this reason. all contributors are welcome to improve and add more features to the package.