{"id":36428222,"url":"https://github.com/atsareva/monopay","last_synced_at":"2026-01-11T18:19:34.990Z","repository":{"id":262429589,"uuid":"886652338","full_name":"atsareva/monopay","owner":"atsareva","description":"A simple PHP library to work with Monobank Acquiring. For detailed API documentation, refer to Monobank Acquiring API -https://api.monobank.ua/docs/acquiring.html","archived":false,"fork":false,"pushed_at":"2024-11-13T16:34:27.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T08:17:47.811Z","etag":null,"topics":["mono-php-sdk","monobank","monobank-acquiring","monobank-api","monobank-client","monopay","plata-by-mono","platabymono"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atsareva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-11T11:10:44.000Z","updated_at":"2024-11-13T16:31:53.000Z","dependencies_parsed_at":"2024-11-12T12:18:11.090Z","dependency_job_id":null,"html_url":"https://github.com/atsareva/monopay","commit_stats":null,"previous_names":["atsareva/monopay"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atsareva/monopay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsareva%2Fmonopay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsareva%2Fmonopay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsareva%2Fmonopay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsareva%2Fmonopay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atsareva","download_url":"https://codeload.github.com/atsareva/monopay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsareva%2Fmonopay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28317697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mono-php-sdk","monobank","monobank-acquiring","monobank-api","monobank-client","monopay","plata-by-mono","platabymono"],"created_at":"2026-01-11T18:19:34.088Z","updated_at":"2026-01-11T18:19:34.980Z","avatar_url":"https://github.com/atsareva.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monobank | MonoPay | Plata by Mono Library\n\nA simple PHP library to work with Monobank Acquiring. For detailed API documentation, refer to [Monobank Acquiring API](https://api.monobank.ua/docs/acquiring.html).\n\n## Dependencies\n- guzzlehttp/guzzle \u003e= 7.9.0\n- PHP \u003e= 7.4\n\n## How to Use\nFirst, obtain an API token, which is required to access Monobank's API. You can register one in your Monobank [personal account](https://web.monobank.ua/) to activate a token or enable a [test token](https://api.monobank.ua/index.html).\n\nRun the next command to install the library with all dependencies:\n\n```\ncomposer require atsareva/monopay\n```\n\n## Usage Examples\n\n### Initialize Mono Client\n```\nrequire_once 'vendor/autoload.php';\n\n/** Initialize Mono client */\n$client = new MonoPay\\ClientMono('TOKEN');\n```\n\n### Invoice Examples\n\n#### Create an Invoice\n\n```\n$options = [\n    'amount' =\u003e 5000,\n    'merchantPaymInfo' =\u003e [\n        'reference' =\u003e '1000000021',\n        'destination' =\u003e 'Order #1000000021',\n        'basketOrder' =\u003e [\n            [\n                'name' =\u003e 'Product ABC',\n                'qty' =\u003e 1,\n                'sum' =\u003e 5000, // Amount in the smallest currency unit per product unit\n                'icon' =\u003e 'https://example.com/media/catalog/product/product_abc.jpg',\n                'unit' =\u003e 'kg',\n            ],\n        ],\n    ],\n    'redirectUrl' =\u003e 'https://example.com/monopay/success.php',\n    'webHookUrl' =\u003e 'https://example.com/monopay/webhook.php',\n    'paymentType' =\u003e 'hold', // Options: debit | hold\n];\n\ntry {\n    $invoice = new MonoPay\\Invoice();\n    $invoice\n        -\u003esetClient($client)\n        -\u003ecreate($options);\n\n    // Save invoice ID for future reference\n    echo \"Invoice ID: \" . $invoice-\u003egetInvoiceId() . '\u003cbr/\u003e';\n    echo \"Invoice Payment URL: \" . $invoice-\u003egetPageUrl() . '\u003cbr/\u003e';\n    echo \"Invoice Status: \" . $invoice-\u003egetStatus() . '\u003cbr/\u003e';\n\n    // Redirect customer to payment page\n    header(\"Location: \" . $invoice-\u003egetPageUrl());\n} catch (Exception $e) {\n    // Handle error\n    echo $e-\u003egetMessage();\n}\n```\n\n#### Get Updated Invoice Data\n\n```\ntry {\n    $invoice\n        -\u003esetClient($client)\n        -\u003esetInvoiceId('INVOICE_ID')\n        -\u003eupdateInfo();\n\n    echo \"Invoice ID: \" . $invoice-\u003egetInvoiceId() . '\u003cbr/\u003e';\n    echo \"Invoice Status: \" . $invoice-\u003egetStatus() . '\u003cbr/\u003e';\n\n} catch (Exception $e) {\n    // Handle error\n    echo $e-\u003egetMessage();\n}\n```\n\n#### Finalize Invoice (Hold Status)\n\n```\ntry {\n    $invoice\n        -\u003esetClient($client)\n        -\u003esetInvoiceId('INVOICE_ID')\n        -\u003ecapture();\n\n} catch (Exception $e) {\n    // Handle error\n    echo $e-\u003egetMessage();\n}\n```\n\n#### Refund Invoice (Successful Payment)\n\n```\ntry {\n    $invoice\n        -\u003esetClient($client)\n        -\u003esetInvoiceId('INVOICE_ID')\n        -\u003erefund()\n        -\u003eupdateInfo();\n\n    echo \"Invoice Status: \" . $invoice-\u003egetStatus() . '\u003cbr/\u003e';\n\n} catch (Exception $e) {\n    // Handle error\n    echo $e-\u003egetMessage();\n}\n```\n\n### Merchant Examples\n\n```\ntry {\n    $merchant = new MonoPay\\Merchant();\n    $merchant\n        -\u003esetClient($client)\n        -\u003eload();\n\n    echo \"Merchant ID: \" . $merchant-\u003egetMerchantId() . '\u003cbr/\u003e';\n    echo \"Merchant Name: \" . $merchant-\u003egetMerchantName() . '\u003cbr/\u003e';\n    echo \"Public Key: \" . $merchant-\u003egetPublicKey() . '\u003cbr/\u003e';\n\n    // Load all statements from the last 4 days\n    $statements = $merchant-\u003egetStatement(time() - 60 * 60 * 96);\n    foreach ($statements as $statement) {\n        var_dump($statement);\n    }\n} catch (Exception $e) {\n    // Handle error\n    echo $e-\u003egetMessage();\n}\n\n```\n\n---\n\n**Note:** This library is currently in development. Please create a ticket if you encounter any issues.\n\nThanks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsareva%2Fmonopay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatsareva%2Fmonopay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsareva%2Fmonopay/lists"}