laowu 1 nedēļu atpakaļ
vecāks
revīzija
c6c8448067
1 mainītis faili ar 11 papildinājumiem un 6 dzēšanām
  1. 11 6
      app/Services/PayPlus.php

+ 11 - 6
app/Services/PayPlus.php

@@ -171,13 +171,18 @@ class PayPlus
 
     public function queryPayinOrder($platformOrderId, $orderId = '')
     {
-        $payload = [
-            'platform_order_id' => (string) $platformOrderId,
-        ];
-
-        if ($orderId !== '') {
-            $payload['order_id'] = (string) $orderId;
+        if ($platformOrderId) {
+            $payload = [
+                'platform_order_id' => (string) $platformOrderId,
+            ];
+        } else if ($orderId) {
+            $payload = [
+                'order_id' => (string) $orderId,
+            ];
+        } else {
+            throw new Exception('Either platformOrderId or orderId must be provided for querying PayPlus order.');
         }
+        
         Util::WriteLog('PayPlus', 'Query PayPlus order: ' . json_encode($payload));
 
         return $this->postPayinPath(