Skip to content

Repository files navigation

MakePay PHP SDK

Official Composer SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, anonymous public links, customer portals, subscriptions, POS terminals, products, Simple Shop storefronts, invoices, bookkeeping records, branded domains, operational settings, and signed webhook handlers from PHP backends.

  • Package: makepay/makepay-php
  • Packagist: https://packagist.org/packages/makepay/makepay-php
  • Source: https://github.com/makecryptoio/makepay-php-sdk

Install

composer require makepay/makepay-php

The SDK supports PHP 7.4 or newer and requires ext-json. ext-curl is used when available; otherwise JSON requests fall back to PHP streams.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

useMakePay\Client;
$makepay = newClient([
'keyId' => getenv('MAKEPAY_KEY_ID'),
'keySecret' => getenv('MAKEPAY_KEY_SECRET'),
]);

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

Payment Links

$response = $makepay->createPaymentLink([
'title' => 'Order #1042',
'description' => 'Checkout for order #1042',
'amount' => '129.99',
'currency' => 'USDT',
'orderId' => 'order_1042',
'customerEmail' => 'buyer@example.com',
'returnUrl' => 'https://merchant.example/orders/1042',
'successUrl' => 'https://merchant.example/orders/1042/success',
'failureUrl' => 'https://merchant.example/orders/1042/pay',
'expirationTime' => '12h',
]);
header('Location: ' . $response['paymentLink']['publicUrl']);

Read, update, and email existing links:

$makepay->listPaymentLinks();
$makepay->getPaymentLink('PAYMENT_LINK_UID');
$makepay->updatePaymentLink('PAYMENT_LINK_UID', ['status' => 'paused']);
$makepay->sendPaymentRequestEmail('PAYMENT_LINK_UID', 'buyer@example.com');

Donations

$donation = $makepay->createDonationLink([
'title' => 'Spring campaign',
'description' => 'Support the 2026 spring fundraiser.',
'defaultAmountUsd' => '25',
'minimumAmountUsd' => '5',
'donationSlug' => 'spring-campaign',
]);
$makepay->listDonationLinks();
$makepay->getDonationLink('DONATION_UID');
$makepay->updateDonationLink('DONATION_UID', ['status' => 'paused']);

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

$response = Client::createAnonymousPaymentLink([
'amount' => '25',
'settlement' => [
'currency' => 'USDT',
'priorities' => [
[
'chain' => 'ETH',
'address' => '0xYourSettlementWallet',
'asset' => 'ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7',
],
],
],
'title' => 'Invoice #1042',
'customerEmail' => 'buyer@example.com',
'webhookUrl' => 'https://merchant.example/webhooks/makepay',
]);

Checkout URLs And Embeds

$paymentUid = $response['paymentLink']['uid'];
$hostedUrl = $makepay->hostedCheckoutUrl($paymentUid);
$embedUrl = $makepay->embeddedCheckoutUrl($paymentUid, [
'parentOrigin' => 'https://merchant.example',
]);
echo$makepay->embedButtonHtml($paymentUid, [
'buttonLabel' => 'Pay with crypto',
]);
echo$makepay->iframeHtml($paymentUid, [
'iframeTitle' => 'Secure MakePay checkout',
]);

Donation pages have URL helpers too:

$makepay->hostedDonationUrl('spring-campaign');
$makepay->embeddedDonationUrl('spring-campaign', [
'parentOrigin' => 'https://merchant.example',
]);

Customers And Subscriptions

$makepay->upsertCustomer([
'email' => 'buyer@example.com',
'name' => 'Buyer Example',
'clientId' => 'crm_123',
'metadata' => ['plan' => 'pro'],
]);
$makepay->listCustomers();
$makepay->createCustomerPortal('CUSTOMER_ID', [
'returnUrl' => 'https://merchant.example/account',
]);
$makepay->createSubscription([
'amountUsd' => '29',
'customerEmail' => 'buyer@example.com',
'label' => 'Monthly plan',
'billingIntervalUnit' => 'month',
'billingIntervalCount' => 1,
'sendPaymentRequestEmail' => true,
]);
$makepay->listSubscriptions();

POS, Products, And Simple Shop

$terminal = $makepay->createPosTerminal([
'name' => 'Front counter',
'pin' => '1234',
'allowedAssets' => ['ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7'],
'emailCollectionMode' => 'optional_after_deposit',
'catalogEnabled' => true,
]);
$makepay->listPosTerminals();
$makepay->updatePosTerminal('POS_UID', ['name' => 'Front counter', 'pin' => '5678']);
$makepay->createProduct([
'name' => 'Digital guide',
'productType' => 'digital',
'basePriceUsd' => '19',
'shopSlug' => 'digital-guide',
'images' => [
['url' => 'https://merchant.example/guide.png', 'alt' => 'Guide cover'],
],
]);
$makepay->createProductDownload('PRODUCT_UID', [
'fileName' => 'guide.pdf',
'contentType' => 'application/pdf',
'url' => 'https://merchant.example/downloads/guide.pdf',
]);
$makepay->updateShop([
'slug' => 'merchant-shop',
'displayCurrency' => 'USD',
'checkoutMode' => 'hosted',
'branding' => ['accentColor' => '#14b8a6'],
]);
$makepay->updateShopDomain('shop.merchant.example');
$makepay->refreshShopDomain();
$makepay->createShopCoupon([
'code' => 'SPRING10',
'discountType' => 'percent',
'value' => '10',
]);
$makepay->listShopOrders(['status' => 'paid', 'limit' => 25]);

Invoices And Bookkeeping

$makepay->createBookkeepingInvoice([
'title' => 'Invoice #1042',
'currency' => 'USD',
'issueDate' => '2026-05-15',
'dueDate' => '2026-05-30',
'counterparty' => [
'name' => 'Buyer Example',
'email' => 'buyer@example.com',
'clientId' => 'crm_123',
],
'lineItems' => [
[
'description' => 'Implementation services',
'quantity' => '1',
'unitAmount' => '500',
'taxAmount' => '0',
],
],
]);
$makepay->createBookkeepingInvoicePaymentLink('INVOICE_UID', [
'sendPaymentRequestEmail' => true,
]);
$makepay->listBookkeepingInvoices();
$makepay->getBookkeepingInvoice('INVOICE_UID');
$makepay->updateBookkeepingInvoice('INVOICE_UID', ['status' => 'open']);

Expenses can be created manually or from wallet activity:

$makepay->createBookkeepingExpense([
'title' => 'Hosting',
'amount' => '49',
'currency' => 'USD',
'incurredOn' => '2026-05-15',
'category' => 'Infrastructure',
'counterparty' => ['name' => 'Vendor Example', 'type' => 'vendor'],
]);
$makepay->createBookkeepingExpenseFromActivity([
'walletActivityEventKey' => 'CHAIN_EVENT_KEY',
'category' => 'Settlement',
]);
$makepay->createBookkeepingReconciliation([
'invoiceId' => 'INVOICE_UID',
'paymentSessionId' => 'PAYMENT_SESSION_ID',
'linkType' => 'payment',
]);

Document uploads accept a local path string or CURLFile:

$makepay->uploadBookkeepingDocument([
'file' => __DIR__ . '/receipt.pdf',
'fileName' => 'receipt.pdf',
'contentType' => 'application/pdf',
'documentType' => 'receipt',
'expenseId' => 'EXPENSE_UID',
]);
$makepay->listBookkeepingDocuments();
$makepay->getBookkeepingDocumentDownloadUrl('DOCUMENT_UID');
$makepay->runBookkeepingDocumentOcr('DOCUMENT_UID');
$makepay->getBookkeepingSummary();

Branding And Operational APIs

$makepay->updateBranding([
'brandName' => 'Merchant',
'supportEmail' => 'support@merchant.example',
'brandingBrandColor' => '#111827',
'brandingAccentColor' => '#14b8a6',
'paymentLinkTheme' => 'system',
'paymentLinkDomain' => 'pay.merchant.example',
'emailSendingDomain' => 'mail.merchant.example',
]);
$makepay->getBranding();
$makepay->refreshBrandingDomains('all');
$makepay->getSettings();
$makepay->updateSettings([
'callbackUrl' => 'https://merchant.example/webhooks/makepay',
]);
$makepay->listDestinationAssets();
$makepay->listWebhookRequests(['limit' => 25]);

