From 87cfeff0a87c0764a62fc606b33e48e6b653362c Mon Sep 17 00:00:00 2001 From: Ali Sasani Date: Tue, 12 May 2026 23:53:09 +0330 Subject: [PATCH] [fix] Change SnappPay TransactionId to crc32 from uuid --- src/Drivers/SnappPay/SnappPay.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Drivers/SnappPay/SnappPay.php b/src/Drivers/SnappPay/SnappPay.php index 4610d4e..fbb4010 100644 --- a/src/Drivers/SnappPay/SnappPay.php +++ b/src/Drivers/SnappPay/SnappPay.php @@ -86,11 +86,17 @@ public function purchase(): string // convert to format +98 901 XXX XXXX $phone = preg_replace('/^0/', '+98', $phone); + $orderId = $this->invoice->getDetail('order_id'); + if (is_null($orderId)) { + $this->invoice->uuid(crc32($this->invoice->getUuid())); + $orderId = $this->invoice->getUuid(); + } + $data = [ 'amount' => $this->normalizerAmount($this->invoice->getAmount()), 'mobile' => $phone, 'paymentMethodTypeDto' => 'INSTALLMENT', - 'transactionId' => $this->invoice->getTransactionId(), + 'transactionId' => $orderId, 'returnURL' => $this->settings->callbackUrl, ];