danielmlozano / laravel-conekta
Laravel package that provides a simple, easy-to-use interface to Conekta Payment services
v1.1.1
2022-11-04 17:05 UTC
Requires
- php: ^7.4|^8.0
- conekta/conekta-php: ^4.3
- illuminate/contracts: ^6.0|^7.0|^8.0|^9.0
- illuminate/database: ^6.0|^7.0|^8.0|^9.0
- illuminate/routing: ^6.0|^7.0|^8.0|^9.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0
- nesbot/carbon: ^2.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^8.0|^9.0
This package is auto-updated.
Last update: 2024-11-04 21:35:56 UTC
README
Laravel package that provides a simple, easy-to-use interface to Conekta Payment services.
Installation
- 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');
Documentation
You can read the entire documentation here: https://danielmlozano.dev/docs/laravelconekta/
Contributors
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.