Webhook Verification

Read the exact raw request body before parsing JSON.

useMakePay\Webhook;
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_MAKEPAY_SIGNATURE'] ?? null;
$event = Webhook::parse($rawBody, $signature, getenv('MAKEPAY_WEBHOOK_SECRET'));
if (($event['event']['type'] ?? '') === 'status_changed') {
// Update your local order status.
}
http_response_code(200);
echo'ok';

Use Webhook::verify() when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linksClient::createAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksWebhook::verify, Webhook::parse, plus client proxy methods

Data And Errors

Payload arrays use the same camelCase field names as the MakePay API and npm SDK. Use strings for decimal money values when precision matters, and ISO date strings for date fields such as issueDate.

API errors throw MakePay\MakePayException with the HTTP status code and decoded response body.

useMakePay\MakePayException;
try {
$makepay->getPaymentLink('PAYMENT_LINK_UID');
} catch (MakePayException$error) {
error_log($error->getMessage());
error_log((string) $error->getStatusCode());
}

About

Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - makepay-apps/makepay-php-sdk: Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay PHP SDK

Official Composer SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, anonymous public links, customer portals, subscriptions, POS terminals, products, Simple Shop storefronts, invoices, bookkeeping records, branded domains, operational settings, and signed webhook handlers from PHP backends.

  • Package: makepay/makepay-php
  • Packagist: https://packagist.org/packages/makepay/makepay-php
  • Source: https://github.com/makecryptoio/makepay-php-sdk

Install

composer require makepay/makepay-php

The SDK supports PHP 7.4 or newer and requires ext-json. ext-curl is used when available; otherwise JSON requests fall back to PHP streams.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

useMakePay\Client;
$makepay = newClient([
'keyId' => getenv('MAKEPAY_KEY_ID'),
'keySecret' => getenv('MAKEPAY_KEY_SECRET'),
]);

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

Payment Links

$response = $makepay->createPaymentLink([
'title' => 'Order #1042',
'description' => 'Checkout for order #1042',
'amount' => '129.99',
'currency' => 'USDT',
'orderId' => 'order_1042',
'customerEmail' => 'buyer@example.com',
'returnUrl' => 'https://merchant.example/orders/1042',
'successUrl' => 'https://merchant.example/orders/1042/success',
'failureUrl' => 'https://merchant.example/orders/1042/pay',
'expirationTime' => '12h',
]);
header('Location: ' . $response['paymentLink']['publicUrl']);

Read, update, and email existing links:

$makepay->listPaymentLinks();
$makepay->getPaymentLink('PAYMENT_LINK_UID');
$makepay->updatePaymentLink('PAYMENT_LINK_UID', ['status' => 'paused']);
$makepay->sendPaymentRequestEmail('PAYMENT_LINK_UID', 'buyer@example.com');

Donations

$donation = $makepay->createDonationLink([
'title' => 'Spring campaign',
'description' => 'Support the 2026 spring fundraiser.',
'defaultAmountUsd' => '25',
'minimumAmountUsd' => '5',
'donationSlug' => 'spring-campaign',
]);
$makepay->listDonationLinks();
$makepay->getDonationLink('DONATION_UID');
$makepay->updateDonationLink('DONATION_UID', ['status' => 'paused']);

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

$response = Client::createAnonymousPaymentLink([
'amount' => '25',
'settlement' => [
'currency' => 'USDT',
'priorities' => [
[
'chain' => 'ETH',
'address' => '0xYourSettlementWallet',
'asset' => 'ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7',
],
],
],
'title' => 'Invoice #1042',
'customerEmail' => 'buyer@example.com',
'webhookUrl' => 'https://merchant.example/webhooks/makepay',
]);

Checkout URLs And Embeds

$paymentUid = $response['paymentLink']['uid'];
$hostedUrl = $makepay->hostedCheckoutUrl($paymentUid);
$embedUrl = $makepay->embeddedCheckoutUrl($paymentUid, [
'parentOrigin' => 'https://merchant.example',
]);
echo$makepay->embedButtonHtml($paymentUid, [
'buttonLabel' => 'Pay with crypto',
]);
echo$makepay->iframeHtml($paymentUid, [
'iframeTitle' => 'Secure MakePay checkout',
]);

Donation pages have URL helpers too:

$makepay->hostedDonationUrl('spring-campaign');
$makepay->embeddedDonationUrl('spring-campaign', [
'parentOrigin' => 'https://merchant.example',
]);

Customers And Subscriptions

$makepay->upsertCustomer([
'email' => 'buyer@example.com',
'name' => 'Buyer Example',
'clientId' => 'crm_123',
'metadata' => ['plan' => 'pro'],
]);
$makepay->listCustomers();
$makepay->createCustomerPortal('CUSTOMER_ID', [
'returnUrl' => 'https://merchant.example/account',
]);
$makepay->createSubscription([
'amountUsd' => '29',
'customerEmail' => 'buyer@example.com',
'label' => 'Monthly plan',
'billingIntervalUnit' => 'month',
'billingIntervalCount' => 1,
'sendPaymentRequestEmail' => true,
]);
$makepay->listSubscriptions();

POS, Products, And Simple Shop

$terminal = $makepay->createPosTerminal([
'name' => 'Front counter',
'pin' => '1234',
'allowedAssets' => ['ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7'],
'emailCollectionMode' => 'optional_after_deposit',
'catalogEnabled' => true,
]);
$makepay->listPosTerminals();
$makepay->updatePosTerminal('POS_UID', ['name' => 'Front counter', 'pin' => '5678']);
$makepay->createProduct([
'name' => 'Digital guide',
'productType' => 'digital',
'basePriceUsd' => '19',
'shopSlug' => 'digital-guide',
'images' => [
['url' => 'https://merchant.example/guide.png', 'alt' => 'Guide cover'],
],
]);
$makepay->createProductDownload('PRODUCT_UID', [
'fileName' => 'guide.pdf',
'contentType' => 'application/pdf',
'url' => 'https://merchant.example/downloads/guide.pdf',
]);
$makepay->updateShop([
'slug' => 'merchant-shop',
'displayCurrency' => 'USD',
'checkoutMode' => 'hosted',
'branding' => ['accentColor' => '#14b8a6'],
]);
$makepay->updateShopDomain('shop.merchant.example');
$makepay->refreshShopDomain();
$makepay->createShopCoupon([
'code' => 'SPRING10',
'discountType' => 'percent',
'value' => '10',
]);
$makepay->listShopOrders(['status' => 'paid', 'limit' => 25]);

Invoices And Bookkeeping

$makepay->createBookkeepingInvoice([
'title' => 'Invoice #1042',
'currency' => 'USD',
'issueDate' => '2026-05-15',
'dueDate' => '2026-05-30',
'counterparty' => [
'name' => 'Buyer Example',
'email' => 'buyer@example.com',
'clientId' => 'crm_123',
],
'lineItems' => [
[
'description' => 'Implementation services',
'quantity' => '1',
'unitAmount' => '500',
'taxAmount' => '0',
],
],
]);
$makepay->createBookkeepingInvoicePaymentLink('INVOICE_UID', [
'sendPaymentRequestEmail' => true,
]);
$makepay->listBookkeepingInvoices();
$makepay->getBookkeepingInvoice('INVOICE_UID');
$makepay->updateBookkeepingInvoice('INVOICE_UID', ['status' => 'open']);

Expenses can be created manually or from wallet activity:

$makepay->createBookkeepingExpense([
'title' => 'Hosting',
'amount' => '49',
'currency' => 'USD',
'incurredOn' => '2026-05-15',
'category' => 'Infrastructure',
'counterparty' => ['name' => 'Vendor Example', 'type' => 'vendor'],
]);
$makepay->createBookkeepingExpenseFromActivity([
'walletActivityEventKey' => 'CHAIN_EVENT_KEY',
'category' => 'Settlement',
]);
$makepay->createBookkeepingReconciliation([
'invoiceId' => 'INVOICE_UID',
'paymentSessionId' => 'PAYMENT_SESSION_ID',
'linkType' => 'payment',
]);

