Okaruto/Cryptonator is an alternative implementation of the Cryptonator.com Merchant API SDK. All API methods needed to use the Payment API are implemented.
Just require it with composer:
composer require okaruto/cryptonator
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
Okaruto/Cryptonator is licensed under the MIT license.