Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F/omnipay v3 #3

Merged
merged 1 commit into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"psr-4": { "Omnipay\\NMI\\" : "src/" }
},
"require": {
"omnipay/common": "~2.0"
"league/omnipay": "^3.0"
},
"require-dev": {
"omnipay/tests": "~2.0"
"omnipay/tests": "^3.0"
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "3.0.x-dev"
}
}
}
6 changes: 3 additions & 3 deletions src/DirectPostGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function credit(array $parameters = array())

/**
* @param array $parameters
* @return \Omnipay\NMI\Message\CreateCardRequest
* @return \Omnipay\NMI\Message\DirectPostCreateCardRequest
*/
public function createCard(array $parameters = array())
{
Expand All @@ -372,7 +372,7 @@ public function createCard(array $parameters = array())

/**
* @param array $parameters
* @return \Omnipay\NMI\Message\UpdateCardRequest
* @return \Omnipay\NMI\Message\DirectPostUpdateCardRequest
*/
public function updateCard(array $parameters = array())
{
Expand All @@ -381,7 +381,7 @@ public function updateCard(array $parameters = array())

/**
* @param array $parameters
* @return \Omnipay\NMI\Message\DeleteCardRequest
* @return \Omnipay\NMI\Message\DirectPostDeleteCardRequest
*/
public function deleteCard(array $parameters = array())
{
Expand Down
11 changes: 8 additions & 3 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,14 @@ protected function getShippingData()

public function sendData($data)
{
$httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data)->send();
$httpResponse = $this->httpClient->request(
'POST',
$this->getEndpoint(),
['Content-Type' => 'application/x-www-form-urlencoded'],
http_build_query($data)
);

return $this->response = new DirectPostResponse($this, $httpResponse->getBody());
return $this->response = new DirectPostResponse($this, $httpResponse->getBody()->getContents());
}

public function setEndpoint($value)
Expand All @@ -338,7 +343,7 @@ public function setEndpoint($value)

public function getEndpoint()
{
return $this->endpoint;
return $this->getParameter('endpoint') ?: $this->endpoint;
}

public function getPaymentToken()
Expand Down