Document uploads accept a local path string or CURLFile:

$makepay->uploadBookkeepingDocument([
'file' => __DIR__ . '/receipt.pdf',
'fileName' => 'receipt.pdf',
'contentType' => 'application/pdf',
'documentType' => 'receipt',
'expenseId' => 'EXPENSE_UID',
]);
$makepay->listBookkeepingDocuments();
$makepay->getBookkeepingDocumentDownloadUrl('DOCUMENT_UID');
$makepay->runBookkeepingDocumentOcr('DOCUMENT_UID');
$makepay->getBookkeepingSummary();

Branding And Operational APIs

$makepay->updateBranding([
'brandName' => 'Merchant',
'supportEmail' => 'support@merchant.example',
'brandingBrandColor' => '#111827',
'brandingAccentColor' => '#14b8a6',
'paymentLinkTheme' => 'system',
'paymentLinkDomain' => 'pay.merchant.example',
'emailSendingDomain' => 'mail.merchant.example',
]);
$makepay->getBranding();
$makepay->refreshBrandingDomains('all');
$makepay->getSettings();
$makepay->updateSettings([
'callbackUrl' => 'https://merchant.example/webhooks/makepay',
]);
$makepay->listDestinationAssets();
$makepay->listWebhookRequests(['limit' => 25]);

Webhook Verification

Read the exact raw request body before parsing JSON.

useMakePay\Webhook;
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_MAKEPAY_SIGNATURE'] ?? null;
$event = Webhook::parse($rawBody, $signature, getenv('MAKEPAY_WEBHOOK_SECRET'));
if (($event['event']['type'] ?? '') === 'status_changed') {
// Update your local order status.
}
http_response_code(200);
echo'ok';

Use Webhook::verify() when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linksClient::createAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksWebhook::verify, Webhook::parse, plus client proxy methods

Data And Errors

Payload arrays use the same camelCase field names as the MakePay API and npm SDK. Use strings for decimal money values when precision matters, and ISO date strings for date fields such as issueDate.

API errors throw MakePay\MakePayException with the HTTP status code and decoded response body.

useMakePay\MakePayException;
try {
$makepay->getPaymentLink('PAYMENT_LINK_UID');
} catch (MakePayException$error) {
error_log($error->getMessage());
error_log((string) $error->getStatusCode());
}

About

Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - makepay-apps/makepay-php-sdk: Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay PHP SDK

Official Composer SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, anonymous public links, customer portals, subscriptions, POS terminals, products, Simple Shop storefronts, invoices, bookkeeping records, branded domains, operational settings, and signed webhook handlers from PHP backends.

  • Package: makepay/makepay-php
  • Packagist: https://packagist.org/packages/makepay/makepay-php
  • Source: https://github.com/makecryptoio/makepay-php-sdk

Install

composer require makepay/makepay-php

The SDK supports PHP 7.4 or newer and requires ext-json. ext-curl is used when available; otherwise JSON requests fall back to PHP streams.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

useMakePay\Client;
$makepay = newClient([
'keyId' => getenv('MAKEPAY_KEY_ID'),
'keySecret' => getenv('MAKEPAY_KEY_SECRET'),
]);

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

Payment Links

$response = $makepay->createPaymentLink([
'title' => 'Order #1042',
'description' => 'Checkout for order #1042',
'amount' => '129.99',
'currency' => 'USDT',
'orderId' => 'order_1042',
'customerEmail' => 'buyer@example.com',
'returnUrl' => 'https://merchant.example/orders/1042',
'successUrl' => 'https://merchant.example/orders/1042/success',
'failureUrl' => 'https://merchant.example/orders/1042/pay',
'expirationTime' => '12h',
]);
header('Location: ' . $response['paymentLink']['publicUrl']);

Read, update, and email existing links:

$makepay->listPaymentLinks();
$makepay->getPaymentLink('PAYMENT_LINK_UID');
$makepay->updatePaymentLink('PAYMENT_LINK_UID', ['status' => 'paused']);
$makepay->sendPaymentRequestEmail('PAYMENT_LINK_UID', 'buyer@example.com');

Donations

$donation = $makepay->createDonationLink([
'title' => 'Spring campaign',
'description' => 'Support the 2026 spring fundraiser.',
'defaultAmountUsd' => '25',
'minimumAmountUsd' => '5',
'donationSlug' => 'spring-campaign',
]);
$makepay->listDonationLinks();
$makepay->getDonationLink('DONATION_UID');
$makepay->updateDonationLink('DONATION_UID', ['status' => 'paused']);

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

$response = Client::createAnonymousPaymentLink([
'amount' => '25',
'settlement' => [
'currency' => 'USDT',
'priorities' => [
[
'chain' => 'ETH',
'address' => '0xYourSettlementWallet',
'asset' => 'ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7',
],
],
],
'title' => 'Invoice #1042',
'customerEmail' => 'buyer@example.com',
'webhookUrl' => 'https://merchant.example/webhooks/makepay',
]);

Checkout URLs And Embeds

$paymentUid = $response['paymentLink']['uid'];
$hostedUrl = $makepay->hostedCheckoutUrl($paymentUid);
$embedUrl = $makepay->embeddedCheckoutUrl($paymentUid, [
'parentOrigin' => 'https://merchant.example',
]);
echo$makepay->embedButtonHtml($paymentUid, [
'buttonLabel' => 'Pay with crypto',
]);
echo$makepay->iframeHtml($paymentUid, [
'iframeTitle' => 'Secure MakePay checkout',
]);

Donation pages have URL helpers too:

$makepay->hostedDonationUrl('spring-campaign');
$makepay->embeddedDonationUrl('spring-campaign', [
'parentOrigin' => 'https://merchant.example',
]);

Customers And Subscriptions

$makepay->upsertCustomer([
'email' => 'buyer@example.com',
'name' => 'Buyer Example',
'clientId' => 'crm_123',
'metadata' => ['plan' => 'pro'],
]);
$makepay->listCustomers();
$makepay->createCustomerPortal('CUSTOMER_ID', [
'returnUrl' => 'https://merchant.example/account',
]);
$makepay->createSubscription([
'amountUsd' => '29',
'customerEmail' => 'buyer@example.com',
'label' => 'Monthly plan',
'billingIntervalUnit' => 'month',
'billingIntervalCount' => 1,
'sendPaymentRequestEmail' => true,
]);
$makepay->listSubscriptions();

POS, Products, And Simple Shop

$terminal = $makepay->createPosTerminal([
'name' => 'Front counter',
'pin' => '1234',
'allowedAssets' => ['ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7'],
'emailCollectionMode' => 'optional_after_deposit',
'catalogEnabled' => true,
]);
$makepay->listPosTerminals();
$makepay->updatePosTerminal('POS_UID', ['name' => 'Front counter', 'pin' => '5678']);
$makepay->createProduct([
'name' => 'Digital guide',
'productType' => 'digital',
'basePriceUsd' => '19',
'shopSlug' => 'digital-guide',
'images' => [
['url' => 'https://merchant.example/guide.png', 'alt' => 'Guide cover'],
],
]);
$makepay->createProductDownload('PRODUCT_UID', [
'fileName' => 'guide.pdf',
'contentType' => 'application/pdf',
'url' => 'https://merchant.example/downloads/guide.pdf',
]);
$makepay->updateShop([
'slug' => 'merchant-shop',
'displayCurrency' => 'USD',
'checkoutMode' => 'hosted',
'branding' => ['accentColor' => '#14b8a6'],
]);
$makepay->updateShopDomain('shop.merchant.example');
$makepay->refreshShopDomain();
$makepay->createShopCoupon([
'code' => 'SPRING10',
'discountType' => 'percent',
'value' => '10',
]);
$makepay->listShopOrders(['status' => 'paid', 'limit' => 25]);

Invoices And Bookkeeping

