lee-to/laravel-cashbox

Laravel cashbox module

0.2.3 2022-02-16 16:40 UTC

This package is auto-updated.

Last update: 2024-12-16 23:18:58 UTC


README

Install

  • composer require lee-to/laravel-cashbox

  • php artisan vendor:publish --provider="Leeto\CashBox\Providers\CashBoxServiceProvider"

  • php artisan cashbox:install

  • configure config/cashbox.php

Available payment gateways

  • YooKassa (config/cashbox.php credentials - id(shopId), key(shopPassword))
  • KassaCom (config/cashbox.php credentials - login, secret, key(api-key))

Usage

Create payment url
app("payment")->setPaymentDescription("Premium");
app("payment")->setReturnUrl(route("home"));
app("payment")->setAmount(100);
app("payment")->setParams([
    "user_id" => auth()->id(),
]);

return redirect(app("payment")->createPayment());
Capture payment
return response()->json(app("payment")->capturePayment(function ($paymentParams, $paymentToken, $bankCard) {
    
}));
Tests
  • vendor/bin/phpunit tests