Skip to content

Commit b84a701

Browse files
authored
Merge pull request #40 from ptuchik/feature/upgrade_for_v3
Upgrade for v3
2 parents b65e111 + d1e1aed commit b84a701

8 files changed

+21
-16
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"psr-4": { "Omnipay\\Braintree\\" : "src/" }
3232
},
3333
"require": {
34-
"omnipay/common": "~2.0",
34+
"omnipay/common": "^3",
3535
"braintree/braintree_php": "^2.39|^3.0"
3636
},
3737
"require-dev": {
38-
"omnipay/tests": "~2.0"
38+
"omnipay/tests": "^3"
3939
},
4040
"extra": {
4141
"branch-alias": {

src/Gateway.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Omnipay\Common\AbstractGateway;
66
use Braintree_Gateway;
77
use Braintree_Configuration;
8-
use Guzzle\Http\ClientInterface;
8+
use Omnipay\Common\Http\ClientInterface;
99
use Symfony\Component\HttpFoundation\Request as HttpRequest;
1010
/**
1111
* Braintree Gateway

src/MerchantBusiness.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Omnipay\Braintree;
44

5-
use DateTime;
6-
use DateTimeZone;
75
use Omnipay\Common\Helper;
86
use Symfony\Component\HttpFoundation\ParameterBag;
97

src/MerchantFunding.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Omnipay\Braintree;
44

5-
use DateTime;
6-
use DateTimeZone;
75
use Omnipay\Common\Helper;
86
use Symfony\Component\HttpFoundation\ParameterBag;
97

src/Message/AbstractRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Omnipay\Braintree\Message;
44

55
use Braintree_Gateway;
6-
use Guzzle\Http\ClientInterface;
6+
use Omnipay\Common\Http\ClientInterface;
77
use Omnipay\Common\Exception\InvalidRequestException;
88
use Symfony\Component\HttpFoundation\Request as HttpRequest;
99
use Omnipay\Common\Message\AbstractRequest as BaseAbstractRequest;

src/Message/CreateCustomerRequest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22
namespace Omnipay\Braintree\Message;
33

4-
use Omnipay\Common\Message\ResponseInterface;
5-
64
/**
75
* Authorize Request
86
*

src/Message/FindCustomerRequest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
2+
23
namespace Omnipay\Braintree\Message;
34

45
/**
56
* Find Customer Request
6-
*
77
* @method CustomerResponse send()
88
*/
99
class FindCustomerRequest extends AbstractRequest
@@ -16,13 +16,14 @@ public function getData()
1616
/**
1717
* Send the request with specified data
1818
*
19-
* @param mixed $data The data to send
20-
* @return CustomerResponse
19+
* @param mixed $data
20+
*
21+
* @return \Omnipay\Braintree\Message\CustomerResponse|\Omnipay\Common\Message\ResponseInterface
2122
*/
2223
public function sendData($data)
2324
{
2425
$response = $this->braintree->customer()->find($this->getCustomerId());
2526

2627
return $this->response = new CustomerResponse($this, $response);
2728
}
28-
}
29+
}

src/Message/UpdatePaymentMethodRequest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
/**
88
* Update PaymentMethod Request
9-
*
109
* @method Response send()
1110
*/
1211
class UpdatePaymentMethodRequest extends AbstractRequest
@@ -28,11 +27,12 @@ public function getData()
2827
* Send the request with specified data
2928
*
3029
* @param mixed $data The data to send
30+
*
3131
* @return ResponseInterface
3232
*/
3333
public function sendData($data)
3434
{
35-
$response = $this->braintree->paymentMethod()->update($data['token'], $data['options']);
35+
$response = $this->braintree->paymentMethod()->update($data['token'], $data);
3636

3737
return $this->createResponse($response);
3838
}
@@ -47,6 +47,16 @@ public function setPaymentMethodToken($value)
4747
return $this->setParameter('token', $value);
4848
}
4949

50+
/**
51+
* @param $value
52+
*
53+
* @return \Omnipay\Common\Message\AbstractRequest
54+
*/
55+
public function setMakeDefault($value)
56+
{
57+
return $this->setOptions(['makeDefault' => (bool) $value]);
58+
}
59+
5060
/**
5161
* @param array $options
5262
*

0 commit comments

Comments
 (0)