$makepay->createBookkeepingInvoice([
'title' => 'Invoice #1042',
'currency' => 'USD',
'issueDate' => '2026-05-15',
'dueDate' => '2026-05-30',
'counterparty' => [
'name' => 'Buyer Example',
'email' => 'buyer@example.com',
'clientId' => 'crm_123',
],
'lineItems' => [
[
'description' => 'Implementation services',
'quantity' => '1',
'unitAmount' => '500',
'taxAmount' => '0',
],
],
]);
$makepay->createBookkeepingInvoicePaymentLink('INVOICE_UID', [
'sendPaymentRequestEmail' => true,
]);
$makepay->listBookkeepingInvoices();
$makepay->getBookkeepingInvoice('INVOICE_UID');
$makepay->updateBookkeepingInvoice('INVOICE_UID', ['status' => 'open']);

Expenses can be created manually or from wallet activity:

$makepay->createBookkeepingExpense([
'title' => 'Hosting',
'amount' => '49',
'currency' => 'USD',
'incurredOn' => '2026-05-15',
'category' => 'Infrastructure',
'counterparty' => ['name' => 'Vendor Example', 'type' => 'vendor'],
]);
$makepay->createBookkeepingExpenseFromActivity([
'walletActivityEventKey' => 'CHAIN_EVENT_KEY',
'category' => 'Settlement',
]);
$makepay->createBookkeepingReconciliation([
'invoiceId' => 'INVOICE_UID',
'paymentSessionId' => 'PAYMENT_SESSION_ID',
'linkType' => 'payment',
]);

Document uploads accept a local path string or CURLFile:

$makepay->uploadBookkeepingDocument([
'file' => __DIR__ . '/receipt.pdf',
'fileName' => 'receipt.pdf',
'contentType' => 'application/pdf',
'documentType' => 'receipt',
'expenseId' => 'EXPENSE_UID',
]);
$makepay->listBookkeepingDocuments();
$makepay->getBookkeepingDocumentDownloadUrl('DOCUMENT_UID');
$makepay->runBookkeepingDocumentOcr('DOCUMENT_UID');
$makepay->getBookkeepingSummary();

Branding And Operational APIs

$makepay->updateBranding([
'brandName' => 'Merchant',
'supportEmail' => 'support@merchant.example',
'brandingBrandColor' => '#111827',
'brandingAccentColor' => '#14b8a6',
'paymentLinkTheme' => 'system',
'paymentLinkDomain' => 'pay.merchant.example',
'emailSendingDomain' => 'mail.merchant.example',
]);
$makepay->getBranding();
$makepay->refreshBrandingDomains('all');
$makepay->getSettings();
$makepay->updateSettings([
'callbackUrl' => 'https://merchant.example/webhooks/makepay',
]);
$makepay->listDestinationAssets();
$makepay->listWebhookRequests(['limit' => 25]);

Webhook Verification

Read the exact raw request body before parsing JSON.

useMakePay\Webhook;
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_MAKEPAY_SIGNATURE'] ?? null;
$event = Webhook::parse($rawBody, $signature, getenv('MAKEPAY_WEBHOOK_SECRET'));
if (($event['event']['type'] ?? '') === 'status_changed') {
// Update your local order status.
}
http_response_code(200);
echo'ok';

Use Webhook::verify() when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linksClient::createAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksWebhook::verify, Webhook::parse, plus client proxy methods

Data And Errors

Payload arrays use the same camelCase field names as the MakePay API and npm SDK. Use strings for decimal money values when precision matters, and ISO date strings for date fields such as issueDate.

API errors throw MakePay\MakePayException with the HTTP status code and decoded response body.

useMakePay\MakePayException;
try {
$makepay->getPaymentLink('PAYMENT_LINK_UID');
} catch (MakePayException$error) {
error_log($error->getMessage());
error_log((string) $error->getStatusCode());
}

About

Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - makepay-apps/makepay-php-sdk: Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay PHP SDK

Official Composer SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, anonymous public links, customer portals, subscriptions, POS terminals, products, Simple Shop storefronts, invoices, bookkeeping records, branded domains, operational settings, and signed webhook handlers from PHP backends.

  • Package: makepay/makepay-php
  • Packagist: https://packagist.org/packages/makepay/makepay-php
  • Source: https://github.com/makecryptoio/makepay-php-sdk

Install

composer require makepay/makepay-php

The SDK supports PHP 7.4 or newer and requires ext-json. ext-curl is used when available; otherwise JSON requests fall back to PHP streams.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

useMakePay\Client;
$makepay = newClient([
'keyId' => getenv('MAKEPAY_KEY_ID'),
'keySecret' => getenv('MAKEPAY_KEY_SECRET'),
]);

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

Payment Links

$response = $makepay->createPaymentLink([
'title' => 'Order #1042',
'description' => 'Checkout for order #1042',
'amount' => '129.99',
'currency' => 'USDT',
'orderId' => 'order_1042',
'customerEmail' => 'buyer@example.com',
'returnUrl' => 'https://merchant.example/orders/1042',
'successUrl' => 'https://merchant.example/orders/1042/success',
'failureUrl' => 'https://merchant.example/orders/1042/pay',
'expirationTime' => '12h',
]);
header('Location: ' . $response['paymentLink']['publicUrl']);

Read, update, and email existing links:

$makepay->listPaymentLinks();
$makepay->getPaymentLink('PAYMENT_LINK_UID');
$makepay->updatePaymentLink('PAYMENT_LINK_UID', ['status' => 'paused']);
$makepay->sendPaymentRequestEmail('PAYMENT_LINK_UID', 'buyer@example.com');

Donations

$donation = $makepay->createDonationLink([
'title' => 'Spring campaign',
'description' => 'Support the 2026 spring fundraiser.',
'defaultAmountUsd' => '25',
'minimumAmountUsd' => '5',
'donationSlug' => 'spring-campaign',
]);
$makepay->listDonationLinks();
$makepay->getDonationLink('DONATION_UID');
$makepay->updateDonationLink('DONATION_UID', ['status' => 'paused']);

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

$response = Client::createAnonymousPaymentLink([
'amount' => '25',
'settlement' => [
'currency' => 'USDT',
'priorities' => [
[
'chain' => 'ETH',
'address' => '0xYourSettlementWallet',
'asset' => 'ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7',
],
],
],
'title' => 'Invoice #1042',
'customerEmail' => 'buyer@example.com',
'webhookUrl' => 'https://merchant.example/webhooks/makepay',
]);

Checkout URLs And Embeds

$paymentUid = $response['paymentLink']['uid'];
$hostedUrl = $makepay->hostedCheckoutUrl($paymentUid);
$embedUrl = $makepay->embeddedCheckoutUrl($paymentUid, [
'parentOrigin' => 'https://merchant.example',
]);
echo$makepay->embedButtonHtml($paymentUid, [
'buttonLabel' => 'Pay with crypto',
]);
echo$makepay->iframeHtml($paymentUid, [
'iframeTitle' => 'Secure MakePay checkout',
]);

Donation pages have URL helpers too:

$makepay->hostedDonationUrl('spring-campaign');
$makepay->embeddedDonationUrl('spring-campaign', [
'parentOrigin' => 'https://merchant.example',
]);

Customers And Subscriptions

$makepay->upsertCustomer([
'email' => 'buyer@example.com',
'name' => 'Buyer Example',
'clientId' => 'crm_123',
'metadata' => ['plan' => 'pro'],
]);
$makepay->listCustomers();
$makepay->createCustomerPortal('CUSTOMER_ID', [
'returnUrl' => 'https://merchant.example/account',
]);
$makepay->createSubscription([
'amountUsd' => '29',
'customerEmail' => 'buyer@example.com',
'label' => 'Monthly plan',
'billingIntervalUnit' => 'month',
'billingIntervalCount' => 1,
'sendPaymentRequestEmail' => true,
]);
$makepay->listSubscriptions();

POS, Products, And Simple Shop

