Repository navigation
Payment Status Check
Check the status of a payment or a registered card.
Check the status of a payment using the transaction ID.
$status = $client->checkStatus()
->transaction('te001234567')
->get();
if ($status->getPaymentStatus() === \Epoint\Enums\PaymentStatus::SUCCESS) {
echo 'Payment successful!';
}Look the payment up by the order_id you sent when creating it. This is the way to check widget (Apple Pay / Google Pay) payments, because /token/widget does not return a transaction ID.
$status = $client->checkStatus()
->orderId('ORDER-001')
->get();
if ($status->isSuccess() && $status->getAmount() === $expectedAmount) {
// Paid - store the real transaction ID
$transactionId = $status->getTransaction();
}Notes:
- Epoint returns the latest payment for that order ID.
- If both
transaction()andorderId()are set, Epoint uses the transaction ID. - When no payment is found, Epoint answers with
status: server_errorandmessage: record not found, soisSuccess()isfalse.
// Get payment status enum
$status->getPaymentStatus(); // PaymentStatus enum
// Get status string
$status->getStatus(); // 'success', 'error', 'new', etc.
// Check status
$status->isSuccess(); // true if successful
// Get transaction details
$status->getTransaction(); // Transaction ID
$status->getAmount(); // Payment amount
$status->getOrderId(); // Your order ID
$status->getMessage(); // Status message
$status->getTraceId(); // Trace ID
// Get full data
$data = $status->toArray();use Epoint\Enums\PaymentStatus;
PaymentStatus::NEW // Payment initiated, not completed
PaymentStatus::SUCCESS // Payment successful
PaymentStatus::ERROR // Payment faileduse Epoint\Enums\PaymentStatus;
$transactionId = 'te001234567'; // From payment response or callback
$status = $client->checkStatus()
->transaction($transactionId)
->get();
switch ($status->getPaymentStatus()) {
case PaymentStatus::SUCCESS:
// Payment successful - update order status
$amount = $status->getAmount();
$orderId = $status->getOrderId();
updateOrderStatus($orderId, 'paid', $amount);
break;
case PaymentStatus::ERROR:
// Payment failed
$message = $status->getMessage();
error_log("Payment {$transactionId} failed: {$message}");
break;
case PaymentStatus::NEW:
// Payment pending
echo 'Payment is still being processed';
break;
}try {
$status = $client->checkStatus()
->transaction($transactionId)
->get();
if ($status->isError()) {
error_log('Status check error: ' . $status->getMessage());
error_log('Trace ID: ' . $status->getTraceId());
}
} catch (\Exception $e) {
error_log('Status check failed: ' . $e->getMessage());
}Check the status of a registered card using the card ID.
use Epoint\Enums\CardStatus;
$status = $client->checkCardStatus()
->cardId('ce001234567')
->get();
if ($status->getCardStatus() === CardStatus::ACTIVE) {
echo 'Card is active!';
}// Get card status enum
$status->getCardStatus(); // CardStatus enum
// Get status string
$status->getStatus(); // 'new', 'active', 'pending', 'rejected', 'expired', 'session_expired'
// Get card details
$status->getCardId(); // Card ID
$status->getCardName(); // Cardholder name
$status->getCardMask(); // Masked card number (e.g., ****1234)
$status->getExpiredDate(); // Card expiry date (e.g., 12/25)
$status->getDescription(); // Card description
// Get full data
$data = $status->toArray();use Epoint\Enums\CardStatus;
CardStatus::NEW // Card registration initiated
CardStatus::ACTIVE // Card is active and ready for payments
CardStatus::PENDING // Card registration is pending
CardStatus::REJECTED // Card registration rejected
CardStatus::EXPIRED // Card has expired
CardStatus::SESSION_EXPIRED // Registration session has expireduse Epoint\Enums\CardStatus;
$cardId = 'ce001234567'; // From card registration callback
$status = $client->checkCardStatus()
->cardId($cardId)
->get();
switch ($status->getCardStatus()) {
case CardStatus::ACTIVE:
// Card is ready for payments
$mask = $status->getCardMask();
$name = $status->getCardName();
$expiry = $status->getExpiredDate();
echo "Card {$mask} ({$name}) is active, expires {$expiry}";
break;
case CardStatus::PENDING:
echo 'Card registration is still pending';
break;
case CardStatus::REJECTED:
echo 'Card registration was rejected';
break;
case CardStatus::EXPIRED:
echo 'Card has expired';
break;
case CardStatus::SESSION_EXPIRED:
echo 'Registration session expired, please try again';
break;
case CardStatus::NEW:
echo 'Card registration initiated but not completed';
break;
}-
Use Callbacks: Don't rely solely on status checks. Implement callback handling for real-time notifications.
-
Store Transaction ID: Always store the transaction ID in your database when creating a payment.
-
Store Card ID: Always store the card ID from card registration callbacks for future status checks.
-
Idempotency: Status checks are safe to call multiple times with the same transaction or card ID.
-
Trace ID: Always log the trace ID when troubleshooting failed status checks.