diff --git a/samples/php8/ecom-server/KodyServiceMock/MockCancelRequest.php b/samples/php8/ecom-server/KodyServiceMock/MockCancelRequest.php deleted file mode 100644 index 83a6110..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockCancelRequest.php +++ /dev/null @@ -1,31 +0,0 @@ -store_id = $store_id; - } - - public function setAmount($amount) - { - $this->amount = $amount; - } - - public function setTerminalId($terminal_id) - { - $this->terminal_id = $terminal_id; - } - - public function setOrderId($order_id) - { - $this->order_id = $order_id; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockCancelResponse.php b/samples/php8/ecom-server/KodyServiceMock/MockCancelResponse.php deleted file mode 100644 index 2f83e52..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockCancelResponse.php +++ /dev/null @@ -1,18 +0,0 @@ -status = $status; - } - - public function getStatus() - { - return $this->status; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockKodyPayTerminalServiceClient.php b/samples/php8/ecom-server/KodyServiceMock/MockKodyPayTerminalServiceClient.php deleted file mode 100644 index cb67a2d..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockKodyPayTerminalServiceClient.php +++ /dev/null @@ -1,47 +0,0 @@ -setTerminalId('MOCK_TERMINAL_1')->setOnline(true); - $response->setTerminals([$terminal]); - return [$response, null]; - } - - public function Pay($request, $metadata = [], $options = []) - { - // Mock response stream with a generator - return new class { - public function responses() - { - yield (new PayResponse())->setStatus(PaymentStatus::PENDING)->setOrderId('MOCK_ORDER_ID'); - yield (new PayResponse())->setStatus(PaymentStatus::SUCCESS); - } - }; - } - - public function Cancel($request, $metadata = [], $options = []) - { - $response = new CancelResponse(); - $response->setStatus(PaymentStatus::CANCELLED); - return [$response, null]; - } - - public function PaymentDetails($request, $metadata = [], $options = []) - { - $response = new PayResponse(); - $response->setStatus(PaymentStatus::SUCCESS) - ->setOrderId($request->getOrderId()) - ->setDateCreated((new \Google\Protobuf\Timestamp())->setSeconds(time())) - ->setDatePaid((new \Google\Protobuf\Timestamp())->setSeconds(time() + 600)) - ->setFailureReason('') - ->setExtPaymentRef('MOCK_EXT_REF') - ->setReceiptJson(json_encode(['items' => [['name' => 'Mock Item', 'price' => 1000]]])); - return [$response, null]; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockPayRequest.php b/samples/php8/ecom-server/KodyServiceMock/MockPayRequest.php deleted file mode 100644 index b75f96b..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockPayRequest.php +++ /dev/null @@ -1,25 +0,0 @@ -store_id = $store_id; - } - - public function setAmount($amount) - { - $this->amount = $amount; - } - - public function setTerminalId($terminal_id) - { - $this->terminal_id = $terminal_id; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockPayResponse.php b/samples/php8/ecom-server/KodyServiceMock/MockPayResponse.php deleted file mode 100644 index c1980d3..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockPayResponse.php +++ /dev/null @@ -1,61 +0,0 @@ -status = $status; - } - - public function getStatus() - { - return $this->status; - } - - public function setOrderId($order_id) - { - $this->order_id = $order_id; - } - - public function getOrderId() - { - return $this->order_id; - } - - public function setDateCreated(Timestamp $date_created) - { - $this->date_created = $date_created; - } - - public function setDatePaid(Timestamp $date_paid) - { - $this->date_paid = $date_paid; - } - - public function setFailureReason($failure_reason) - { - $this->failure_reason = $failure_reason; - } - - public function setReceiptJson($receipt_json) - { - $this->receipt_json = $receipt_json; - } - - public function setExtPaymentRef($ext_payment_ref) - { - $this->ext_payment_ref = $ext_payment_ref; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockPaymentDetailsRequest.php b/samples/php8/ecom-server/KodyServiceMock/MockPaymentDetailsRequest.php deleted file mode 100644 index aec5d9d..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockPaymentDetailsRequest.php +++ /dev/null @@ -1,19 +0,0 @@ -store_id = $store_id; - } - - public function setOrderId($order_id) - { - $this->order_id = $order_id; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockTerminal.php b/samples/php8/ecom-server/KodyServiceMock/MockTerminal.php deleted file mode 100644 index 0efc042..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockTerminal.php +++ /dev/null @@ -1,29 +0,0 @@ -terminal_id = $terminal_id; - } - - public function setOnline($online) - { - $this->online = $online; - } - - public function getTerminalId() - { - return $this->terminal_id; - } - - public function isOnline() - { - return $this->online; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockTerminalsRequest.php b/samples/php8/ecom-server/KodyServiceMock/MockTerminalsRequest.php deleted file mode 100644 index 87f51d6..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockTerminalsRequest.php +++ /dev/null @@ -1,13 +0,0 @@ -store_id = $store_id; - } -} diff --git a/samples/php8/ecom-server/KodyServiceMock/MockTerminalsResponse.php b/samples/php8/ecom-server/KodyServiceMock/MockTerminalsResponse.php deleted file mode 100644 index 78ffc44..0000000 --- a/samples/php8/ecom-server/KodyServiceMock/MockTerminalsResponse.php +++ /dev/null @@ -1,18 +0,0 @@ -terminals = $terminals; - } - - public function getTerminals() - { - return $this->terminals; - } -} diff --git a/samples/php8/ecom-server/public/checkout.php b/samples/php8/ecom-server/public/checkout.php index 36e3fb3..1565621 100644 --- a/samples/php8/ecom-server/public/checkout.php +++ b/samples/php8/ecom-server/public/checkout.php @@ -68,7 +68,7 @@ function generateRandomOrderId($length = 8) { - + @@ -85,8 +85,8 @@ function generateRandomOrderId($length = 8) {
This page demonstrates how to initiate a payment. The form above collects the necessary information and sends a payment request to the backend.