Skip to content

Commit

Permalink
Merge pull request #2 from VinsanityShred/feature/line-item-support
Browse files Browse the repository at this point in the history
Line item support
  • Loading branch information
vehikl-galang authored Jul 31, 2023
2 parents f0cd46e + 1473f77 commit 003578f
Show file tree
Hide file tree
Showing 44 changed files with 936 additions and 308 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions .idea/omnipay-braintree.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"psr-4": { "Omnipay\\Braintree\\" : "src/" }
},
"require": {
"php": "^7.1",
"omnipay/common": "^3",
"braintree/braintree_php": "^3.0"
"braintree/braintree_php": "^5.0"
},
"require-dev": {
"omnipay/tests": "^3"
Expand Down
45 changes: 33 additions & 12 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@

namespace Omnipay\Braintree;

use Braintree\Configuration;
use Braintree\Exception\InvalidSignature;
use Braintree\Gateway as BraintreeGateway;
use Braintree\WebhookNotification;
use Omnipay\Common\AbstractGateway;
use Braintree_Gateway;
use Braintree_Configuration;
use Omnipay\Common\Http\ClientInterface;
use Symfony\Component\HttpFoundation\Request as HttpRequest;

/**
* Braintree Gateway
*/
class Gateway extends AbstractGateway
{
/**
* @var \Braintree_Gateway
* @var Gateway
*/
protected $braintree;

/**
* Create a new gateway instance
*
* @param ClientInterface $httpClient A Guzzle client to make API calls with
* @param HttpRequest $httpRequest A Symfony HTTP request object
* @param Braintree_Gateway $braintree The Braintree gateway
* @param ClientInterface $httpClient A Guzzle client to make API calls with
* @param HttpRequest $httpRequest A Symfony HTTP request object
* @param BraintreeGateway $braintree The Braintree gateway
*/
public function __construct(ClientInterface $httpClient = null, HttpRequest $httpRequest = null, Braintree_Gateway $braintree = null)
public function __construct(ClientInterface $httpClient = null, HttpRequest $httpRequest = null, BraintreeGateway $braintree = null)
{
$this->braintree = $braintree ?: Braintree_Configuration::gateway();
$this->braintree = $braintree ?: Configuration::gateway();

parent::__construct($httpClient, $httpRequest);
}
Expand All @@ -50,9 +53,9 @@ public function getDefaultParameters()
{
return array(
'merchantId' => '',
'publicKey' => '',
'publicKey' => '',
'privateKey' => '',
'testMode' => false,
'testMode' => false,
);
}

Expand Down Expand Up @@ -88,6 +91,7 @@ public function setPrivateKey($value)

/**
* @param array $parameters
*
* @return Message\AuthorizeRequest
*/
public function authorize(array $parameters = array())
Expand All @@ -97,6 +101,7 @@ public function authorize(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\PurchaseRequest
*/
public function capture(array $parameters = array())
Expand All @@ -106,6 +111,7 @@ public function capture(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\ClientTokenRequest
*/
public function clientToken(array $parameters = array())
Expand All @@ -115,6 +121,7 @@ public function clientToken(array $parameters = array())

/**
* @param string $id
*
* @return Message\FindCustomerRequest
*/
public function findCustomer($id)
Expand All @@ -124,6 +131,7 @@ public function findCustomer($id)

/**
* @param array $parameters
*
* @return Message\CreateCustomerRequest
*/
public function createCustomer(array $parameters = array())
Expand All @@ -133,6 +141,7 @@ public function createCustomer(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\DeleteCustomerRequest
*/
public function deleteCustomer(array $parameters = array())
Expand All @@ -142,6 +151,7 @@ public function deleteCustomer(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\UpdateCustomerRequest
*/
public function updateCustomer(array $parameters = array())
Expand All @@ -151,6 +161,7 @@ public function updateCustomer(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\PurchaseRequest
*/
public function find(array $parameters = array())
Expand All @@ -160,6 +171,7 @@ public function find(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\CreateMerchantAccountRequest
*/
public function createMerchantAccount(array $parameters = array())
Expand All @@ -169,6 +181,7 @@ public function createMerchantAccount(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\UpdateMerchantAccountRequest
*/
public function updateMerchantAccount(array $parameters = array())
Expand All @@ -178,6 +191,7 @@ public function updateMerchantAccount(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\CreatePaymentMethodRequest
*/
public function createPaymentMethod(array $parameters = array())
Expand All @@ -187,6 +201,7 @@ public function createPaymentMethod(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\DeletePaymentMethodRequest
*/
public function deletePaymentMethod(array $parameters = array())
Expand All @@ -196,6 +211,7 @@ public function deletePaymentMethod(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\UpdatePaymentMethodRequest
*/
public function updatePaymentMethod(array $parameters = array())
Expand All @@ -205,6 +221,7 @@ public function updatePaymentMethod(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\PurchaseRequest
*/
public function purchase(array $parameters = array())
Expand All @@ -214,6 +231,7 @@ public function purchase(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\PurchaseRequest
*/
public function refund(array $parameters = array())
Expand All @@ -223,6 +241,7 @@ public function refund(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\PurchaseRequest
*/
public function releaseFromEscrow(array $parameters = array())
Expand All @@ -232,6 +251,7 @@ public function releaseFromEscrow(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\PurchaseRequest
*/
public function void(array $parameters = array())
Expand Down Expand Up @@ -270,9 +290,9 @@ public function plans()
/**
* @param array $parameters
*
* @return \Braintree_WebhookNotification
* @return WebhookNotification
*
* @throws \Braintree_Exception_InvalidSignature
* @throws InvalidSignature
*/
public function parseNotification(array $parameters = array())
{
Expand All @@ -296,6 +316,7 @@ public function parseNotification(array $parameters = array())

/**
* @param array $parameters
*
* @return Message\FindRequest
*/
public function fetchTransaction(array $parameters = array())
Expand Down
Loading

0 comments on commit 003578f

Please sign in to comment.