LaravelConekta is intended to use as a wrapper for the Conekta Official SDK, giving comprehensive and natural methods based entirely on your Laravel User model.
In future versions, it’s planned to allow subscriptions and “one-off” charges, but for now, everything is around the User model.
Create a Conekta Customer
In order to perform orders and charges in behalf of our users, we need to create them as Conekta Customers
$user = User::find(1);
$user->createAsConektaCustomer(['name' => $user->name]);
Lenguaje del código: PHP (php)
Conekta Customer object needs at least the e-mail and the name of the customer in order to be created. The method createAsConektaCustomer automatically bind your model’s email property to the request, but you need to pass an array with the index ‘name’ and any other property you wish to attach to the Customer. All available properties can be found on https://developers.conekta.com/reference/clientes#hnjh
After this, now your user will have a filled property conekta_id.
For convenience, you can assert that the user is already a Conekta customer by calling hasConektaId method.
$user->hasConektaId(); // Will return bool
Lenguaje del código: PHP (php)