Skip to content

Commit

Permalink
Fix for issue: No merchantid #11. (take 2) (#13)
Browse files Browse the repository at this point in the history
* Add header to fix issue #11.

* Add header to fix issue #11.

* PSR2.

* PSR2.
  • Loading branch information
noud authored and barryvdh committed Sep 17, 2018
1 parent 3e257c5 commit 0f816d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/Message/CompletePurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ public function getTransactionReference()
public function sendData($data)
{
if ($data['trxid']) {
$httpResponse = $this->httpClient->request('POST', $this->endpoint, [], http_build_query($data));
$httpResponse = $this->httpClient->request(
'POST',
$this->endpoint,
[
'Content-Type' => 'application/x-www-form-urlencoded'
],
http_build_query($data)
);
return $this->response = new CompletePurchaseResponse($this, $this->parseXmlResponse($httpResponse));
} else {
$data = array('transaction' => (object) $this->httpRequest->query->all());
Expand Down
9 changes: 8 additions & 1 deletion src/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,14 @@ protected function getItemData()
*/
public function sendData($data)
{
$httpResponse = $this->httpClient->request('POST', $this->endpoint, [], http_build_query($data));
$httpResponse = $this->httpClient->request(
'POST',
$this->endpoint,
[
'Content-Type' => 'application/x-www-form-urlencoded'
],
http_build_query($data)
);

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

0 comments on commit 0f816d5

Please sign in to comment.