wildan99 / octo-bundle

Octo bundle

0.9.9.4 2023-07-28 15:35 UTC

This package is auto-updated.

Last update: 2024-09-28 18:10:52 UTC


README

安装

安装包

composer req wildan99/octo-bundle

添加到config/bundles.php

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

将以下行添加到您的.env文件中

###> 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 ###

如何使用

您需要在类的构造方法中使用此服务

简单使用示例

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: ''))
    }
}