$terminal = $makepay->createPosTerminal([
'name' => 'Front counter',
'pin' => '1234',
'allowedAssets' => ['ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7'],
'emailCollectionMode' => 'optional_after_deposit',
'catalogEnabled' => true,
]);
$makepay->listPosTerminals();
$makepay->updatePosTerminal('POS_UID', ['name' => 'Front counter', 'pin' => '5678']);
$makepay->createProduct([
'name' => 'Digital guide',
'productType' => 'digital',
'basePriceUsd' => '19',
'shopSlug' => 'digital-guide',
'images' => [
['url' => 'https://merchant.example/guide.png', 'alt' => 'Guide cover'],
],
]);
$makepay->createProductDownload('PRODUCT_UID', [
'fileName' => 'guide.pdf',
'contentType' => 'application/pdf',
'url' => 'https://merchant.example/downloads/guide.pdf',
]);
$makepay->updateShop([
'slug' => 'merchant-shop',
'displayCurrency' => 'USD',
'checkoutMode' => 'hosted',
'branding' => ['accentColor' => '#14b8a6'],
]);
$makepay->updateShopDomain('shop.merchant.example');
$makepay->refreshShopDomain();
$makepay->createShopCoupon([
'code' => 'SPRING10',
'discountType' => 'percent',
'value' => '10',
]);
$makepay->listShopOrders(['status' => 'paid', 'limit' => 25]);

Invoices And Bookkeeping

$makepay->createBookkeepingInvoice([
'title' => 'Invoice #1042',
'currency' => 'USD',
'issueDate' => '2026-05-15',
'dueDate' => '2026-05-30',
'counterparty' => [
'name' => 'Buyer Example',
'email' => 'buyer@example.com',
'clientId' => 'crm_123',
],
'lineItems' => [
[
'description' => 'Implementation services',
'quantity' => '1',
'unitAmount' => '500',
'taxAmount' => '0',
],
],
]);
$makepay->createBookkeepingInvoicePaymentLink('INVOICE_UID', [
'sendPaymentRequestEmail' => true,
]);
$makepay->listBookkeepingInvoices();
$makepay->getBookkeepingInvoice('INVOICE_UID');
$makepay->updateBookkeepingInvoice('INVOICE_UID', ['status' => 'open']);

Expenses can be created manually or from wallet activity:

$makepay->createBookkeepingExpense([
'title' => 'Hosting',
'amount' => '49',
'currency' => 'USD',
'incurredOn' => '2026-05-15',
'category' => 'Infrastructure',
'counterparty' => ['name' => 'Vendor Example', 'type' => 'vendor'],
]);
$makepay->createBookkeepingExpenseFromActivity([
'walletActivityEventKey' => 'CHAIN_EVENT_KEY',
'category' => 'Settlement',
]);
$makepay->createBookkeepingReconciliation([
'invoiceId' => 'INVOICE_UID',
'paymentSessionId' => 'PAYMENT_SESSION_ID',
'linkType' => 'payment',
]);

Document uploads accept a local path string or CURLFile:

$makepay->uploadBookkeepingDocument([
'file' => __DIR__ . '/receipt.pdf',
'fileName' => 'receipt.pdf',
'contentType' => 'application/pdf',
'documentType' => 'receipt',
'expenseId' => 'EXPENSE_UID',
]);
$makepay->listBookkeepingDocuments();
$makepay->getBookkeepingDocumentDownloadUrl('DOCUMENT_UID');
$makepay->runBookkeepingDocumentOcr('DOCUMENT_UID');
$makepay->getBookkeepingSummary();

Branding And Operational APIs

$makepay->updateBranding([
'brandName' => 'Merchant',
'supportEmail' => 'support@merchant.example',
'brandingBrandColor' => '#111827',
'brandingAccentColor' => '#14b8a6',
'paymentLinkTheme' => 'system',
'paymentLinkDomain' => 'pay.merchant.example',
'emailSendingDomain' => 'mail.merchant.example',
]);
$makepay->getBranding();
$makepay->refreshBrandingDomains('all');
$makepay->getSettings();
$makepay->updateSettings([
'callbackUrl' => 'https://merchant.example/webhooks/makepay',
]);
$makepay->listDestinationAssets();
$makepay->listWebhookRequests(['limit' => 25]);

Webhook Verification

Read the exact raw request body before parsing JSON.

useMakePay\Webhook;
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_MAKEPAY_SIGNATURE'] ?? null;
$event = Webhook::parse($rawBody, $signature, getenv('MAKEPAY_WEBHOOK_SECRET'));
if (($event['event']['type'] ?? '') === 'status_changed') {
// Update your local order status.
}
http_response_code(200);
echo'ok';

Use Webhook::verify() when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linksClient::createAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksWebhook::verify, Webhook::parse, plus client proxy methods

Data And Errors

Payload arrays use the same camelCase field names as the MakePay API and npm SDK. Use strings for decimal money values when precision matters, and ISO date strings for date fields such as issueDate.

API errors throw MakePay\MakePayException with the HTTP status code and decoded response body.

useMakePay\MakePayException;
try {
$makepay->getPaymentLink('PAYMENT_LINK_UID');
} catch (MakePayException$error) {
error_log($error->getMessage());
error_log((string) $error->getStatusCode());
}

About

Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - makepay-apps/makepay-php-sdk: Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay PHP SDK

Official Composer SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, anonymous public links, customer portals, subscriptions, POS terminals, products, Simple Shop storefronts, invoices, bookkeeping records, branded domains, operational settings, and signed webhook handlers from PHP backends.

  • Package: makepay/makepay-php
  • Packagist: https://packagist.org/packages/makepay/makepay-php
  • Source: https://github.com/makecryptoio/makepay-php-sdk

Install

composer require makepay/makepay-php

The SDK supports PHP 7.4 or newer and requires ext-json. ext-curl is used when available; otherwise JSON requests fall back to PHP streams.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

useMakePay\Client;
$makepay = newClient([
'keyId' => getenv('MAKEPAY_KEY_ID'),
'keySecret' => getenv('MAKEPAY_KEY_SECRET'),
]);

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

Payment Links

$response = $makepay->createPaymentLink([
'title' => 'Order #1042',
'description' => 'Checkout for order #1042',
'amount' => '129.99',
'currency' => 'USDT',
'orderId' => 'order_1042',
'customerEmail' => 'buyer@example.com',
'returnUrl' => 'https://merchant.example/orders/1042',
'successUrl' => 'https://merchant.example/orders/1042/success',
'failureUrl' => 'https://merchant.example/orders/1042/pay',
'expirationTime' => '12h',
]);
header('Location: ' . $response['paymentLink']['publicUrl']);

Read, update, and email existing links:

$makepay->listPaymentLinks();
$makepay->getPaymentLink('PAYMENT_LINK_UID');
$makepay->updatePaymentLink('PAYMENT_LINK_UID', ['status' => 'paused']);
$makepay->sendPaymentRequestEmail('PAYMENT_LINK_UID', 'buyer@example.com');

Donations

$donation = $makepay->createDonationLink([
'title' => 'Spring campaign',
'description' => 'Support the 2026 spring fundraiser.',
'defaultAmountUsd' => '25',
'minimumAmountUsd' => '5',
'donationSlug' => 'spring-campaign',
]);
$makepay->listDonationLinks();
$makepay->getDonationLink('DONATION_UID');
$makepay->updateDonationLink('DONATION_UID', ['status' => 'paused']);

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

$response = Client::createAnonymousPaymentLink([
'amount' => '25',
'settlement' => [
'currency' => 'USDT',
'priorities' => [
[
'chain' => 'ETH',
'address' => '0xYourSettlementWallet',
'asset' => 'ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7',
],
],
],
'title' => 'Invoice #1042',
'customerEmail' => 'buyer@example.com',
'webhookUrl' => 'https://merchant.example/webhooks/makepay',
]);

Checkout URLs And Embeds

$paymentUid = $response['paymentLink']['uid'];
$hostedUrl = $makepay->hostedCheckoutUrl($paymentUid);
$embedUrl = $makepay->embeddedCheckoutUrl($paymentUid, [
'parentOrigin' => 'https://merchant.example',
]);
echo$makepay->embedButtonHtml($paymentUid, [
'buttonLabel' => 'Pay with crypto',
]);
echo$makepay->iframeHtml($paymentUid, [
'iframeTitle' => 'Secure MakePay checkout',
]);

Donation pages have URL helpers too:

$makepay->hostedDonationUrl('spring-campaign');
$makepay->embeddedDonationUrl('spring-campaign', [
'parentOrigin' => 'https://merchant.example',
]);

Customers And Subscriptions

