diff --git a/composer.json b/composer.json index 33c2634..24db36b 100644 --- a/composer.json +++ b/composer.json @@ -31,11 +31,11 @@ "psr-4": { "Omnipay\\Braintree\\" : "src/" } }, "require": { - "omnipay/common": "~2.0", + "omnipay/common": "^3", "braintree/braintree_php": "^2.39|^3.0" }, "require-dev": { - "omnipay/tests": "~2.0" + "omnipay/tests": "^3" }, "extra": { "branch-alias": { diff --git a/src/Gateway.php b/src/Gateway.php index bc45852..1ece244 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -5,7 +5,7 @@ use Omnipay\Common\AbstractGateway; use Braintree_Gateway; use Braintree_Configuration; -use Guzzle\Http\ClientInterface; +use Omnipay\Common\Http\ClientInterface; use Symfony\Component\HttpFoundation\Request as HttpRequest; /** * Braintree Gateway diff --git a/src/MerchantBusiness.php b/src/MerchantBusiness.php index 1165323..7aaf2e6 100644 --- a/src/MerchantBusiness.php +++ b/src/MerchantBusiness.php @@ -2,8 +2,6 @@ namespace Omnipay\Braintree; -use DateTime; -use DateTimeZone; use Omnipay\Common\Helper; use Symfony\Component\HttpFoundation\ParameterBag; diff --git a/src/MerchantFunding.php b/src/MerchantFunding.php index 008b7d2..6cc4eb0 100644 --- a/src/MerchantFunding.php +++ b/src/MerchantFunding.php @@ -2,8 +2,6 @@ namespace Omnipay\Braintree; -use DateTime; -use DateTimeZone; use Omnipay\Common\Helper; use Symfony\Component\HttpFoundation\ParameterBag; diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php index c58724d..35eca0f 100644 --- a/src/Message/AbstractRequest.php +++ b/src/Message/AbstractRequest.php @@ -3,7 +3,7 @@ namespace Omnipay\Braintree\Message; use Braintree_Gateway; -use Guzzle\Http\ClientInterface; +use Omnipay\Common\Http\ClientInterface; use Omnipay\Common\Exception\InvalidRequestException; use Symfony\Component\HttpFoundation\Request as HttpRequest; use Omnipay\Common\Message\AbstractRequest as BaseAbstractRequest; diff --git a/src/Message/CreateCustomerRequest.php b/src/Message/CreateCustomerRequest.php index 16bf780..abacc6c 100644 --- a/src/Message/CreateCustomerRequest.php +++ b/src/Message/CreateCustomerRequest.php @@ -1,8 +1,6 @@ response = new CustomerResponse($this, $response); } -} \ No newline at end of file +} diff --git a/src/Message/UpdatePaymentMethodRequest.php b/src/Message/UpdatePaymentMethodRequest.php index dac33ed..325320a 100644 --- a/src/Message/UpdatePaymentMethodRequest.php +++ b/src/Message/UpdatePaymentMethodRequest.php @@ -6,7 +6,6 @@ /** * Update PaymentMethod Request - * * @method Response send() */ class UpdatePaymentMethodRequest extends AbstractRequest @@ -28,11 +27,12 @@ public function getData() * Send the request with specified data * * @param mixed $data The data to send + * * @return ResponseInterface */ public function sendData($data) { - $response = $this->braintree->paymentMethod()->update($data['token'], $data['options']); + $response = $this->braintree->paymentMethod()->update($data['token'], $data); return $this->createResponse($response); } @@ -47,6 +47,16 @@ public function setPaymentMethodToken($value) return $this->setParameter('token', $value); } + /** + * @param $value + * + * @return \Omnipay\Common\Message\AbstractRequest + */ + public function setMakeDefault($value) + { + return $this->setOptions(['makeDefault' => (bool) $value]); + } + /** * @param array $options *