wildan99/octo-bundle

Octo bundle

Installs: 36

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

0.9.9.4 2023-07-28 15:35 UTC

This package is auto-updated.

Last update: 2024-04-28 17:18:58 UTC


README

Installation

Install the package

composer req wildan99/octo-bundle

Add to config/bundles.php

Daniil\OctoBundle\OctoBundle::class => ['all' => true],

Add next lines to your .env file

###> octo ###
OCTO_SHOP_ID=<get it in OCTO>
OCTO_SECRET=<get it in OCTO>
OCTO_NOTIFY_URL=
OCTO_RETURN_URL=
OCTO_TEST=true
OCTO_AUTO_CAPTURE=true
###< octo ###

How to use

You need to use this service in construct method of class

Example of simple using

class MyClass 
{
    public function __construct(private \Daniil\OctoBundle\Service\Client $client) 
    {
    }
    
    public function prepare(): void
    {
        $this->client->prepare(new PrepareRequest(shopTransactionId: 'test', sum: 1000, currency: Currency::UZS, description: ''))
    }
}