$makepay->upsertCustomer([
'email' => 'buyer@example.com',
'name' => 'Buyer Example',
'clientId' => 'crm_123',
'metadata' => ['plan' => 'pro'],
]);
$makepay->listCustomers();
$makepay->createCustomerPortal('CUSTOMER_ID', [
'returnUrl' => 'https://merchant.example/account',
]);
$makepay->createSubscription([
'amountUsd' => '29',
'customerEmail' => 'buyer@example.com',
'label' => 'Monthly plan',
'billingIntervalUnit' => 'month',
'billingIntervalCount' => 1,
'sendPaymentRequestEmail' => true,
]);
$makepay->listSubscriptions();

POS, Products, And Simple Shop

$terminal = $makepay->createPosTerminal([
'name' => 'Front counter',
'pin' => '1234',
'allowedAssets' => ['ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7'],
'emailCollectionMode' => 'optional_after_deposit',
'catalogEnabled' => true,
]);
$makepay->listPosTerminals();
$makepay->updatePosTerminal('POS_UID', ['name' => 'Front counter', 'pin' => '5678']);
$makepay->createProduct([
'name' => 'Digital guide',
'productType' => 'digital',
'basePriceUsd' => '19',
'shopSlug' => 'digital-guide',
'images' => [
['url' => 'https://merchant.example/guide.png', 'alt' => 'Guide cover'],
],
]);
$makepay->createProductDownload('PRODUCT_UID', [
'fileName' => 'guide.pdf',
'contentType' => 'application/pdf',
'url' => 'https://merchant.example/downloads/guide.pdf',
]);
$makepay->updateShop([
'slug' => 'merchant-shop',
'displayCurrency' => 'USD',
'checkoutMode' => 'hosted',
'branding' => ['accentColor' => '#14b8a6'],
]);
$makepay->updateShopDomain('shop.merchant.example');
$makepay->refreshShopDomain();
$makepay->createShopCoupon([
'code' => 'SPRING10',
'discountType' => 'percent',
'value' => '10',
]);
$makepay->listShopOrders(['status' => 'paid', 'limit' => 25]);

Invoices And Bookkeeping

$makepay->createBookkeepingInvoice([
'title' => 'Invoice #1042',
'currency' => 'USD',
'issueDate' => '2026-05-15',
'dueDate' => '2026-05-30',
'counterparty' => [
'name' => 'Buyer Example',
'email' => 'buyer@example.com',
'clientId' => 'crm_123',
],
'lineItems' => [
[
'description' => 'Implementation services',
'quantity' => '1',
'unitAmount' => '500',
'taxAmount' => '0',
],
],
]);
$makepay->createBookkeepingInvoicePaymentLink('INVOICE_UID', [
'sendPaymentRequestEmail' => true,
]);
$makepay->listBookkeepingInvoices();
$makepay->getBookkeepingInvoice('INVOICE_UID');
$makepay->updateBookkeepingInvoice('INVOICE_UID', ['status' => 'open']);

Expenses can be created manually or from wallet activity:

$makepay->createBookkeepingExpense([
'title' => 'Hosting',
'amount' => '49',
'currency' => 'USD',
'incurredOn' => '2026-05-15',
'category' => 'Infrastructure',
'counterparty' => ['name' => 'Vendor Example', 'type' => 'vendor'],
]);
$makepay->createBookkeepingExpenseFromActivity([
'walletActivityEventKey' => 'CHAIN_EVENT_KEY',
'category' => 'Settlement',
]);
$makepay->createBookkeepingReconciliation([
'invoiceId' => 'INVOICE_UID',
'paymentSessionId' => 'PAYMENT_SESSION_ID',
'linkType' => 'payment',
]);

Document uploads accept a local path string or CURLFile:

$makepay->uploadBookkeepingDocument([
'file' => __DIR__ . '/receipt.pdf',
'fileName' => 'receipt.pdf',
'contentType' => 'application/pdf',
'documentType' => 'receipt',
'expenseId' => 'EXPENSE_UID',
]);
$makepay->listBookkeepingDocuments();
$makepay->getBookkeepingDocumentDownloadUrl('DOCUMENT_UID');
$makepay->runBookkeepingDocumentOcr('DOCUMENT_UID');
$makepay->getBookkeepingSummary();

Branding And Operational APIs

$makepay->updateBranding([
'brandName' => 'Merchant',
'supportEmail' => 'support@merchant.example',
'brandingBrandColor' => '#111827',
'brandingAccentColor' => '#14b8a6',
'paymentLinkTheme' => 'system',
'paymentLinkDomain' => 'pay.merchant.example',
'emailSendingDomain' => 'mail.merchant.example',
]);
$makepay->getBranding();
$makepay->refreshBrandingDomains('all');
$makepay->getSettings();
$makepay->updateSettings([
'callbackUrl' => 'https://merchant.example/webhooks/makepay',
]);
$makepay->listDestinationAssets();
$makepay->listWebhookRequests(['limit' => 25]);

Webhook Verification

Read the exact raw request body before parsing JSON.

useMakePay\Webhook;
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_MAKEPAY_SIGNATURE'] ?? null;
$event = Webhook::parse($rawBody, $signature, getenv('MAKEPAY_WEBHOOK_SECRET'));
if (($event['event']['type'] ?? '') === 'status_changed') {
// Update your local order status.
}
http_response_code(200);
echo'ok';

Use Webhook::verify() when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linksClient::createAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksWebhook::verify, Webhook::parse, plus client proxy methods

Data And Errors

Payload arrays use the same camelCase field names as the MakePay API and npm SDK. Use strings for decimal money values when precision matters, and ISO date strings for date fields such as issueDate.

API errors throw MakePay\MakePayException with the HTTP status code and decoded response body.

useMakePay\MakePayException;
try {
$makepay->getPaymentLink('PAYMENT_LINK_UID');
} catch (MakePayException$error) {
error_log($error->getMessage());
error_log((string) $error->getStatusCode());
}

About

Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - makepay-apps/makepay-php-sdk: Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay PHP SDK

Official Composer SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, anonymous public links, customer portals, subscriptions, POS terminals, products, Simple Shop storefronts, invoices, bookkeeping records, branded domains, operational settings, and signed webhook handlers from PHP backends.

  • Package: makepay/makepay-php
  • Packagist: https://packagist.org/packages/makepay/makepay-php
  • Source: https://github.com/makecryptoio/makepay-php-sdk

Install

composer require makepay/makepay-php

The SDK supports PHP 7.4 or newer and requires ext-json. ext-curl is used when available; otherwise JSON requests fall back to PHP streams.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

useMakePay\Client;
$makepay = newClient([
'keyId' => getenv('MAKEPAY_KEY_ID'),
'keySecret' => getenv('MAKEPAY_KEY_SECRET'),
]);

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

Payment Links

$response = $makepay->createPaymentLink([
'title' => 'Order #1042',
'description' => 'Checkout for order #1042',
'amount' => '129.99',
'currency' => 'USDT',
'orderId' => 'order_1042',
'customerEmail' => 'buyer@example.com',
'returnUrl' => 'https://merchant.example/orders/1042',
'successUrl' => 'https://merchant.example/orders/1042/success',
'failureUrl' => 'https://merchant.example/orders/1042/pay',
'expirationTime' => '12h',
]);
header('Location: ' . $response['paymentLink']['publicUrl']);

Read, update, and email existing links:

$makepay->listPaymentLinks();
$makepay->getPaymentLink('PAYMENT_LINK_UID');
$makepay->updatePaymentLink('PAYMENT_LINK_UID', ['status' => 'paused']);
$makepay->sendPaymentRequestEmail('PAYMENT_LINK_UID', 'buyer@example.com');

Donations

$donation = $makepay->createDonationLink([
'title' => 'Spring campaign',
'description' => 'Support the 2026 spring fundraiser.',
'defaultAmountUsd' => '25',
'minimumAmountUsd' => '5',
'donationSlug' => 'spring-campaign',
]);
$makepay->listDonationLinks();
$makepay->getDonationLink('DONATION_UID');
$makepay->updateDonationLink('DONATION_UID', ['status' => 'paused']);

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

