Skip to content

Commit 0f816d5

Browse files
noudbarryvdh
authored andcommitted
Fix for issue: No merchantid #11. (take 2) (#13)
* Add header to fix issue #11. * Add header to fix issue #11. * PSR2. * PSR2.
1 parent 3e257c5 commit 0f816d5

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/Message/CompletePurchaseRequest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ public function getTransactionReference()
4949
public function sendData($data)
5050
{
5151
if ($data['trxid']) {
52-
$httpResponse = $this->httpClient->request('POST', $this->endpoint, [], http_build_query($data));
52+
$httpResponse = $this->httpClient->request(
53+
'POST',
54+
$this->endpoint,
55+
[
56+
'Content-Type' => 'application/x-www-form-urlencoded'
57+
],
58+
http_build_query($data)
59+
);
5360
return $this->response = new CompletePurchaseResponse($this, $this->parseXmlResponse($httpResponse));
5461
} else {
5562
$data = array('transaction' => (object) $this->httpRequest->query->all());

src/Message/PurchaseRequest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,14 @@ protected function getItemData()
209209
*/
210210
public function sendData($data)
211211
{
212-
$httpResponse = $this->httpClient->request('POST', $this->endpoint, [], http_build_query($data));
212+
$httpResponse = $this->httpClient->request(
213+
'POST',
214+
$this->endpoint,
215+
[
216+
'Content-Type' => 'application/x-www-form-urlencoded'
217+
],
218+
http_build_query($data)
219+
);
213220

214221
return $this->response = new PurchaseResponse($this, $this->parseXmlResponse($httpResponse));
215222
}

0 commit comments

Comments
 (0)