okaruto / cryptonator
Cryptonator Merchant API
Installs: 2 452
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
Requires
- php: ^7.3 | ^8.0
- ext-curl: *
- ext-json: *
- ext-openssl: *
- guzzlehttp/guzzle: ^6.0
- lmc/http-constants: ^1.0
Requires (Dev)
- ext-xdebug: *
- php-coveralls/php-coveralls: ^2.1
- phpmd/phpmd: ^2.6
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.0
- vimeo/psalm: ^4.0
This package is auto-updated.
Last update: 2025-03-10 15:01:13 UTC
README
Okaruto/Cryptonator is an alternative implementation of the Cryptonator.com Merchant API SDK. All API methods needed to use the Payment API are implemented.
Installation
Just require it with composer:
composer require okaruto/cryptonator
Usage
To get the MerchantApi instance:
$merchantApi = new Okaruto\Cryptonator\MerchantApi( new GuzzleHttp\Client(), // Guzzle HTTP client instance 'merchant id', // Cryptonator merchant id 'merchant secret' // Cryptonator merchant secret );
Following methods are available:
Get a list of your invoices
$merchantApi->listInvoices( ?string $invoiceStatus, // Filter by invoice status, @see Okaruto\Cryptonator\Values\InvoiceStatusValue ?string $invoiceCurrency, // Filter by invoice currency, @see Okaruto\Cryptonator\Values\InvoiceCurrencyValue ?string $checkoutCurrency // Filter by cryptocurrency, @see Okaruto\Cryptonator\Values\CheckoutCurrencyValue ): InvoiceCollection
Get a single invoice (only partial details)
$merchantApi->getInvoice( string $invoiceId // Cryptonator invoice id ): Invoice
Create a new invoice (all details)
$merchantApi->createInvoice( string $itemName, // Your item name string $checkoutCurrency, // Checkout cryptocurrency, @see Okaruto\Cryptonator\Values\CheckoutCurrencyValue float $invoiceAmount, // Invoice amount string $invoiceCurrency, // Invoice currency, @see Okaruto\Cryptonator\Values\InvoiceCurrencyValue ?string $orderId, // Your order id ?string $itemDescription, // Item description ?string $successUrl, // Success URL to redirect user ?string $failedUrl, // Failure URL to redirect user ?string $confirmationPolicy, // Confirmation policy, @see Okaruto\Cryptonator\Values\ConfirmationPolicyValue ?string $language // Checkout language, @see Okaruto\Cryptonator\Values\LanguageValue ): Invoice
Create an URL to redirect the customer for payment over cryptonator checkout page
$merchantApi->startPayment( string $itemName, // Your item name float $invoiceAmount, // Invoice amount string $invoiceCurrency, // Invoice currency, @see Okaruto\Cryptonator\Values\InvoiceCurrencyValue ?string $orderId, // Your order id ?string $itemDescription, // Item description ?string $successUrl, // Success URL to redirect user ?string $failedUrl, // Failure URL to redirect user ?string $language // Checkout language, @see Okaruto\Cryptonator\Values\LanguageValue ): string
Create an invoice out of a HTTP notification
$merchantApi->httpNotificationInvoice( array $data // Post values of HTTP Notification ): string
License
Okaruto/Cryptonator is licensed under the MIT license.