gamevault/lunar-pensopay is a Laravel package for a lunar community payment driver for pensopay.
It currently has 2 GitHub stars and 0 downloads on Packagist.
Install it with composer require gamevault/lunar-pensopay.
Discover more Laravel packages by gamevault
or browse all Laravel packages to compare alternatives.
Last updated
Easily integrate Pensopay into Lunar with the community payment driver for Pensopay. This integration are based on PensoPay API docs
There is still some minor stuff to take into consideration
You can install the package via composer:
composer require gamevault/lunar-pensopay
This package uses the spatie laravel-webhook-client package to handle the callbacks sent from Pensopay.
You can publish the configs and run the migrations with:
php artisan vendor:publish --tag="lunar-pensopay-config"
php artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-config"
php artisan migrate
This is the contents of the published pensopay config file:
return [
'policy' => env('AUTO_CAPTURE', false),
'url' => env('PENSOPAY_URL', 'https://api.pensopay.com/v1'),
'token' => env('PENSOPAY_TOKEN'),
'testmode' => env('PENSOPAY_TESTMODE', false),
];
The webhook-client.php should look like the following:
<?php
return [
'configs' => [
[
'name' => 'pensopay-webhook',
'signing_secret' => config('PENSOPAY_SIGNING_SECRET'),
'signature_header_name' => 'pensopay-signature',
'signature_validator' => \Spatie\WebhookClient\SignatureValidator\DefaultSignatureValidator::class,
'webhook_profile' => \Spatie\WebhookClient\WebhookProfile\ProcessEverythingWebhookProfile::class,
'webhook_response' => \Spatie\WebhookClient\WebhookResponse\DefaultRespondsTo::class,
'webhook_model' => \Spatie\WebhookClient\Models\WebhookCall::class,
'process_webhook_job' => \Gamevault\Pensopay\Jobs\ProcessPensopayCallbackJob::class,
],
],
/*
* The integer amount of days after which models should be deleted.
*
* 7 deletes all records after 1 week. Set to null if no models should be deleted.
*/
'delete_after_days' => 30,
];
The webhook endpoint can be defined anywhere in the route files with the following:
Route::webhooks('pensopay-webhook', 'pensopay-webhook');
To get started, the payment driver must be registered at the AppServiceProvider:
public function register()
{
Payments::extend('pensopay', function ($app) {
return $app->make(\Gamevault\Pensopay\PensopayPaymentType::class);
});
}
The payment methods can be invoked like the following:
/** @var Pensopay $paymentDriver */
$paymentDriver = Payments::driver('pensopay');
$paymentDriver->cart($cart);
$paymentAuthorize = $paymentDriver->authorize();
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.