Skip to content

Commit 5d711e7

Browse files
authored
[PT-1263] Confirm order request change. (#17)
1 parent a1f7379 commit 5d711e7

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

Controller/OrderController.php

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function execute()
5252
throw new \Exception('Mondu: Not found');
5353
}
5454

55-
$monduOrder = $this->_client->getMonduOrder($orderUuid);
5655
$response = $this->_client->confirmOrder($orderUuid);
5756

5857
if (isset($response['state']) && $response['state'] == 'confirmed') {

Core/Http/HttpRequest.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ public function delete(string $url, array $data = [], array $headers = ['Content
112112
/**
113113
* for sending request
114114
*
115-
* @param array $data
116-
* @param boolean $token
115+
* @param string $url
116+
* @param array|null $data
117+
* @param string $method
117118
* @return array $response
119+
* @throws InvalidRequestException
118120
*/
119-
public function send_request(string $url, array $data, string $method)
121+
public function send_request(string $url, ?array $data, string $method)
120122
{
121123
$this->curl = curl_init();
122124

@@ -125,7 +127,7 @@ public function send_request(string $url, array $data, string $method)
125127

126128
if ($method === 'POST') {
127129
curl_setopt($this->curl, CURLOPT_POST, true);
128-
curl_setopt($this->curl, CURLOPT_POSTFIELDS, json_encode($data));
130+
if ($data) curl_setopt($this->curl, CURLOPT_POSTFIELDS, json_encode($data));
129131
}
130132

131133
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);

Core/Http/MonduClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function updateOrderExternalInfo($orderUuid, $data = [])
4646
return $order['order'] ?? null;
4747
}
4848

49-
public function confirmOrder($orderUuid, $data = [])
49+
public function confirmOrder($orderUuid, $data = null)
5050
{
5151
$order = $this->sendRequest('POST', 'orders/' . $orderUuid . '/confirm', $data);
5252
return $order['order'] ?? null;

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "mondu/bnpl-checkout-oxid",
33
"description": "Mondu payment method for the OXID eShop.",
44
"type": "oxideshop-module",
5-
"version": "1.1.2",
5+
"version": "1.1.3",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

metadata.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'en' => 'Module for Mondu payment.',
1111
),
1212
'thumbnail' => 'out/src/images/logo.png',
13-
'version' => '1.1.2',
13+
'version' => '1.1.3',
1414
'author' => 'Mondu GmbH',
1515
'url' => 'https://www.mondu.ai',
1616
'email' => '[email protected]',

0 commit comments

Comments
 (0)