|
|
@@ -15,6 +15,17 @@ class payUtil
|
|
|
|
|
|
public static function thirdPay($payWay, $capitalType, $orderSn, $totalFee, $attach, $transactionId = '')
|
|
|
{
|
|
|
+
|
|
|
+ //2秒内不允许第三方重复通知
|
|
|
+ $cacheKey = 'third_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ Yii::info("第三方2秒内重复通知:{$capitalType} {$orderSn}");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 2, 'has']);
|
|
|
+
|
|
|
+
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|