$response = Client::createAnonymousPaymentLink([
'amount' => '25',
'settlement' => [
'currency' => 'USDT',
'priorities' => [
[
'chain' => 'ETH',
'address' => '0xYourSettlementWallet',
'asset' => 'ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7',
],
],
],
'title' => 'Invoice #1042',
'customerEmail' => 'buyer@example.com',
'webhookUrl' => 'https://merchant.example/webhooks/makepay',
]);

Checkout URLs And Embeds

$paymentUid = $response['paymentLink']['uid'];
$hostedUrl = $makepay->hostedCheckoutUrl($paymentUid);
$embedUrl = $makepay->embeddedCheckoutUrl($paymentUid, [
'parentOrigin' => 'https://merchant.example',
]);
echo$makepay->embedButtonHtml($paymentUid, [
'buttonLabel' => 'Pay with crypto',
]);
echo$makepay->iframeHtml($paymentUid, [
'iframeTitle' => 'Secure MakePay checkout',
]);

Donation pages have URL helpers too:

$makepay->hostedDonationUrl('spring-campaign');
$makepay->embeddedDonationUrl('spring-campaign', [
'parentOrigin' => 'https://merchant.example',
]);

Customers And Subscriptions

$makepay->upsertCustomer([
'email' => 'buyer@example.com',
'name' => 'Buyer Example',
'clientId' => 'crm_123',
'metadata' => ['plan' => 'pro'],
]);
$makepay->listCustomers();
$makepay->createCustomerPortal('CUSTOMER_ID', [
'returnUrl' => 'https://merchant.example/account',
]);
$makepay->createSubscription([
'amountUsd' => '29',
'customerEmail' => 'buyer@example.com',
'label' => 'Monthly plan',
'billingIntervalUnit' => 'month',
'billingIntervalCount' => 1,
'sendPaymentRequestEmail' => true,
]);
$makepay->listSubscriptions();

POS, Products, And Simple Shop

$terminal = $makepay->createPosTerminal([
'name' => 'Front counter',
'pin' => '1234',
'allowedAssets' => ['ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7'],
'emailCollectionMode' => 'optional_after_deposit',
'catalogEnabled' => true,
]);
$makepay->listPosTerminals();
$makepay->updatePosTerminal('POS_UID', ['name' => 'Front counter', 'pin' => '5678']);
$makepay->createProduct([
'name' => 'Digital guide',
'productType' => 'digital',
'basePriceUsd' => '19',
'shopSlug' => 'digital-guide',
'images' => [
['url' => 'https://merchant.example/guide.png', 'alt' => 'Guide cover'],
],
]);
$makepay->createProductDownload('PRODUCT_UID', [
'fileName' => 'guide.pdf',
'contentType' => 'application/pdf',
'url' => 'https://merchant.example/downloads/guide.pdf',
]);
$makepay->updateShop([
'slug' => 'merchant-shop',
'displayCurrency' => 'USD',
'checkoutMode' => 'hosted',
'branding' => ['accentColor' => '#14b8a6'],
]);
$makepay->updateShopDomain('shop.merchant.example');
$makepay->refreshShopDomain();
$makepay->createShopCoupon([
'code' => 'SPRING10',
'discountType' => 'percent',
'value' => '10',
]);
$makepay->listShopOrders(['status' => 'paid', 'limit' => 25]);

Invoices And Bookkeeping

$makepay->createBookkeepingInvoice([
'title' => 'Invoice #1042',
'currency' => 'USD',
'issueDate' => '2026-05-15',
'dueDate' => '2026-05-30',
'counterparty' => [
'name' => 'Buyer Example',
'email' => 'buyer@example.com',
'clientId' => 'crm_123',
],
'lineItems' => [
[
'description' => 'Implementation services',
'quantity' => '1',
'unitAmount' => '500',
'taxAmount' => '0',
],
],
]);
$makepay->createBookkeepingInvoicePaymentLink('INVOICE_UID', [
'sendPaymentRequestEmail' => true,
]);
$makepay->listBookkeepingInvoices();
$makepay->getBookkeepingInvoice('INVOICE_UID');
$makepay->updateBookkeepingInvoice('INVOICE_UID', ['status' => 'open']);

Expenses can be created manually or from wallet activity:

$makepay->createBookkeepingExpense([
'title' => 'Hosting',
'amount' => '49',
'currency' => 'USD',
'incurredOn' => '2026-05-15',
'category' => 'Infrastructure',
'counterparty' => ['name' => 'Vendor Example', 'type' => 'vendor'],
]);
$makepay->createBookkeepingExpenseFromActivity([
'walletActivityEventKey' => 'CHAIN_EVENT_KEY',
'category' => 'Settlement',
]);
$makepay->createBookkeepingReconciliation([
'invoiceId' => 'INVOICE_UID',
'paymentSessionId' => 'PAYMENT_SESSION_ID',
'linkType' => 'payment',
]);

Document uploads accept a local path string or CURLFile:

$makepay->uploadBookkeepingDocument([
'file' => __DIR__ . '/receipt.pdf',
'fileName' => 'receipt.pdf',
'contentType' => 'application/pdf',
'documentType' => 'receipt',
'expenseId' => 'EXPENSE_UID',
]);
$makepay->listBookkeepingDocuments();
$makepay->getBookkeepingDocumentDownloadUrl('DOCUMENT_UID');
$makepay->runBookkeepingDocumentOcr('DOCUMENT_UID');
$makepay->getBookkeepingSummary();

Branding And Operational APIs

$makepay->updateBranding([
'brandName' => 'Merchant',
'supportEmail' => 'support@merchant.example',
'brandingBrandColor' => '#111827',
'brandingAccentColor' => '#14b8a6',
'paymentLinkTheme' => 'system',
'paymentLinkDomain' => 'pay.merchant.example',
'emailSendingDomain' => 'mail.merchant.example',
]);
$makepay->getBranding();
$makepay->refreshBrandingDomains('all');
$makepay->getSettings();
$makepay->updateSettings([
'callbackUrl' => 'https://merchant.example/webhooks/makepay',
]);
$makepay->listDestinationAssets();
$makepay->listWebhookRequests(['limit' => 25]);

Webhook Verification

Read the exact raw request body before parsing JSON.

useMakePay\Webhook;
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_MAKEPAY_SIGNATURE'] ?? null;
$event = Webhook::parse($rawBody, $signature, getenv('MAKEPAY_WEBHOOK_SECRET'));
if (($event['event']['type'] ?? '') === 'status_changed') {
// Update your local order status.
}
http_response_code(200);
echo'ok';

Use Webhook::verify() when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linksClient::createAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksWebhook::verify, Webhook::parse, plus client proxy methods

Data And Errors

Payload arrays use the same camelCase field names as the MakePay API and npm SDK. Use strings for decimal money values when precision matters, and ISO date strings for date fields such as issueDate.

API errors throw MakePay\MakePayException with the HTTP status code and decoded response body.

useMakePay\MakePayException;
try {
$makepay->getPaymentLink('PAYMENT_LINK_UID');
} catch (MakePayException$error) {
error_log($error->getMessage());
error_log((string) $error->getStatusCode());
}

About

Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - makepay-apps/makepay-php-sdk: Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay PHP SDK

Official Composer SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, anonymous public links, customer portals, subscriptions, POS terminals, products, Simple Shop storefronts, invoices, bookkeeping records, branded domains, operational settings, and signed webhook handlers from PHP backends.

  • Package: makepay/makepay-php
  • Packagist: https://packagist.org/packages/makepay/makepay-php
  • Source: https://github.com/makecryptoio/makepay-php-sdk

Install

composer require makepay/makepay-php

The SDK supports PHP 7.4 or newer and requires ext-json. ext-curl is used when available; otherwise JSON requests fall back to PHP streams.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

useMakePay\Client;
$makepay = newClient([
'keyId' => getenv('MAKEPAY_KEY_ID'),
'keySecret' => getenv('MAKEPAY_KEY_SECRET'),
]);

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

Payment Links

$response = $makepay->createPaymentLink([
'title' => 'Order #1042',
'description' => 'Checkout for order #1042',
'amount' => '129.99',
'currency' => 'USDT',
'orderId' => 'order_1042',
'customerEmail' => 'buyer@example.com',
'returnUrl' => 'https://merchant.example/orders/1042',
'successUrl' => 'https://merchant.example/orders/1042/success',
'failureUrl' => 'https://merchant.example/orders/1042/pay',
'expirationTime' => '12h',
]);
header('Location: ' . $response['paymentLink']['publicUrl']);

