Repository navigation
API Reference
Complete reference for all SDK methods.
new EpointClient(
string $publicKey,
string $privateKey
)Parameters:
-
publicKey- Your merchant public key (e.g.,i000000001) -
privateKey- Your merchant private key
Example:
$client = new EpointClient(
publicKey: 'i000000001',
privateKey: 'your-private-key'
);Create a standard payment request.
$client->payment()
->amount(float $amount)
->orderId(string $orderId)
->description(string $description = null)
->language(Language $language = Language::EN)
->currency(Currency $currency = Currency::AZN)
->installment(bool $installment = false)
->successUrl(string $url = null)
->errorUrl(string $url = null)
->send()Returns: PaymentResponse
Check payment status by transaction ID.
$client->checkStatus()
->transaction(string $transactionId)
->get()Returns: StatusResponse
Register a card for future payments.
$client->registerCard()
->description(string $description = null)
->successUrl(string $url = null)
->errorUrl(string $url = null)
->send()Returns: PaymentResponse
Charge a saved card.
$client->savedCardPayment()
->cardId(string $cardId)
->amount(float $amount)
->orderId(string $orderId)
->description(string $description = null)
->installment(bool $installment = false)
->execute()Returns: PaymentResponse
Refund a payment.
$client->refund()
->cardId(string $cardId)
->orderId(string $orderId)
->amount(float $amount)
->description(string $description = null)
->send()Returns: RefundResponse
Reverse/cancel a transaction.
$client->reverse()
->transaction(string $transactionId)
->amount(float $amount = null)
->send()Returns: RefundResponse
Split payment between merchants.
$client->splitPayment()
->amount(float $amount)
->orderId(string $orderId)
->splitUser(string $merchantId)
->splitAmount(float $amount)
->description(string $description = null)
->successUrl(string $url = null)
->errorUrl(string $url = null)
->send()Returns: PaymentResponse
Create preauth (hold funds).
// Create preauth
$client->preauth()
->amount(float $amount)
->orderId(string $orderId)
->description(string $description = null)
->successUrl(string $url = null)
->errorUrl(string $url = null)
->send()
// Complete preauth
$client->preauth()
->complete(string $transactionId, float $amount)Returns: PaymentResponse
Create Apple Pay / Google Pay widget.
$client->widget()
->amount(float $amount)
->orderId(string $orderId)
->description(string $description = null)
->create()Returns: WidgetResponse
Wallet operations.
// List wallets
$client->wallet()->list()
// Make wallet payment
$client->wallet()->payment(
string $walletId,
float $amount,
string $orderId
)Invoice management.
// Create invoice
$client->invoice()->create(array $data)
// Send via SMS
$client->invoice()->sendSms(int $invoiceId, string $phone)
// Send via email
$client->invoice()->sendEmail(int $invoiceId, string $email)Verify and decode callback data.
$client->verifyCallback(
string $data,
string $signature
): arrayThrows: SignatureVerificationException if signature is invalid
Example:
$data = $_POST['data'];
$signature = $_POST['signature'];
try {
$callbackData = $client->verifyCallback($data, $signature);
// Process $callbackData
} catch (SignatureVerificationException $e) {
// Invalid signature
}Check API health.
$client->heartbeat(): arrayReturns:
[
'status' => 'ok',
// ... other info
]use Epoint\Enums\Language;
Language::AZ // Azerbaijani
Language::EN // English
Language::RU // Russianuse Epoint\Enums\Currency;
Currency::AZN // Azerbaijani Manatuse Epoint\Enums\PaymentStatus;
PaymentStatus::NEW // Payment initiated
PaymentStatus::SUCCESS // Payment successful
PaymentStatus::ERROR // Payment failedAll responses inherit from BaseResponse:
$response->isSuccess(): bool
$response->isError(): bool
$response->getStatus(): ?string
$response->getMessage(): ?string
$response->getTraceId(): ?string
$response->toArray(): array$response->getRedirectUrl(): ?string
$response->getTransaction(): ?string
$response->getAmount(): ?float
$response->getOrderId(): ?string$response->getPaymentStatus(): PaymentStatus
$response->getTransaction(): ?string
$response->getAmount(): ?float
$response->getOrderId(): ?string$response->getCardId(): ?string
$response->getCardMask(): ?string$response->getWidgetUrl(): ?stringThrown when callback signature verification fails.
use Epoint\Exceptions\SignatureVerificationException;
try {
$client->verifyCallback($data, $signature);
} catch (SignatureVerificationException $e) {
// Handle invalid signature
}