From 19910d28676f60dce1245398862d21d375aabf46 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 Sep 2021 07:35:57 +1000 Subject: [PATCH] Minor fixes for braintree --- app/PaymentDrivers/Braintree/CreditCard.php | 5 +++++ app/Services/Client/Statement.php | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/PaymentDrivers/Braintree/CreditCard.php b/app/PaymentDrivers/Braintree/CreditCard.php index 9696334e612b..1c954e5e8f21 100644 --- a/app/PaymentDrivers/Braintree/CreditCard.php +++ b/app/PaymentDrivers/Braintree/CreditCard.php @@ -151,6 +151,11 @@ class CreditCard ], ]; + if ($this->braintree->company_gateway->getConfigField('merchantAccountId')) { + /** https://developer.paypal.com/braintree/docs/reference/request/transaction/sale/php#full-example */ + $data['merchantAccountId'] = $this->braintree->company_gateway->getConfigField('merchantAccountId'); + } + $response = $this->braintree->gateway->paymentMethod()->create($data); if ($response->success) { diff --git a/app/Services/Client/Statement.php b/app/Services/Client/Statement.php index 98cc4f798a99..6b82f1230271 100644 --- a/app/Services/Client/Statement.php +++ b/app/Services/Client/Statement.php @@ -283,9 +283,6 @@ class Statement $from = $ranges[0]; $to = $ranges[1]; -nlog("from ".$from->format("Y-m-d")); -nlog("to ".$to->format("Y-m-d")); - $client = Client::where('id', $this->client->id)->first(); $amount = Invoice::where('company_id', $this->client->company->id)