Read, update, and email existing links:

$makepay->listPaymentLinks();
$makepay->getPaymentLink('PAYMENT_LINK_UID');
$makepay->updatePaymentLink('PAYMENT_LINK_UID', ['status' => 'paused']);
$makepay->sendPaymentRequestEmail('PAYMENT_LINK_UID', 'buyer@example.com');

Donations

$donation = $makepay->createDonationLink([
'title' => 'Spring campaign',
'description' => 'Support the 2026 spring fundraiser.',
'defaultAmountUsd' => '25',
'minimumAmountUsd' => '5',
'donationSlug' => 'spring-campaign',
]);
$makepay->listDonationLinks();
$makepay->getDonationLink('DONATION_UID');
$makepay->updateDonationLink('DONATION_UID', ['status' => 'paused']);

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

$response = Client::createAnonymousPaymentLink([
'amount' => '25',
'settlement' => [
'currency' => 'USDT',
'priorities' => [
[
'chain' => 'ETH',
'address' => '0xYourSettlementWallet',
'asset' => 'ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7',
],
],
],
'title' => 'Invoice #1042',
'customerEmail' => 'buyer@example.com',
'webhookUrl' => 'https://merchant.example/webhooks/makepay',
]);

Checkout URLs And Embeds

$paymentUid = $response['paymentLink']['uid'];
$hostedUrl = $makepay->hostedCheckoutUrl($paymentUid);
$embedUrl = $makepay->embeddedCheckoutUrl($paymentUid, [
'parentOrigin' => 'https://merchant.example',
]);
echo$makepay->embedButtonHtml($paymentUid, [
'buttonLabel' => 'Pay with crypto',
]);
echo$makepay->iframeHtml($paymentUid, [
'iframeTitle' => 'Secure MakePay checkout',
]);

Donation pages have URL helpers too:

$makepay->hostedDonationUrl('spring-campaign');
$makepay->embeddedDonationUrl('spring-campaign', [
'parentOrigin' => 'https://merchant.example',
]);

Customers And Subscriptions

$makepay->upsertCustomer([
'email' => 'buyer@example.com',
'name' => 'Buyer Example',
'clientId' => 'crm_123',
'metadata' => ['plan' => 'pro'],
]);
$makepay->listCustomers();
$makepay->createCustomerPortal('CUSTOMER_ID', [
'returnUrl' => 'https://merchant.example/account',
]);
$makepay->createSubscription([
'amountUsd' => '29',
'customerEmail' => 'buyer@example.com',
'label' => 'Monthly plan',
'billingIntervalUnit' => 'month',
'billingIntervalCount' => 1,
'sendPaymentRequestEmail' => true,
]);
$makepay->listSubscriptions();

POS, Products, And Simple Shop

$terminal = $makepay->createPosTerminal([
'name' => 'Front counter',
'pin' => '1234',
'allowedAssets' => ['ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7'],
'emailCollectionMode' => 'optional_after_deposit',
'catalogEnabled' => true,
]);
$makepay->listPosTerminals();
$makepay->updatePosTerminal('POS_UID', ['name' => 'Front counter', 'pin' => '5678']);
$makepay->createProduct([
'name' => 'Digital guide',
'productType' => 'digital',
'basePriceUsd' => '19',
'shopSlug' => 'digital-guide',
'images' => [
['url' => 'https://merchant.example/guide.png', 'alt' => 'Guide cover'],
],
]);
$makepay->createProductDownload('PRODUCT_UID', [
'fileName' => 'guide.pdf',
'contentType' => 'application/pdf',
'url' => 'https://merchant.example/downloads/guide.pdf',
]);
$makepay->updateShop([
'slug' => 'merchant-shop',
'displayCurrency' => 'USD',
'checkoutMode' => 'hosted',
'branding' => ['accentColor' => '#14b8a6'],
]);
$makepay->updateShopDomain('shop.merchant.example');
$makepay->refreshShopDomain();
$makepay->createShopCoupon([
'code' => 'SPRING10',
'discountType' => 'percent',
'value' => '10',
]);
$makepay->listShopOrders(['status' => 'paid', 'limit' => 25]);

Invoices And Bookkeeping

$makepay->createBookkeepingInvoice([
'title' => 'Invoice #1042',
'currency' => 'USD',
'issueDate' => '2026-05-15',
'dueDate' => '2026-05-30',
'counterparty' => [
'name' => 'Buyer Example',
'email' => 'buyer@example.com',
'clientId' => 'crm_123',
],
'lineItems' => [
[
'description' => 'Implementation services',
'quantity' => '1',
'unitAmount' => '500',
'taxAmount' => '0',
],
],
]);
$makepay->createBookkeepingInvoicePaymentLink('INVOICE_UID', [
'sendPaymentRequestEmail' => true,
]);
$makepay->listBookkeepingInvoices();
$makepay->getBookkeepingInvoice('INVOICE_UID');
$makepay->updateBookkeepingInvoice('INVOICE_UID', ['status' => 'open']);

Expenses can be created manually or from wallet activity:

$makepay->createBookkeepingExpense([
'title' => 'Hosting',
'amount' => '49',
'currency' => 'USD',
'incurredOn' => '2026-05-15',
'category' => 'Infrastructure',
'counterparty' => ['name' => 'Vendor Example', 'type' => 'vendor'],
]);
$makepay->createBookkeepingExpenseFromActivity([
'walletActivityEventKey' => 'CHAIN_EVENT_KEY',
'category' => 'Settlement',
]);
$makepay->createBookkeepingReconciliation([
'invoiceId' => 'INVOICE_UID',
'paymentSessionId' => 'PAYMENT_SESSION_ID',
'linkType' => 'payment',
]);

Document uploads accept a local path string or CURLFile:

$makepay->uploadBookkeepingDocument([
'file' => __DIR__ . '/receipt.pdf',
'fileName' => 'receipt.pdf',
'contentType' => 'application/pdf',
'documentType' => 'receipt',
'expenseId' => 'EXPENSE_UID',
]);
$makepay->listBookkeepingDocuments();
$makepay->getBookkeepingDocumentDownloadUrl('DOCUMENT_UID');
$makepay->runBookkeepingDocumentOcr('DOCUMENT_UID');
$makepay->getBookkeepingSummary();

Branding And Operational APIs

$makepay->updateBranding([
'brandName' => 'Merchant',
'supportEmail' => 'support@merchant.example',
'brandingBrandColor' => '#111827',
'brandingAccentColor' => '#14b8a6',
'paymentLinkTheme' => 'system',
'paymentLinkDomain' => 'pay.merchant.example',
'emailSendingDomain' => 'mail.merchant.example',
]);
$makepay->getBranding();
$makepay->refreshBrandingDomains('all');
$makepay->getSettings();
$makepay->updateSettings([
'callbackUrl' => 'https://merchant.example/webhooks/makepay',
]);
$makepay->listDestinationAssets();
$makepay->listWebhookRequests(['limit' => 25]);

Webhook Verification

Read the exact raw request body before parsing JSON.

useMakePay\Webhook;
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_MAKEPAY_SIGNATURE'] ?? null;
$event = Webhook::parse($rawBody, $signature, getenv('MAKEPAY_WEBHOOK_SECRET'));
if (($event['event']['type'] ?? '') === 'status_changed') {
// Update your local order status.
}
http_response_code(200);
echo'ok';

Use Webhook::verify() when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linksClient::createAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksWebhook::verify, Webhook::parse, plus client proxy methods

Data And Errors

Payload arrays use the same camelCase field names as the MakePay API and npm SDK. Use strings for decimal money values when precision matters, and ISO date strings for date fields such as issueDate.

API errors throw MakePay\MakePayException with the HTTP status code and decoded response body.

useMakePay\MakePayException;
try {
$makepay->getPaymentLink('PAYMENT_LINK_UID');
} catch (MakePayException$error) {
error_log($error->getMessage());
error_log((string) $error->getStatusCode());
}

About

Official MakePay PHP SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages