Skip to content

Commit

Permalink
Merge pull request #40 from ptuchik/feature/upgrade_for_v3
Browse files Browse the repository at this point in the history
Upgrade for v3
  • Loading branch information
barryvdh authored May 25, 2018
2 parents b65e111 + d1e1aed commit b84a701
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/MerchantBusiness.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Omnipay\Braintree;

use DateTime;
use DateTimeZone;
use Omnipay\Common\Helper;
use Symfony\Component\HttpFoundation\ParameterBag;

Expand Down
2 changes: 0 additions & 2 deletions src/MerchantFunding.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Omnipay\Braintree;

use DateTime;
use DateTimeZone;
use Omnipay\Common\Helper;
use Symfony\Component\HttpFoundation\ParameterBag;

Expand Down
2 changes: 1 addition & 1 deletion src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/Message/CreateCustomerRequest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php
namespace Omnipay\Braintree\Message;

use Omnipay\Common\Message\ResponseInterface;

/**
* Authorize Request
*
Expand Down
9 changes: 5 additions & 4 deletions src/Message/FindCustomerRequest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Omnipay\Braintree\Message;

/**
* Find Customer Request
*
* @method CustomerResponse send()
*/
class FindCustomerRequest extends AbstractRequest
Expand All @@ -16,13 +16,14 @@ public function getData()
/**
* Send the request with specified data
*
* @param mixed $data The data to send
* @return CustomerResponse
* @param mixed $data
*
* @return \Omnipay\Braintree\Message\CustomerResponse|\Omnipay\Common\Message\ResponseInterface
*/
public function sendData($data)
{
$response = $this->braintree->customer()->find($this->getCustomerId());

return $this->response = new CustomerResponse($this, $response);
}
}
}
14 changes: 12 additions & 2 deletions src/Message/UpdatePaymentMethodRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/**
* Update PaymentMethod Request
*
* @method Response send()
*/
class UpdatePaymentMethodRequest extends AbstractRequest
Expand All @@ -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);
}
Expand All @@ -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
*
Expand Down

0 comments on commit b84a701

Please sign in to comment.