diff --git a/app/DataProviders/Frequencies.php b/app/DataProviders/Frequencies.php
deleted file mode 100644
index 503d40973dc4..000000000000
--- a/app/DataProviders/Frequencies.php
+++ /dev/null
@@ -1,19 +0,0 @@
- $vendor_contact->vendor->company->settings,
'company' => $vendor_contact->vendor->company,
'sidebar' => $this->sidebarMenu(),
- 'countries' => TranslationHelper::getCountries(),
+ 'countries' => app('countries'),
]);
}
- public function update(VendorContact $vendor_contact)
+ public function update(Request $request, VendorContact $vendor_contact)
{
- $vendor_contact->fill(request()->all());
- $vendor_contact->vendor->fill(request()->all());
+ $vendor_contact->fill($request->all());
+ $vendor_contact->vendor->fill($request->all());
$vendor_contact->push();
return back()->withSuccess(ctrans('texts.profile_updated_successfully'));
@@ -76,16 +76,10 @@ class VendorContactController extends Controller
$enabled_modules = auth()->guard('vendor')->user()->company->enabled_modules;
$data = [];
- // TODO: Enable dashboard once it's completed.
- // $this->settings->enable_client_portal_dashboard
- // $data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity'];
-
if (self::MODULE_PURCHASE_ORDERS & $enabled_modules) {
$data[] = ['title' => ctrans('texts.purchase_orders'), 'url' => 'vendor.purchase_orders.index', 'icon' => 'file-text'];
}
- // $data[] = ['title' => ctrans('texts.documents'), 'url' => 'client.documents.index', 'icon' => 'download'];
-
return $data;
}
}
diff --git a/app/Http/Middleware/ThrottleRequestsWithPredis.php b/app/Http/Middleware/ThrottleRequestsWithPredis.php
index 30388163d103..6d7cad13fb76 100644
--- a/app/Http/Middleware/ThrottleRequestsWithPredis.php
+++ b/app/Http/Middleware/ThrottleRequestsWithPredis.php
@@ -32,19 +32,15 @@ class ThrottleRequestsWithPredis extends \Illuminate\Routing\Middleware\Throttle
/**
* Create a new request throttler.
- *
- * @param \Illuminate\Cache\RateLimiter $limiter
- * @param \Illuminate\Contracts\Redis\Factory $redis
* @return void
*/
+
+ /** @phpstan-ignore-next-line */
public function __construct(RateLimiter $limiter, Redis $redis)
{
parent::__construct($limiter);
-
+ /** @phpstan-ignore-next-line */
$this->redis = \Illuminate\Support\Facades\Redis::connection('sentinel-cache');
-
- // $this->redis = $redis;
-
}
/**
@@ -126,7 +122,6 @@ class ThrottleRequestsWithPredis extends \Illuminate\Routing\Middleware\Throttle
/**
* Get the Redis connection that should be used for throttling.
*
- * @return \Illuminate\Redis\Connections\Connection
*/
protected function getRedisConnection()
{
diff --git a/app/Http/ViewComposers/PortalComposer.php b/app/Http/ViewComposers/PortalComposer.php
index 15c8016a5f89..6b0790a0f4ff 100644
--- a/app/Http/ViewComposers/PortalComposer.php
+++ b/app/Http/ViewComposers/PortalComposer.php
@@ -88,11 +88,11 @@ class PortalComposer
$data['sidebar'] = $this->sidebarMenu();
$data['header'] = [];
$data['footer'] = [];
- $data['countries'] = TranslationHelper::getCountries();
+ $data['countries'] = app('countries');
$data['company'] = auth()->guard('contact')->user()->company;
$data['client'] = auth()->guard('contact')->user()->client;
$data['settings'] = $this->settings;
- $data['currencies'] = TranslationHelper::getCurrencies();
+ $data['currencies'] = app('currencies');
$data['contact'] = auth()->guard('contact')->user();
$data['multiple_contacts'] = session()->get('multiple_contacts') ?: collect();
diff --git a/app/PaymentDrivers/AbstractPaymentDriver.php b/app/PaymentDrivers/AbstractPaymentDriver.php
index 05fdf566e918..acdc9eb9c6b8 100644
--- a/app/PaymentDrivers/AbstractPaymentDriver.php
+++ b/app/PaymentDrivers/AbstractPaymentDriver.php
@@ -20,7 +20,7 @@ abstract class AbstractPaymentDriver
{
abstract public function authorizeView(array $data);
- abstract public function authorizeResponse(Request $request);
+ abstract public function authorizeResponse(\App\Http\Requests\Request | Request $request);
abstract public function processPaymentView(array $data);
diff --git a/app/PaymentDrivers/PayPalExpressPaymentDriver.php b/app/PaymentDrivers/PayPalExpressPaymentDriver.php
deleted file mode 100644
index ea3cdc8c8bf7..000000000000
--- a/app/PaymentDrivers/PayPalExpressPaymentDriver.php
+++ /dev/null
@@ -1,249 +0,0 @@
-omnipay_gateway = Omnipay::create(
- $this->company_gateway->gateway->provider
- );
-
- $this->omnipay_gateway->initialize((array) $this->company_gateway->getConfig());
- }
-
- public function setPaymentMethod($payment_method_id)
- {
- // PayPal doesn't have multiple ways of paying.
- // There's just one, off-site redirect.
-
- return $this;
- }
-
- public function authorizeView($payment_method)
- {
- // PayPal doesn't support direct authorization.
-
- return $this;
- }
-
- public function authorizeResponse($request)
- {
- // PayPal doesn't support direct authorization.
-
- return $this;
- }
-
- public function processPaymentView($data)
- {
- $this->initializeOmnipayGateway();
-
- $this->payment_hash->data = array_merge((array) $this->payment_hash->data, ['amount' => $data['total']['amount_with_fee']]);
- $this->payment_hash->save();
-
- $response = $this->omnipay_gateway
- ->purchase($this->generatePaymentDetails($data))
- ->setItems($this->generatePaymentItems($data))
- ->send();
-
- if ($response->isRedirect()) {
- return $response->redirect();
- }
-
- // $this->sendFailureMail($response->getMessage() ?: '');
-
- $message = [
- 'server_response' => $response->getMessage(),
- 'data' => $this->payment_hash->data,
- ];
-
- SystemLogger::dispatch(
- $message,
- SystemLog::CATEGORY_GATEWAY_RESPONSE,
- SystemLog::EVENT_GATEWAY_FAILURE,
- SystemLog::TYPE_PAYPAL,
- $this->client,
- $this->client->company,
- );
-
- throw new PaymentFailed($response->getMessage(), $response->getCode());
- }
-
- public function processPaymentResponse($request)
- {
- $this->initializeOmnipayGateway();
-
- $response = $this->omnipay_gateway
- ->completePurchase(['amount' => $this->payment_hash->data->amount, 'currency' => $this->client->getCurrencyCode()])
- ->send();
-
- if ($response->isCancelled() && $this->client->getSetting('enable_client_portal')) {
- return redirect()->route('client.invoices.index')->with('warning', ctrans('texts.status_cancelled'));
- } elseif($response->isCancelled() && !$this->client->getSetting('enable_client_portal')) {
- redirect()->route('client.invoices.show', ['invoice' => $this->payment_hash->fee_invoice])->with('warning', ctrans('texts.status_cancelled'));
- }
-
- if ($response->isSuccessful()) {
- $data = [
- 'payment_method' => $response->getData()['TOKEN'],
- 'payment_type' => PaymentType::PAYPAL,
- 'amount' => $this->payment_hash->data->amount,
- 'transaction_reference' => $response->getTransactionReference(),
- 'gateway_type_id' => GatewayType::PAYPAL,
- ];
-
- $payment = $this->createPayment($data, \App\Models\Payment::STATUS_COMPLETED);
-
- SystemLogger::dispatch(
- ['response' => (array) $response->getData(), 'data' => $data],
- SystemLog::CATEGORY_GATEWAY_RESPONSE,
- SystemLog::EVENT_GATEWAY_SUCCESS,
- SystemLog::TYPE_PAYPAL,
- $this->client,
- $this->client->company,
- );
-
- return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]);
- }
-
- if (! $response->isSuccessful()) {
- $data = $response->getData();
-
- $this->sendFailureMail($response->getMessage() ?: '');
-
- $message = [
- 'server_response' => $data['L_LONGMESSAGE0'],
- 'data' => $this->payment_hash->data,
- ];
-
- SystemLogger::dispatch(
- $message,
- SystemLog::CATEGORY_GATEWAY_RESPONSE,
- SystemLog::EVENT_GATEWAY_FAILURE,
- SystemLog::TYPE_PAYPAL,
- $this->client,
- $this->client->company,
- );
-
- throw new PaymentFailed($response->getMessage(), $response->getCode());
- }
- }
-
- public function generatePaymentDetails(array $data)
- {
- $_invoice = collect($this->payment_hash->data->invoices)->first();
- $invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
-
- // $this->fee = $this->feeCalc($invoice, $data['total']['amount_with_fee']);
-
- return [
- 'currency' => $this->client->getCurrencyCode(),
- 'transactionType' => 'Purchase',
- 'clientIp' => request()->getClientIp(),
- // 'amount' => round(($data['total']['amount_with_fee'] + $this->fee),2),
- 'amount' => round($data['total']['amount_with_fee'], 2),
- 'returnUrl' => route('client.payments.response', [
- 'company_gateway_id' => $this->company_gateway->id,
- 'payment_hash' => $this->payment_hash->hash,
- 'payment_method_id' => GatewayType::PAYPAL,
- ]),
- 'cancelUrl' => $this->client->company->domain()."/client/invoices/{$invoice->hashed_id}",
- 'description' => implode(',', collect($this->payment_hash->data->invoices)
- ->map(function ($invoice) {
- return sprintf('%s: %s', ctrans('texts.invoice_number'), $invoice->invoice_number);
- })->toArray()),
- 'transactionId' => $this->payment_hash->hash.'-'.time(),
- 'ButtonSource' => 'InvoiceNinja_SP',
- 'solutionType' => 'Sole',
- 'no_shipping' => $this->company_gateway->require_shipping_address ? 0 : 1,
- ];
- }
-
- public function generatePaymentItems(array $data)
- {
- $_invoice = collect($this->payment_hash->data->invoices)->first();
- $invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
-
- $items = [];
-
- $items[] = new Item([
- 'name' => ' ',
- 'description' => ctrans('texts.invoice_number').'# '.$invoice->number,
- 'price' => $data['total']['amount_with_fee'],
- 'quantity' => 1,
- ]);
-
- return $items;
- }
-
- private function feeCalc($invoice, $invoice_total)
- {
- $invoice->service()->removeUnpaidGatewayFees();
- $invoice = $invoice->fresh();
-
- $balance = floatval($invoice->balance);
-
- $_updated_invoice = $invoice->service()->addGatewayFee($this->company_gateway, GatewayType::PAYPAL, $invoice_total)->save();
-
- if (floatval($_updated_invoice->balance) > $balance) {
- $fee = floatval($_updated_invoice->balance) - $balance;
-
- $this->payment_hash->fee_total = $fee;
- $this->payment_hash->save();
-
- return $fee;
- }
-
- return 0;
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/PaymentMethod.php b/app/PaymentDrivers/Rotessa/PaymentMethod.php
index 9fd4d9f094e5..9ac26feae87d 100755
--- a/app/PaymentDrivers/Rotessa/PaymentMethod.php
+++ b/app/PaymentDrivers/Rotessa/PaymentMethod.php
@@ -12,14 +12,11 @@
namespace App\PaymentDrivers\Rotessa;
-use Carbon\Carbon;
-use App\Models\Client;
use App\Models\Payment;
use App\Models\SystemLog;
use Illuminate\View\View;
use App\Models\GatewayType;
use App\Models\PaymentType;
-use Illuminate\Support\Arr;
use Illuminate\Http\Request;
use App\Jobs\Util\SystemLogger;
use App\Exceptions\PaymentFailed;
@@ -28,16 +25,18 @@ use App\Models\ClientGatewayToken;
use Illuminate\Http\RedirectResponse;
use App\PaymentDrivers\RotessaPaymentDriver;
use App\PaymentDrivers\Common\MethodInterface;
-use App\PaymentDrivers\Rotessa\Resources\Customer;
-use App\PaymentDrivers\Rotessa\Resources\Transaction;
-use Omnipay\Common\Exception\InvalidRequestException;
use Omnipay\Common\Exception\InvalidResponseException;
-use App\Exceptions\Ninja\ClientPortalAuthorizationException;
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
class PaymentMethod implements MethodInterface
{
+ private array $transaction = [
+ "financial_transactions" => [],
+ "frequency" =>'Once',
+ "installments" =>1
+ ];
+
public function __construct(protected RotessaPaymentDriver $rotessa)
{
$this->rotessa->init();
@@ -51,7 +50,7 @@ class PaymentMethod implements MethodInterface
*/
public function authorizeView(array $data): View
{
- $data['contact'] = collect($data['client']->contacts->firstWhere('is_primary', 1)->toArray())->merge([
+ $data['contact'] = collect($data['client']->contacts->first()->toArray())->merge([
'home_phone' => $data['client']->phone,
'custom_identifier' => $data['client']->number,
'name' => $data['client']->name,
@@ -73,42 +72,38 @@ class PaymentMethod implements MethodInterface
* @param Request $request
* @return RedirectResponse
*/
- public function authorizeResponse(Request $request): RedirectResponse
+ public function authorizeResponse($request)
{
- try {
- $request->validate([
- 'gateway_type_id' => ['required','integer'],
- 'country' => ['required'],
- 'name' => ['required'],
- 'address_1' => ['required'],
- // 'address_2' => ['required'],
- 'city' => ['required'],
- 'email' => ['required','email:filter'],
- 'province_code' => ['required','size:2','alpha'],
- 'postal_code' => ['required'],
- 'authorization_type' => ['required'],
- 'account_number' => ['required'],
- 'bank_name' => ['required'],
- 'phone' => ['required'],
- 'home_phone' => ['required','size:10'],
- 'bank_account_type'=>['required_if:country,US'],
- 'routing_number'=>['required_if:country,US'],
- 'institution_number'=>['required_if:country,CA','numeric'],
- 'transit_number'=>['required_if:country,CA','numeric'],
- 'custom_identifier'=>['required_without:customer_id'],
- 'customer_id'=>['required_without:custom_identifier','integer'],
- ]);
- $customer = new Customer( ['address' => $request->only('address_1','address_2','city','postal_code','province_code','country'), 'custom_identifier' => $request->input('custom_identifier') ] + $request->all());
- $this->rotessa->findOrCreateCustomer($customer->resolve());
-
- return redirect()->route('client.payment_methods.index')->withMessage(ctrans('texts.payment_method_added'));
+ $request->validate([
+ 'gateway_type_id' => ['required','integer'],
+ 'country' => ['required','in:US,CA,United States,Canada'],
+ 'name' => ['required'],
+ 'address_1' => ['required'],
+ 'city' => ['required'],
+ 'email' => ['required','email:filter'],
+ 'province_code' => ['required','size:2','alpha'],
+ 'postal_code' => ['required'],
+ 'authorization_type' => ['required'],
+ 'account_number' => ['required'],
+ 'bank_name' => ['required'],
+ 'phone' => ['required'],
+ 'home_phone' => ['required','size:10'],
+ 'bank_account_type'=>['required_if:country,US'],
+ 'routing_number'=>['required_if:country,US'],
+ 'institution_number'=>['required_if:country,CA','numeric','digits:3'],
+ 'transit_number'=>['required_if:country,CA','numeric','digits:5'],
+ 'custom_identifier'=>['required_without:customer_id'],
+ 'customer_id'=>['required_without:custom_identifier','integer'],
+ 'customer_type' => ['required', 'in:Personal,Business'],
+ ]);
- } catch (\Throwable $e) {
- return $this->rotessa->processInternallyFailedPayment($this->rotessa, new ClientPortalAuthorizationException( get_class( $e) . " : {$e->getMessage()}", (int) $e->getCode() ));
- }
+ $customer = array_merge(['address' => $request->only('address_1','address_2','city','postal_code','province_code','country'), 'custom_identifier' => $request->input('custom_identifier') ], $request->all());
+
+ $this->rotessa->findOrCreateCustomer($customer);
+
+ return redirect()->route('client.payment_methods.index')->withMessage(ctrans('texts.payment_method_added'));
- // return back()->withMessage(ctrans('texts.unable_to_verify_payment_method'));
}
/**
@@ -124,7 +119,7 @@ class PaymentMethod implements MethodInterface
$data['due_date'] = date('Y-m-d', min(max(strtotime($data['invoices']->max('due_date')), strtotime('now')), strtotime('+1 day')));
$data['process_date'] = $data['due_date'];
$data['currency'] = $this->rotessa->client->getCurrencyCode();
- $data['frequency'] = Frequencies::getOnePayment();
+ $data['frequency'] = 'Once';
$data['installments'] = 1;
$data['invoice_nums'] = $data['invoices']->pluck('invoice_number')->join(', ');
return render('gateways.rotessa.bank_transfer.pay', $data );
@@ -142,11 +137,7 @@ class PaymentMethod implements MethodInterface
$customer = null;
try {
- $request->validate([
- 'source' => ['required','string','exists:client_gateway_tokens,token'],
- 'amount' => ['required','numeric'],
- 'process_date'=> ['required','date','after_or_equal:today'],
- ]);
+
$customer = ClientGatewayToken::query()
->where('company_gateway_id', $this->rotessa->company_gateway->id)
->where('client_id', $this->rotessa->client->id)
@@ -156,16 +147,20 @@ class PaymentMethod implements MethodInterface
if(!$customer) throw new \Exception('Client gateway token not found!', SystemLog::TYPE_ROTESSA);
- $transaction = new Transaction($request->only('frequency' ,'installments','amount','process_date') + ['comment' => $this->rotessa->getDescription(false) ]);
- $transaction->additional(['customer_id' => $customer->gateway_customer_reference]);
- $transaction = array_filter( $transaction->resolve());
+ $transaction = array_merge($this->transaction,[
+ 'amount' => $request->input('amount'),
+ 'process_date' => now()->addSeconds($customer->client->utc_offset())->format('Y-m-d'),
+ 'comment' => $this->rotessa->getDescription(false),
+ 'customer_id' => $customer->gateway_customer_reference,
+ ]);
+
$response = $this->rotessa->gatewayRequest('post','transaction_schedules', $transaction);
-
+
if($response->failed())
$response->throw();
$response = $response->json();
- nlog($response);
+
return $this->processPendingPayment($response['id'], (float) $response['amount'], PaymentType::ACSS , $customer->token);
} catch(\Throwable $e) {
$this->processUnsuccessfulPayment( new InvalidResponseException($e->getMessage(), (int) $e->getCode()) );
diff --git a/app/PaymentDrivers/Rotessa/Resources/Customer.php b/app/PaymentDrivers/Rotessa/Resources/Customer.php
deleted file mode 100644
index c2514dfdd8c1..000000000000
--- a/app/PaymentDrivers/Rotessa/Resources/Customer.php
+++ /dev/null
@@ -1,22 +0,0 @@
-resource->jsonSerialize();
- }
-
- function toArray(Request $request) : array {
- return $this->additional + parent::toArray($request);
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/Resources/Transaction.php b/app/PaymentDrivers/Rotessa/Resources/Transaction.php
deleted file mode 100644
index 84ce332860f8..000000000000
--- a/app/PaymentDrivers/Rotessa/Resources/Transaction.php
+++ /dev/null
@@ -1,23 +0,0 @@
-resource->jsonSerialize();
- }
-
- function toArray(Request $request) : array {
- return $this->additional + parent::toArray($request);
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/AbstractClient.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/AbstractClient.php
deleted file mode 100644
index c84a97322717..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/AbstractClient.php
+++ /dev/null
@@ -1,21 +0,0 @@
-default_parameters;
- }
-
- public function setDefaultParameters(array $params) {
- $this->default_parameters = $params;
- }
-
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/ApiTrait.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/ApiTrait.php
deleted file mode 100644
index 5fc947713f3a..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/ApiTrait.php
+++ /dev/null
@@ -1,41 +0,0 @@
-createRequest('GetCustomers', [] );
- }
- public function postCustomers(array $params) : RequestInterface {
- return $this->createRequest('PostCustomers', $params );
- }
- public function getCustomersId(array $params) : RequestInterface {
- return $this->createRequest('GetCustomersId', $params );
- }
- public function patchCustomersId(array $params) : RequestInterface {
- return $this->createRequest('PatchCustomersId', $params );
- }
- public function postCustomersShowWithCustomIdentifier(array $params) : RequestInterface {
- return $this->createRequest('PostCustomersShowWithCustomIdentifier', $params );
- }
- public function getTransactionSchedulesId(array $params) : RequestInterface {
- return $this->createRequest('GetTransactionSchedulesId', $params );
- }
- public function deleteTransactionSchedulesId(array $params) : RequestInterface {
- return $this->createRequest('DeleteTransactionSchedulesId', $params );
- }
- public function patchTransactionSchedulesId(array $params) : RequestInterface {
- return $this->createRequest('PatchTransactionSchedulesId', $params );
- }
- public function postTransactionSchedules(array $params) : RequestInterface {
- return $this->createRequest('PostTransactionSchedules', $params );
- }
- public function postTransactionSchedulesCreateWithCustomIdentifier(array $params) : RequestInterface {
- return $this->createRequest('PostTransactionSchedulesCreateWithCustomIdentifier', $params );
- }
- public function postTransactionSchedulesUpdateViaPost(array $params) : RequestInterface {
- return $this->createRequest('PostTransactionSchedulesUpdateViaPost', $params );
- }
- }
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/ClientInterface.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/ClientInterface.php
deleted file mode 100644
index 4d08fb0441f2..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/ClientInterface.php
+++ /dev/null
@@ -1,11 +0,0 @@
- 1234567890 ];
-
- protected $test_mode = true;
-
- protected $api_key;
-
- public function getName()
- {
- return 'Rotessa';
- }
-
- public function getDefaultParameters() : array
- {
- return array_merge($this->default_parameters, array('api_key' => $this->api_key, 'test_mode' => $this->test_mode ) );
- }
-
- public function setTestMode($value) {
- $this->test_mode = $value;
- }
-
- public function getTestMode() {
- return $this->test_mode;
- }
-
- protected function createRequest($class_name, ?array $parameters = [] ) :RequestInterface {
- $class = null;
- $class_name = "Omnipay\\Rotessa\\Message\\Request\\$class_name";
- $parameters = $class_name::hasModel() ? (($parameters = ($class_name::getModel($parameters)))->validate() ? $parameters->jsonSerialize() : null ) : $parameters;
- try {
- $class = new $class_name($this->httpClient, $this->httpRequest, $this->getDefaultParameters() + $parameters );
- } catch (\Throwable $th) {
- throw $th;
- }
-
- return $class;
- }
-
- function setApiKey($value) {
- $this->api_key = $value;
- }
-
- function getApiKey() {
- return $this->api_key;
- }
-
- function authorize(array $options = []) : RequestInterface {
- return $this->postCustomers($options);
- }
-
- function capture(array $options = []) : RequestInterface {
- return array_key_exists('customer_id', $options)? $this->postTransactionSchedules($options) : $this->postTransactionSchedulesCreateWithCustomIdentifier($options) ;
- }
-
- function updateCustomer(array $options) : RequestInterface {
- return $this->patchCustomersId($options);
- }
-
- function fetchTransaction($id = null) : RequestInterface {
- return $this->getTransactionSchedulesId(compact('id'));
- }
-
-}
\ No newline at end of file
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Http/Client.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Http/Client.php
deleted file mode 100644
index 1e0abbe8aba0..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Http/Client.php
+++ /dev/null
@@ -1,82 +0,0 @@
-httpClient = $httpClient ?: HttpClientDiscovery::find();
- $this->requestFactory = $requestFactory ?: MessageFactoryDiscovery::find();
- parent::__construct($httpClient, $requestFactory);
- }
-
- /**
- * @param $method
- * @param $uri
- * @param array $headers
- * @param string|array|resource|StreamInterface|null $body
- * @param string $protocolVersion
- * @return ResponseInterface
- * @throws \Http\Client\Exception
- */
- public function request(
- $method,
- $uri,
- array $headers = [],
- $body = null,
- $protocolVersion = '1.1'
- ) {
- return $this->sendRequest($method, $uri, $headers, $body, $protocolVersion);
-
- }
-
- /**
- * @param RequestInterface $request
- * @return ResponseInterface
- * @throws \Http\Client\Exception
- */
- private function sendRequest( $method,
- $uri,
- array $headers = [],
- $body = null,
- $protocolVersion = '1.1')
- {
-
- $response = null;
-
- try {
- if( method_exists($this->httpClient, 'sendRequest'))
- $response = $this->httpClient->sendRequest( $this->requestFactory->createRequest($method, $uri, $headers, $body, $protocolVersion));
- else $response = $this->httpClient->request($method, $uri, compact('body','headers'));
- } catch (\Http\Client\Exception\NetworkException $networkException) {
- throw new \Exception($networkException->getMessage());
- } catch (\Exception $exception) {
- throw new \Exception($exception->getMessage());
- }
-
- return $response;
- }
-}
\ No newline at end of file
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Http/Response/Response.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Http/Response/Response.php
deleted file mode 100644
index 8d665ac8546e..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Http/Response/Response.php
+++ /dev/null
@@ -1,32 +0,0 @@
-content, true) )) {
- $data = $data['errors'][0];
- $this->reason_phrase = $data['error_message'] ;
- $this->reason_code = $data['error_message'] ;
- }
- }
-
- public function getReasonPhrase() {
- return $this->reason_phrase;
- }
-
- public function getReasonCode() {
- return $this->reason_code;
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/IsValidTypeTrait.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/IsValidTypeTrait.php
deleted file mode 100644
index 266ba3036d9d..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/IsValidTypeTrait.php
+++ /dev/null
@@ -1,12 +0,0 @@
-api_key = $value;
- }
-
- public function getData() {
- try {
- if(empty($this->api_key)) throw new \Exception('No Api Key Found!');
- $this->validate( ...array_keys($data = $this->getParameters()));
- } catch (\Throwable $th) {
- throw new \Omnipay\Rotessa\Exception\ValidationException($th->getMessage() , 600, $th);
- }
-
- return (array) $data;
- }
-
- abstract public function sendData($data) : ResponseInterface;
-
- abstract protected function sendRequest(string $method, string $endpoint, array $headers = [], array $data = [] );
-
- abstract protected function createResponse(array $data) : ResponseInterface;
-
- abstract public function getEndpointUrl(): string;
-
- public function getEndpoint() : string {
- return $this->endpoint;
- }
-
- public function getTestMode() {
- return $this->test_mode;
- }
-
- public function setTestMode($mode) {
- $this->test_mode = $mode;
- }
- }
\ No newline at end of file
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/BaseRequest.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/BaseRequest.php
deleted file mode 100644
index 4b68cf0aa2ff..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/BaseRequest.php
+++ /dev/null
@@ -1,93 +0,0 @@
-initialize($model);
- }
-
- protected function sendRequest(string $method, string $endpoint, array $headers = [], array $data = [])
- {
- /**
- * @param $method
- * @param $uri
- * @param array $headers
- * @param string|resource|StreamInterface|null $body
- * @param string $protocolVersion
- * @return ResponseInterface
- * @throws \Http\Client\Exception
- */
- $response = $this->httpClient->request($method, $endpoint, $headers, json_encode($data) ) ;
- $this->response = new Response ($response->getBody()->getContents(), $response->getStatusCode(), $response->getHeaders(), true);
- }
-
-
- protected function createResponse(array $data): ResponseInterface {
-
- return new BaseResponse($this, $data, $this->response->getStatusCode(), $this->response->getReasonPhrase());
- }
-
- protected function replacePlaceholder($string, $array) {
- $pattern = "/\{([^}]+)\}/";
- $replacement = function($matches) use($array) {
- $key = $matches[1];
- if (array_key_exists($key, $array)) {
- return $array[$key];
- } else {
- return $matches[0];
- }
- };
-
- return preg_replace_callback($pattern, $replacement, $string);
- }
-
- public function sendData($data) :ResponseInterface {
- $headers = [
- 'Content-Type' => 'application/json',
- 'Accept' => 'application/json',
- 'Authorization' => "Token token={$this->api_key}"
- ];
-
- $this->sendRequest(
- $this->method,
- $this->getEndpointUrl(),
- $headers,
- $data);
-
- return $this->createResponse(json_decode($this->response->getContent(), true));
- }
-
- public function getEndpoint() : string {
- return $this->replacePlaceholder($this->endpoint, $this->getParameters());
- }
-
- public function getEndpointUrl() : string {
- return sprintf('https://%s.%s/v%d%s',$this->test_mode ? self::ENVIRONMENT_SANDBOX : self::ENVIRONMENT_LIVE ,$this->base_url, $this->api_version, $this->getEndpoint());
- }
-
- public static function hasModel() : bool {
- return (bool) static::$model;
- }
-
- public static function getModel($parameters = []) {
- $class_name = static::$model;
- $class_name = "Omnipay\\Rotessa\\Model\\{$class_name}Model";
- return new $class_name($parameters);
- }
-}
\ No newline at end of file
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/DeleteTransactionSchedulesId.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/DeleteTransactionSchedulesId.php
deleted file mode 100644
index 7c03c42b0dc6..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/DeleteTransactionSchedulesId.php
+++ /dev/null
@@ -1,18 +0,0 @@
-setParameter('id',$value);
- }
-
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/GetCustomers.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/GetCustomers.php
deleted file mode 100644
index 17ffde5355d9..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/GetCustomers.php
+++ /dev/null
@@ -1,14 +0,0 @@
-setParameter('id',$value);
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/GetTransactionSchedulesId.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/GetTransactionSchedulesId.php
deleted file mode 100644
index 47578d06eb8b..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/GetTransactionSchedulesId.php
+++ /dev/null
@@ -1,17 +0,0 @@
-setParameter('id',$value);
- }
- }
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PatchCustomersId.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PatchCustomersId.php
deleted file mode 100644
index 092e378b9fd5..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PatchCustomersId.php
+++ /dev/null
@@ -1,65 +0,0 @@
-setParameter('id',$value);
- }
- public function setCustomIdentifier(string $value) {
- $this->setParameter('custom_identifier',$value);
- }
- public function setName(string $value) {
- $this->setParameter('name',$value);
- }
- public function setEmail(string $value) {
- $this->setParameter('email',$value);
- }
- public function setCustomerType(string $value) {
- $this->setParameter('customer_type',$value);
- }
- public function setHomePhone(string $value) {
- $this->setParameter('home_phone',$value);
- }
- public function setPhone(string $value) {
- $this->setParameter('phone',$value);
- }
- public function setBankName(string $value) {
- $this->setParameter('bank_name',$value);
- }
- public function setInstitutionNumber(string $value) {
- $this->setParameter('institution_number',$value);
- }
- public function setTransitNumber(string $value) {
- $this->setParameter('transit_number',$value);
- }
- public function setBankAccountType(string $value) {
- $this->setParameter('bank_account_type',$value);
- }
- public function setAuthorizationType(string $value) {
- $this->setParameter('authorization_type',$value);
- }
- public function setRoutingNumber(string $value) {
- $this->setParameter('routing_number',$value);
- }
- public function setAccountNumber(string $value) {
- $this->setParameter('account_number',$value);
- }
- public function setAddress(array $value) {
- $this->setParameter('address',$value);
- }
- public function setTransactionSchedules(array $value) {
- $this->setParameter('transaction_schedules',$value);
- }
- public function setFinancialTransactions(array $value) {
- $this->setParameter('financial_transactions',$value);
- }
- }
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PatchTransactionSchedulesId.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PatchTransactionSchedulesId.php
deleted file mode 100644
index 9eac3cfabc2d..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PatchTransactionSchedulesId.php
+++ /dev/null
@@ -1,22 +0,0 @@
-setParameter('id',$value);
- }
- public function setAmount($value) {
- $this->setParameter('amount',$value);
- }
- public function setComment(string $value) {
- $this->setParameter('comment',$value);
- }
- }
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostCustomers.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostCustomers.php
deleted file mode 100644
index a0c54fe65ca9..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostCustomers.php
+++ /dev/null
@@ -1,60 +0,0 @@
-setParameter('id',$value);
- }
- public function setCustomIdentifier(string $value) {
- $this->setParameter('custom_identifier',$value);
- }
- public function setName(string $value) {
- $this->setParameter('name',$value);
- }
- public function setEmail(string $value) {
- $this->setParameter('email',$value);
- }
- public function setCustomerType(string $value) {
- $this->setParameter('customer_type',$value);
- }
- public function setHomePhone(string $value) {
- $this->setParameter('home_phone',$value);
- }
- public function setPhone(string $value) {
- $this->setParameter('phone',$value);
- }
- public function setBankName(string $value) {
- $this->setParameter('bank_name',$value);
- }
- public function setInstitutionNumber(string $value = '') {
- $this->setParameter('institution_number',$value);
- }
- public function setTransitNumber(string $value = '') {
- $this->setParameter('transit_number',$value);
- }
- public function setBankAccountType(string $value) {
- $this->setParameter('bank_account_type',$value);
- }
- public function setAuthorizationType(string $value = '') {
- $this->setParameter('authorization_type',$value);
- }
- public function setRoutingNumber(string $value = '') {
- $this->setParameter('routing_number',$value);
- }
- public function setAccountNumber(string $value) {
- $this->setParameter('account_number',$value);
- }
- public function setAddress(array $value) {
- $this->setParameter('address',$value);
- }
- }
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostCustomersShowWithCustomIdentifier.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostCustomersShowWithCustomIdentifier.php
deleted file mode 100644
index d590cb618526..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostCustomersShowWithCustomIdentifier.php
+++ /dev/null
@@ -1,19 +0,0 @@
-setParameter('custom_identifier',$value);
- }
-
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedules.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedules.php
deleted file mode 100644
index 80e28a7f5083..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedules.php
+++ /dev/null
@@ -1,31 +0,0 @@
-setParameter('customer_id',$value);
- }
- public function setProcessDate(string $value) {
- $this->setParameter('process_date',$value);
- }
- public function setFrequency(string $value) {
- $this->setParameter('frequency',$value);
- }
- public function setInstallments(int $value) {
- $this->setParameter('installments',$value);
- }
- public function setComment(string $value) {
- $this->setParameter('comment',$value);
- }
- }
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedulesCreateWithCustomIdentifier.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedulesCreateWithCustomIdentifier.php
deleted file mode 100644
index fd5111dc9a74..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedulesCreateWithCustomIdentifier.php
+++ /dev/null
@@ -1,16 +0,0 @@
-setParameter('custom_identifier',$value);
- }
-
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedulesUpdateViaPost.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedulesUpdateViaPost.php
deleted file mode 100644
index afd4596bc9b6..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/PostTransactionSchedulesUpdateViaPost.php
+++ /dev/null
@@ -1,24 +0,0 @@
-setParameter('id',$value);
- }
- public function setAmount($value) {
- $this->setParameter('amount',$value);
- }
- public function setComment(string $value) {
- $this->setParameter('comment',$value);
- }
- }
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/RequestInterface.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/RequestInterface.php
deleted file mode 100644
index cfbcf0095b24..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Request/RequestInterface.php
+++ /dev/null
@@ -1,10 +0,0 @@
-code = $code;
- $this->message = $message;
- }
-
- public function getData() {
- return $this->getParameters();
- }
-
- public function getCode() {
- return (int) $this->code;
- }
-
- public function isSuccessful() {
- return $this->code < 300;
- }
-
- public function getMessage() {
- return $this->message;
- }
-
- protected function getParameters() {
- return $this->data;
- }
-
- public function getParameter(string $key) {
- return $this->getParameters()[$key];
- }
-}
\ No newline at end of file
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Response/ResponseInterface.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Response/ResponseInterface.php
deleted file mode 100644
index 080eaab504b1..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Message/Response/ResponseInterface.php
+++ /dev/null
@@ -1,9 +0,0 @@
-required), array_filter($this->getParameters()) );
- if(!empty($required)) throw new ValidationException("Could not validate " . implode(",", array_keys($required)) );
-
- return true;
- }
-
- public function __get($key) {
- return array_key_exists($key, $this->attributes) ? $this->getParameter($key) : null;
- }
-
- public function __set($key, $value) {
- if(array_key_exists($key, $this->attributes)) $this->setParameter($key, $value);
- }
-
- public function __toString() : string {
- return json_encode($this);
- }
-
- public function toString() : string {
- return $this->__toString();
- }
-
- public function __toArray() : array {
- return $this->getParameters();
- }
-
-
- public function toArray() : array {
- return $this->__toArray();
- }
-
- public function initialize(array $params = []) {
- $this->parameters = new ParameterBag;
- $parameters = array_merge($this->defaults, $params);
- if ($parameters) {
- foreach ($this->attributes as $param => $type) {
- $value = @$parameters[$param];
- if($value){
- settype($value, $type);
- $this->setParameter($param, $value);
- }
- }
- }
-
- return $this;
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/BaseModel.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/BaseModel.php
deleted file mode 100644
index 8064662068c4..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/BaseModel.php
+++ /dev/null
@@ -1,24 +0,0 @@
- "string"
- ];
- protected $required = ['id'];
- protected $defaults = ['id' => 0 ];
-
- public function __construct($parameters = array()) {
- $this->initialize($parameters);
- }
-
- public function jsonSerialize() : array {
- return array_intersect_key($this->toArray(), array_flip($this->required) );
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/CustomerModel.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/CustomerModel.php
deleted file mode 100644
index 0fd67aea9441..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/CustomerModel.php
+++ /dev/null
@@ -1,94 +0,0 @@
- "string",
- "custom_identifier" => "string",
- "name" => "string",
- "email" => "string",
- "customer_type" => "string",
- "home_phone" => "string",
- "phone" => "string",
- "bank_name" => "string",
- "institution_number" => "string",
- "transit_number" => "string",
- "bank_account_type" => "string",
- "authorization_type" => "string",
- "routing_number" => "string",
- "account_number" => "string",
- "address" => "object",
- "transaction_schedules" => "array",
- "financial_transactions" => "array",
- "active" => "bool"
- ];
-
- protected $defaults = ["active" => false,"customer_type" =>'Business',"bank_account_type" =>'Savings',"authorization_type" =>'Online',];
- protected $required = ["name","email","customer_type","home_phone","phone","bank_name","institution_number","transit_number","bank_account_type","authorization_type","routing_number","account_number","address",'custom_identifier'];
-
- public function validate() : bool {
- try {
- $country = $this->address->country;
- if(!self::isValidCountry($country)) throw new \Exception("Invalid country!");
-
- $this->required = array_diff($this->required, Country::isAmerican($country) ? ["institution_number", "transit_number"] : ["bank_account_type", "routing_number"]);
- parent::validate();
- if(Country::isCanadian($country) ) {
- if(!self::isValidTransitNumber($this->getParameter('transit_number'))) throw new \Exception("Invalid transit number!");
- if(!self::isValidInstitutionNumber($this->getParameter('institution_number'))) throw new \Exception("Invalid institution number!");
- }
- if(!self::isValidCustomerType($this->getParameter('customer_type'))) throw new \Exception("Invalid customer type!");
- if(!self::isValidBankAccountType($this->getParameter('bank_account_type'))) throw new \Exception("Invalid bank account type!");
- if(!self::isValidAuthorizationType($this->getParameter('authorization_type'))) throw new \Exception("Invalid authorization type!");
- } catch (\Throwable $th) {
- throw new ValidationException($th->getMessage());
- }
-
- return true;
- }
-
- public static function isValidCountry(string $country ) : bool {
- return Country::isValidCountryCode($country) || Country::isValidCountryName($country);
- }
-
- public static function isValidTransitNumber(string $value ) : bool {
- return strlen($value) == 5;
- }
-
- public static function isValidInstitutionNumber(string $value ) : bool {
- return strlen($value) == 3;
- }
-
- public static function isValidCustomerType(string $value ) : bool {
- return CustomerType::isValid($value);
- }
-
- public static function isValidBankAccountType(string $value ) : bool {
- return BankAccountType::isValid($value);
- }
-
- public static function isValidAuthorizationType(string $value ) : bool {
- return AuthorizationType::isValid($value);
- }
-
- public function toArray() : array {
- return [ 'address' => (array) $this->getParameter('address') ] + parent::toArray();
- }
-
- public function jsonSerialize() : array {
- $address = (array) $this->getParameter('address');
- unset($address['country']);
-
- return compact('address') + parent::jsonSerialize();
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/CustomerPatchModel.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/CustomerPatchModel.php
deleted file mode 100644
index c2e51d50b135..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/CustomerPatchModel.php
+++ /dev/null
@@ -1,16 +0,0 @@
- "string",
- "amount" => "float",
- "comment" => "string",
- "created_at" => "date",
- "financial_transactions" => "array",
- "frequency" => "string",
- "installments" => "integer",
- "next_process_date" => "date",
- "process_date" => "date",
- "updated_at" => "date",
- "customer_id" => "string",
- "custom_identifier" => "string",
- ];
-
- public const DATE_FORMAT = 'F j, Y';
-
- protected $defaults = ["amount" =>0.00,"comment" =>' ',"financial_transactions" =>0,"frequency" =>'Once',"installments" =>1];
-
- protected $required = ["amount","comment","frequency","installments","process_date"];
-
- public function validate() : bool {
- try {
- parent::validate();
- if(!self::isValidDate($this->process_date)) throw new \Exception("Could not validate date ");
- if(!self::isValidFrequency($this->frequency)) throw new \Exception("Invalid frequency");
- if(is_null($this->customer_id) && is_null($this->custom_identifier)) throw new \Exception("customer id or custom identifier is invalid");
- } catch (\Throwable $th) {
- throw new ValidationException($th->getMessage());
- }
-
- return true;
- }
-
- public function jsonSerialize() : array {
- return ['customer_id' => $this->getParameter('customer_id'), 'custom_identifier' => $this->getParameter('custom_identifier') ] + parent::jsonSerialize() ;
- }
-
- public function __toArray() : array {
- return parent::__toArray() ;
- }
-
- public function initialize(array $params = [] ) {
- $o_params = array_intersect_key(
- $params = array_intersect_key($params, $this->attributes),
- ($attr = array_filter($this->attributes, fn($p) => $p != "date"))
- );
- parent::initialize($o_params);
- $d_params = array_diff_key($params, $attr);
- array_walk($d_params, function($v,$k) {
- $this->setParameter($k, self::formatDate( $v) );
- }, );
-
- return $this;
- }
-
- public static function isValidDate($date) : bool {
- $d = DateTime::createFromFormat(self::DATE_FORMAT, $date);
- // Check if the date is valid and matches the format
- return $d && $d->format(self::DATE_FORMAT) === $date;
- }
-
- public static function isValidFrequency($value) : bool {
- return Frequency::isValid($value);
- }
-
- protected static function formatDate($date) : string {
- $d = new DateTime($date);
- return $d->format(self::DATE_FORMAT);
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/TransactionSchedulesIdBodyModel.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/TransactionSchedulesIdBodyModel.php
deleted file mode 100644
index 119ac03999cb..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/TransactionSchedulesIdBodyModel.php
+++ /dev/null
@@ -1,23 +0,0 @@
- "int",
- "comment" => "string",
- ];
-
- public const DATE_FORMAT = 'Y-m-d H:i:s';
-
- private $_is_error = false;
-
- protected $defaults = ["amount" =>0,"comment" =>'0',];
-
- protected $required = ["amount","comment",];
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/TransactionSchedulesUpdateViaPostBodyModel.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/TransactionSchedulesUpdateViaPostBodyModel.php
deleted file mode 100644
index 749ae2f6b967..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Model/TransactionSchedulesUpdateViaPostBodyModel.php
+++ /dev/null
@@ -1,24 +0,0 @@
- "int",
- "amount" => "int",
- "comment" => "string",
- ];
-
- public const DATE_FORMAT = 'Y-m-d H:i:s';
-
- private $_is_error = false;
-
- protected $defaults = ["amount" =>0,"comment" =>'0',];
-
- protected $required = ["amount","comment",];
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Object/Address.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Object/Address.php
deleted file mode 100644
index 1c5952b112ef..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Object/Address.php
+++ /dev/null
@@ -1,53 +0,0 @@
- "string",
- "address_2" => "string",
- "city" => "string",
- "id" => "int",
- "postal_code" => "string",
- "province_code" => "string",
- "country" => "string"
- ];
-
- protected $required = ["address_1","address_2","city","postal_code","province_code",];
-
- public function jsonSerialize() {
- return array_intersect_key($this->getParameters(), array_flip($this->required));
- }
-
- public function getCountry() : string {
- return $this->getParameter('country');
- }
-
- public function initialize(array $parameters) {
- foreach($this->attributes as $param => $type) {
- $value = @$parameters[$param] ;
- settype($value, $type);
- $value = $value ?? null;
- $this->parameters->set($param, $value);
- }
- }
-
- public function __toArray() : array {
- return $this->getParameters();
- }
-
- public function __toString() : string {
- return $this->getFullAddress();
- }
-
- public function getFullAddress() :string {
- $full_address = $this->getParameters();
- extract($full_address);
-
- return "$address_1 $address_2, $city, $postal_code $province_code, $country";
- }
-}
diff --git a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Object/AuthorizationType.php b/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Object/AuthorizationType.php
deleted file mode 100644
index 39dcebfa342f..000000000000
--- a/app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/Object/AuthorizationType.php
+++ /dev/null
@@ -1,28 +0,0 @@
- BankTransfer::class,
- //GatewayType::BACS => Bacs::class,
GatewayType::ACSS => Acss::class,
- // GatewayType::DIRECT_DEBIT => DirectDebit::class
];
public function init(): self
@@ -115,14 +104,15 @@ class RotessaPaymentDriver extends BaseDriver
public function importCustomers() {
try {
- $result = $this->gatewayRequest('get','customers',[]);
+ $result = $this->gatewayRequest('get','customers',[]); //Rotessa customers
if($result->failed())
$result->throw();
- $customers = collect($result->json())->unique('email');
+ $customers = collect($result->json())->unique('email'); //Rotessa customer emails
$client_emails = $customers->pluck('email')->all();
+
$company_id = $this->company_gateway->company->id;
// get existing customers
$client_contacts = ClientContact::where('company_id', $company_id)
@@ -138,9 +128,9 @@ class RotessaPaymentDriver extends BaseDriver
} );
// create payment methods
- $client_contacts->each(
+ collect($client_contacts)->each(
function($contact) {
- // $result = $this->gateway->getCustomersId(['id' => ($contact = (object) $contact)->id])->send();
+
$contact = (object)$contact;
$result = $this->gatewayRequest("get","customers/{$contact->id}");
@@ -148,50 +138,24 @@ class RotessaPaymentDriver extends BaseDriver
$this->client = Client::find($contact->client_id);
- $customer = (new Customer($result))->additional(['id' => $contact->id, 'custom_identifier' => $contact->custom_identifier ] );
- $this->findOrCreateCustomer($customer->additional + $customer->jsonSerialize());
+ $customer = array_merge($result, ['id' => $contact->id, 'custom_identifier' => $contact->custom_identifier ]);
+ // $customer = (new Customer($result))->additional( ['id' => $contact->id, 'custom_identifier' => $contact->custom_identifier ]); //creates a new customer in rotessa
+ // $this->findOrCreateCustomer($customer->additional + $customer->jsonSerialize());
+
+ $this->findOrCreateCustomer($customer);
+
}
);
// create new clients from rotessa customers
$client_emails = $client_contacts->pluck('email')->all();
+
$client_contacts = $customers->filter(function ($value, $key) use ($client_emails) {
return !in_array(((object) $value)->email, $client_emails);
})->each( function($customer) use ($company_id) {
$customer = $this->gatewayRequest("get", "customers/{$customer['id']}")->json();
- /**
- {
- "account_number": "11111111"
- "active": true,
- "address": {
- "address_1": "123 Main Street",
- "address_2": "Unit 4",
- "city": "Birmingham",
- "id": 114397,
- "postal_code": "36016",
- "province_code": "AL"
- },
- "authorization_type": "Online",
- "bank_account_type": "Checking",
- "bank_name": "Scotiabank",
- "created_at": "2015-02-10T23:50:45.000-06:00",
- "custom_identifier": "Mikey",
- "customer_type": "Personal",
- "email": "mikesmith@test.com",
- "financial_transactions": [],
- "home_phone": "(204) 555 5555",
- "id": 1,
- "identifier": "Mikey",
- "institution_number": "",
- "name": "Mike Smith",
- "phone": "(204) 555 4444",
- "routing_number": "111111111",
- "transaction_schedules": [],
- "transit_number": "",
- "updated_at": "2015-02-10T23:50:45.000-06:00"
- }
- */
+
$settings = ClientSettings::defaults();
$settings->currency_id = $this->company_gateway->company->getSetting('currency_id');
$customer = (object)$customer;
@@ -220,8 +184,7 @@ class RotessaPaymentDriver extends BaseDriver
$client->contacts()->saveMany([$contact]);
$contact = $client->contacts()->first();
$this->client = $client;
- $customer = (new Customer((array) $customer))->additional(['id' => $customer->id, 'custom_identifier' => $customer->custom_identifier ?? $contact->id ] );
- $this->findOrCreateCustomer($customer->additional + $customer->jsonSerialize());
+
});
} catch (\Throwable $th) {
$data = [
@@ -241,6 +204,8 @@ class RotessaPaymentDriver extends BaseDriver
public function findOrCreateCustomer(array $data)
{
+ nlog($data);
+
$result = null;
try {
@@ -248,37 +213,34 @@ class RotessaPaymentDriver extends BaseDriver
->where('company_gateway_id', $this->company_gateway->id)
->where('client_id', $this->client->id)
->where('is_deleted',0)
- ->orWhere(function (Builder $query) use ($data) {
- $query->where('token', join(".", Arr::only($data, ['id','custom_identifier'])))
- ->where('gateway_customer_reference', Arr::only($data,'id'));
- })
+ ->where('gateway_customer_reference', Arr::only($data,'id'))
->exists();
+
if ($existing)
return true;
- else if(!Arr::has($data,'id')) {
- // $result = $this->gateway->authorize($data)->send();
- // if (!$result->isSuccessful()) throw new \Exception($result->getMessage(), (int) $result->getCode());
+
+ if(!isset($data['id'])) {
+ nlog("no id, lets goo");
$result = $this->gatewayRequest('post', 'customers', $data);
if($result->failed())
$result->throw();
- $customer = new Customer($result->json());
- $data = array_filter($customer->resolve());
-
+ $data = $result->json();
+ nlog($data);
}
- // $payment_method_id = Arr::has($data,'address.postal_code') && ((int) $data['address']['postal_code'])? GatewayType::BANK_TRANSFER: GatewayType::ACSS;
- // TODO: Check/ Validate postal code between USA vs CAN
$payment_method_id = GatewayType::ACSS;
+
$gateway_token = $this->storeGatewayToken( [
- 'payment_meta' => $data + ['brand' => 'Bank Transfer', 'last4' => substr($data['account_number'], -4), 'type' => GatewayType::ACSS ],
+ 'payment_meta' => ['brand' => 'Bank Transfer', 'last4' => substr($data['account_number'], -4), 'type' => GatewayType::ACSS ],
'token' => join(".", Arr::only($data, ['id','custom_identifier'])),
'payment_method_id' => $payment_method_id ,
- ], ['gateway_customer_reference' =>
- $data['id']
- , 'routing_number' => Arr::has($data,'routing_number') ? $data['routing_number'] : $data['transit_number'] ]);
+ ], [
+ 'gateway_customer_reference' => $data['id'],
+ 'routing_number' => Arr::has($data,'routing_number') ? $data['routing_number'] : $data['transit_number']
+ ]);
return $data['id'];
diff --git a/app/Utils/TranslationHelper.php b/app/Utils/TranslationHelper.php
index c80cdbeb19d2..ad0f06d7b1df 100644
--- a/app/Utils/TranslationHelper.php
+++ b/app/Utils/TranslationHelper.php
@@ -17,80 +17,67 @@ use Illuminate\Support\Str;
class TranslationHelper
{
- public static function getIndustries()
- {
+ // public static function getIndustries()
+ // {
- /** @var \Illuminate\Support\Collection<\App\Models\Currency> */
- $industries = app('industries');
+ // /** @var \Illuminate\Support\Collection<\App\Models\Currency> */
+ // $industries = app('industries');
- return $industries->each(function ($industry) {
- $industry->name = ctrans('texts.industry_'.$industry->name);
- })->sortBy(function ($industry) {
- return $industry->name;
- });
- }
+ // return $industries->each(function ($industry) {
+ // $industry->name = ctrans('texts.industry_'.$industry->name);
+ // })->sortBy(function ($industry) {
+ // return $industry->name;
+ // });
+ // }
public static function getCountries()
{
/** @var \Illuminate\Support\Collection<\App\Models\Country> */
- $countries = app('countries');
+ return app('countries');
- return $countries;
-
- return \App\Models\Country::all()->each(function ($country) {
- $country->name = ctrans('texts.country_'.$country->name);
- })->sortBy(function ($country) {
- return $country->iso_3166_2;
- });
}
- public static function getPaymentTypes()
- {
+ // public static function getPaymentTypes()
+ // {
- /** @var \Illuminate\Support\Collection<\App\Models\PaymentType> */
- // $payment_types = app('payment_types');
+ // /** @var \Illuminate\Support\Collection<\App\Models\PaymentType> */
+ // // $payment_types = app('payment_types');
- return \App\Models\PaymentType::all()->each(function ($pType) {
- $pType->name = ctrans('texts.payment_type_'.$pType->name);
- })->sortBy(function ($pType) {
- return $pType->name;
- });
- }
+ // return \App\Models\PaymentType::all()->each(function ($pType) {
+ // $pType->name = ctrans('texts.payment_type_'.$pType->name);
+ // })->sortBy(function ($pType) {
+ // return $pType->name;
+ // });
+ // }
- public static function getLanguages()
- {
+ // public static function getLanguages()
+ // {
- /** @var \Illuminate\Support\Collection<\App\Models\Language> */
- // $languages = app('languages');
+ // /** @var \Illuminate\Support\Collection<\App\Models\Language> */
+ // // $languages = app('languages');
- return \App\Models\Language::all()->each(function ($lang) {
- $lang->name = ctrans('texts.lang_'.$lang->name);
- })->sortBy(function ($lang) {
- return $lang->name;
- });
- }
+ // return \App\Models\Language::all()->each(function ($lang) {
+ // $lang->name = ctrans('texts.lang_'.$lang->name);
+ // })->sortBy(function ($lang) {
+ // return $lang->name;
+ // });
+ // }
public static function getCurrencies()
{
/** @var \Illuminate\Support\Collection<\App\Models\Currency> */
- $currencies = app('currencies');
- return $currencies;
+ return app('currencies');
- return \App\Models\Currency::all()->each(function ($currency) {
- $currency->name = ctrans('texts.currency_'.Str::slug($currency->name, '_'));
- })->sortBy(function ($currency) {
- return $currency->name;
- });
}
- public static function getPaymentTerms()
- {
- return PaymentTerm::getCompanyTerms()->map(function ($term) {
- $term['name'] = ctrans('texts.payment_terms_net').' '.$term['num_days'];
+ // public static function getPaymentTerms()
+ // {
+ // return PaymentTerm::getCompanyTerms()->map(function ($term) {
+ // $term['name'] = ctrans('texts.payment_terms_net').' '.$term['num_days'];
- return $term;
- });
- }
+ // return $term;
+ // });
+ // }
}
diff --git a/composer.json b/composer.json
index 801fedde6e00..f33899c9ee3c 100644
--- a/composer.json
+++ b/composer.json
@@ -73,14 +73,12 @@
"league/csv": "^9.6",
"league/flysystem-aws-s3-v3": "^3.0",
"league/fractal": "^0.20.0",
- "league/omnipay": "^3.1",
"livewire/livewire": "^3",
"microsoft/microsoft-graph": "^1.69",
"mollie/mollie-api-php": "^2.36",
"nelexa/zip": "^4.0",
"nordigen/nordigen-php": "^1.1",
"nwidart/laravel-modules": "^11.0",
- "omnipay/paypal": "^3.0",
"phpoffice/phpspreadsheet": "^1.29",
"pragmarx/google2fa": "^8.0",
"predis/predis": "^2",
@@ -132,7 +130,6 @@
"app/Helpers/ClientPortal.php"
],
"classmap": [
- "app/PaymentDrivers/Rotessa/vendor/karneaud/omnipay-rotessa/src/Omnipay/Rotessa/"
]
},
"autoload-dev": {
diff --git a/composer.lock b/composer.lock
index e194aaba1e31..55d090faa651 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "8fdb8245fbc563f8c09da161876f52a7",
+ "content-hash": "6eda3a2962158b87dab46711e65a8438",
"packages": [
{
"name": "adrienrn/php-mimetyper",
@@ -1038,72 +1038,6 @@
},
"time": "2024-08-02T08:07:53+00:00"
},
- {
- "name": "clue/stream-filter",
- "version": "v1.7.0",
- "source": {
- "type": "git",
- "url": "https://github.com/clue/stream-filter.git",
- "reference": "049509fef80032cb3f051595029ab75b49a3c2f7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7",
- "reference": "049509fef80032cb3f051595029ab75b49a3c2f7",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
- },
- "type": "library",
- "autoload": {
- "files": [
- "src/functions_include.php"
- ],
- "psr-4": {
- "Clue\\StreamFilter\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Christian Lück",
- "email": "christian@clue.engineering"
- }
- ],
- "description": "A simple and modern approach to stream filtering in PHP",
- "homepage": "https://github.com/clue/stream-filter",
- "keywords": [
- "bucket brigade",
- "callback",
- "filter",
- "php_user_filter",
- "stream",
- "stream_filter_append",
- "stream_filter_register"
- ],
- "support": {
- "issues": "https://github.com/clue/stream-filter/issues",
- "source": "https://github.com/clue/stream-filter/tree/v1.7.0"
- },
- "funding": [
- {
- "url": "https://clue.engineering/support",
- "type": "custom"
- },
- {
- "url": "https://github.com/clue",
- "type": "github"
- }
- ],
- "time": "2023-12-20T15:40:13+00:00"
- },
{
"name": "composer/ca-bundle",
"version": "1.5.1",
@@ -2585,7 +2519,7 @@
},
{
"name": "google/apiclient-services",
- "version": "v0.366.0",
+ "version": "v0.367.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
@@ -2623,7 +2557,7 @@
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
- "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.366.0"
+ "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.367.0"
},
"time": "2024-07-11T01:08:44+00:00"
},
@@ -6008,69 +5942,6 @@
},
"time": "2022-04-15T14:02:14+00:00"
},
- {
- "name": "league/omnipay",
- "version": "v3.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/thephpleague/omnipay.git",
- "reference": "38f66a0cc043ed51d6edf7956d6439a2f263501f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thephpleague/omnipay/zipball/38f66a0cc043ed51d6edf7956d6439a2f263501f",
- "reference": "38f66a0cc043ed51d6edf7956d6439a2f263501f",
- "shasum": ""
- },
- "require": {
- "omnipay/common": "^3.1",
- "php": "^7.2|^8.0",
- "php-http/discovery": "^1.14",
- "php-http/guzzle7-adapter": "^1"
- },
- "require-dev": {
- "omnipay/tests": "^3|^4"
- },
- "type": "metapackage",
- "extra": {
- "branch-alias": {
- "dev-master": "3.2.x-dev"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Adrian Macneil",
- "email": "adrian@adrianmacneil.com"
- },
- {
- "name": "Barry vd. Heuvel",
- "email": "barryvdh@gmail.com"
- }
- ],
- "description": "Omnipay payment processing library",
- "homepage": "https://omnipay.thephpleague.com/",
- "keywords": [
- "checkout",
- "creditcard",
- "omnipay",
- "payment"
- ],
- "support": {
- "issues": "https://github.com/thephpleague/omnipay/issues",
- "source": "https://github.com/thephpleague/omnipay/tree/v3.2.1"
- },
- "funding": [
- {
- "url": "https://github.com/barryvdh",
- "type": "github"
- }
- ],
- "time": "2021-06-05T11:34:12+00:00"
- },
{
"name": "livewire/livewire",
"version": "v3.5.4",
@@ -6546,94 +6417,6 @@
},
"time": "2024-07-17T08:02:14+00:00"
},
- {
- "name": "moneyphp/money",
- "version": "v4.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/moneyphp/money.git",
- "reference": "a1daa7daf159b4044e3d0c34c41fe2be5860e850"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/moneyphp/money/zipball/a1daa7daf159b4044e3d0c34c41fe2be5860e850",
- "reference": "a1daa7daf159b4044e3d0c34c41fe2be5860e850",
- "shasum": ""
- },
- "require": {
- "ext-bcmath": "*",
- "ext-filter": "*",
- "ext-json": "*",
- "php": "~8.1.0 || ~8.2.0 || ~8.3.0"
- },
- "require-dev": {
- "cache/taggable-cache": "^1.1.0",
- "doctrine/coding-standard": "^12.0",
- "doctrine/instantiator": "^1.5.0 || ^2.0",
- "ext-gmp": "*",
- "ext-intl": "*",
- "florianv/exchanger": "^2.8.1",
- "florianv/swap": "^4.3.0",
- "moneyphp/crypto-currencies": "^1.1.0",
- "moneyphp/iso-currencies": "^3.4",
- "php-http/message": "^1.16.0",
- "php-http/mock-client": "^1.6.0",
- "phpbench/phpbench": "^1.2.5",
- "phpunit/phpunit": "^10.5.9",
- "psalm/plugin-phpunit": "^0.18.4",
- "psr/cache": "^1.0.1 || ^2.0 || ^3.0",
- "vimeo/psalm": "~5.20.0"
- },
- "suggest": {
- "ext-gmp": "Calculate without integer limits",
- "ext-intl": "Format Money objects with intl",
- "florianv/exchanger": "Exchange rates library for PHP",
- "florianv/swap": "Exchange rates library for PHP",
- "psr/cache-implementation": "Used for Currency caching"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Money\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Mathias Verraes",
- "email": "mathias@verraes.net",
- "homepage": "http://verraes.net"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- },
- {
- "name": "Frederik Bosch",
- "email": "f.bosch@genkgo.nl"
- }
- ],
- "description": "PHP implementation of Fowler's Money pattern",
- "homepage": "http://moneyphp.org",
- "keywords": [
- "Value Object",
- "money",
- "vo"
- ],
- "support": {
- "issues": "https://github.com/moneyphp/money/issues",
- "source": "https://github.com/moneyphp/money/tree/v4.5.0"
- },
- "time": "2024-02-15T19:47:21+00:00"
- },
{
"name": "monolog/monolog",
"version": "3.7.0",
@@ -7727,164 +7510,6 @@
],
"time": "2023-11-13T09:31:12+00:00"
},
- {
- "name": "omnipay/common",
- "version": "v3.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/thephpleague/omnipay-common.git",
- "reference": "2eca3823e9069e2c36b6007a090577d5584f9518"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thephpleague/omnipay-common/zipball/2eca3823e9069e2c36b6007a090577d5584f9518",
- "reference": "2eca3823e9069e2c36b6007a090577d5584f9518",
- "shasum": ""
- },
- "require": {
- "moneyphp/money": "^3.1|^4.0.3",
- "php": "^7.2|^8",
- "php-http/client-implementation": "^1",
- "php-http/discovery": "^1.14",
- "php-http/message": "^1.5",
- "php-http/message-factory": "^1.1",
- "symfony/http-foundation": "^2.1|^3|^4|^5|^6|^7"
- },
- "require-dev": {
- "http-interop/http-factory-guzzle": "^1.1",
- "omnipay/tests": "^4.1",
- "php-http/guzzle7-adapter": "^1",
- "php-http/mock-client": "^1.6",
- "squizlabs/php_codesniffer": "^3.8.1"
- },
- "suggest": {
- "league/omnipay": "The default Omnipay package provides a default HTTP Adapter."
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Omnipay\\Common\\": "src/Common"
- },
- "classmap": [
- "src/Omnipay.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Adrian Macneil",
- "email": "adrian@adrianmacneil.com"
- },
- {
- "name": "Barry vd. Heuvel",
- "email": "barryvdh@gmail.com"
- },
- {
- "name": "Jason Judge",
- "email": "jason.judge@consil.co.uk"
- },
- {
- "name": "Del"
- },
- {
- "name": "Omnipay Contributors",
- "homepage": "https://github.com/thephpleague/omnipay-common/contributors"
- }
- ],
- "description": "Common components for Omnipay payment processing library",
- "homepage": "https://github.com/thephpleague/omnipay-common",
- "keywords": [
- "gateway",
- "merchant",
- "omnipay",
- "pay",
- "payment",
- "purchase"
- ],
- "support": {
- "issues": "https://github.com/thephpleague/omnipay-common/issues",
- "source": "https://github.com/thephpleague/omnipay-common/tree/v3.3.0"
- },
- "funding": [
- {
- "url": "https://github.com/barryvdh",
- "type": "github"
- }
- ],
- "time": "2024-03-08T11:56:40+00:00"
- },
- {
- "name": "omnipay/paypal",
- "version": "v3.0.2",
- "source": {
- "type": "git",
- "url": "https://github.com/thephpleague/omnipay-paypal.git",
- "reference": "519db61b32ff0c1e56cbec94762b970ee9674f65"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thephpleague/omnipay-paypal/zipball/519db61b32ff0c1e56cbec94762b970ee9674f65",
- "reference": "519db61b32ff0c1e56cbec94762b970ee9674f65",
- "shasum": ""
- },
- "require": {
- "omnipay/common": "^3"
- },
- "require-dev": {
- "omnipay/tests": "^3",
- "phpro/grumphp": "^0.14",
- "squizlabs/php_codesniffer": "^3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Omnipay\\PayPal\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Adrian Macneil",
- "email": "adrian@adrianmacneil.com"
- },
- {
- "name": "Omnipay Contributors",
- "homepage": "https://github.com/thephpleague/omnipay-paypal/contributors"
- }
- ],
- "description": "PayPal gateway for Omnipay payment processing library",
- "homepage": "https://github.com/thephpleague/omnipay-paypal",
- "keywords": [
- "gateway",
- "merchant",
- "omnipay",
- "pay",
- "payment",
- "paypal",
- "purchase"
- ],
- "support": {
- "issues": "https://github.com/thephpleague/omnipay-paypal/issues",
- "source": "https://github.com/thephpleague/omnipay-paypal/tree/v3.0.2"
- },
- "time": "2018-05-15T10:35:58+00:00"
- },
{
"name": "paragonie/constant_time_encoding",
"version": "v2.7.0",
@@ -8178,380 +7803,6 @@
},
"time": "2024-04-08T12:52:34+00:00"
},
- {
- "name": "php-http/discovery",
- "version": "1.19.4",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/discovery.git",
- "reference": "0700efda8d7526335132360167315fdab3aeb599"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/discovery/zipball/0700efda8d7526335132360167315fdab3aeb599",
- "reference": "0700efda8d7526335132360167315fdab3aeb599",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^1.0|^2.0",
- "php": "^7.1 || ^8.0"
- },
- "conflict": {
- "nyholm/psr7": "<1.0",
- "zendframework/zend-diactoros": "*"
- },
- "provide": {
- "php-http/async-client-implementation": "*",
- "php-http/client-implementation": "*",
- "psr/http-client-implementation": "*",
- "psr/http-factory-implementation": "*",
- "psr/http-message-implementation": "*"
- },
- "require-dev": {
- "composer/composer": "^1.0.2|^2.0",
- "graham-campbell/phpspec-skip-example-extension": "^5.0",
- "php-http/httplug": "^1.0 || ^2.0",
- "php-http/message-factory": "^1.0",
- "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3",
- "sebastian/comparator": "^3.0.5 || ^4.0.8",
- "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "Http\\Discovery\\Composer\\Plugin",
- "plugin-optional": true
- },
- "autoload": {
- "psr-4": {
- "Http\\Discovery\\": "src/"
- },
- "exclude-from-classmap": [
- "src/Composer/Plugin.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations",
- "homepage": "http://php-http.org",
- "keywords": [
- "adapter",
- "client",
- "discovery",
- "factory",
- "http",
- "message",
- "psr17",
- "psr7"
- ],
- "support": {
- "issues": "https://github.com/php-http/discovery/issues",
- "source": "https://github.com/php-http/discovery/tree/1.19.4"
- },
- "time": "2024-03-29T13:00:05+00:00"
- },
- {
- "name": "php-http/guzzle7-adapter",
- "version": "1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/guzzle7-adapter.git",
- "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/guzzle7-adapter/zipball/fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01",
- "reference": "fb075a71dbfa4847cf0c2938c4e5a9c478ef8b01",
- "shasum": ""
- },
- "require": {
- "guzzlehttp/guzzle": "^7.0",
- "php": "^7.2 | ^8.0",
- "php-http/httplug": "^2.0",
- "psr/http-client": "^1.0"
- },
- "provide": {
- "php-http/async-client-implementation": "1.0",
- "php-http/client-implementation": "1.0",
- "psr/http-client-implementation": "1.0"
- },
- "require-dev": {
- "php-http/client-integration-tests": "^3.0",
- "phpunit/phpunit": "^8.0|^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.2.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Http\\Adapter\\Guzzle7\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com"
- }
- ],
- "description": "Guzzle 7 HTTP Adapter",
- "homepage": "http://httplug.io",
- "keywords": [
- "Guzzle",
- "http"
- ],
- "support": {
- "issues": "https://github.com/php-http/guzzle7-adapter/issues",
- "source": "https://github.com/php-http/guzzle7-adapter/tree/1.0.0"
- },
- "time": "2021-03-09T07:35:15+00:00"
- },
- {
- "name": "php-http/httplug",
- "version": "2.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/httplug.git",
- "reference": "625ad742c360c8ac580fcc647a1541d29e257f67"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67",
- "reference": "625ad742c360c8ac580fcc647a1541d29e257f67",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0",
- "php-http/promise": "^1.1",
- "psr/http-client": "^1.0",
- "psr/http-message": "^1.0 || ^2.0"
- },
- "require-dev": {
- "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
- "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Http\\Client\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Eric GELOEN",
- "email": "geloen.eric@gmail.com"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
- }
- ],
- "description": "HTTPlug, the HTTP client abstraction for PHP",
- "homepage": "http://httplug.io",
- "keywords": [
- "client",
- "http"
- ],
- "support": {
- "issues": "https://github.com/php-http/httplug/issues",
- "source": "https://github.com/php-http/httplug/tree/2.4.0"
- },
- "time": "2023-04-14T15:10:03+00:00"
- },
- {
- "name": "php-http/message",
- "version": "1.16.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/message.git",
- "reference": "5997f3289332c699fa2545c427826272498a2088"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/message/zipball/5997f3289332c699fa2545c427826272498a2088",
- "reference": "5997f3289332c699fa2545c427826272498a2088",
- "shasum": ""
- },
- "require": {
- "clue/stream-filter": "^1.5",
- "php": "^7.2 || ^8.0",
- "psr/http-message": "^1.1 || ^2.0"
- },
- "provide": {
- "php-http/message-factory-implementation": "1.0"
- },
- "require-dev": {
- "ergebnis/composer-normalize": "^2.6",
- "ext-zlib": "*",
- "guzzlehttp/psr7": "^1.0 || ^2.0",
- "laminas/laminas-diactoros": "^2.0 || ^3.0",
- "php-http/message-factory": "^1.0.2",
- "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
- "slim/slim": "^3.0"
- },
- "suggest": {
- "ext-zlib": "Used with compressor/decompressor streams",
- "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories",
- "laminas/laminas-diactoros": "Used with Diactoros Factories",
- "slim/slim": "Used with Slim Framework PSR-7 implementation"
- },
- "type": "library",
- "autoload": {
- "files": [
- "src/filters.php"
- ],
- "psr-4": {
- "Http\\Message\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "HTTP Message related tools",
- "homepage": "http://php-http.org",
- "keywords": [
- "http",
- "message",
- "psr-7"
- ],
- "support": {
- "issues": "https://github.com/php-http/message/issues",
- "source": "https://github.com/php-http/message/tree/1.16.1"
- },
- "time": "2024-03-07T13:22:09+00:00"
- },
- {
- "name": "php-http/message-factory",
- "version": "1.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/message-factory.git",
- "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/message-factory/zipball/4d8778e1c7d405cbb471574821c1ff5b68cc8f57",
- "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4",
- "psr/http-message": "^1.0 || ^2.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Http\\Message\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "Factory interfaces for PSR-7 HTTP Message",
- "homepage": "http://php-http.org",
- "keywords": [
- "factory",
- "http",
- "message",
- "stream",
- "uri"
- ],
- "support": {
- "issues": "https://github.com/php-http/message-factory/issues",
- "source": "https://github.com/php-http/message-factory/tree/1.1.0"
- },
- "abandoned": "psr/http-factory",
- "time": "2023-04-14T14:16:17+00:00"
- },
- {
- "name": "php-http/promise",
- "version": "1.3.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/promise.git",
- "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83",
- "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
- },
- "require-dev": {
- "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3",
- "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Http\\Promise\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Joel Wurtz",
- "email": "joel.wurtz@gmail.com"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "Promise used for asynchronous HTTP requests",
- "homepage": "http://httplug.io",
- "keywords": [
- "promise"
- ],
- "support": {
- "issues": "https://github.com/php-http/promise/issues",
- "source": "https://github.com/php-http/promise/tree/1.3.1"
- },
- "time": "2024-03-15T13:55:21+00:00"
- },
{
"name": "php-jsonpointer/php-jsonpointer",
"version": "v3.0.2",
diff --git a/resources/views/billing-portal/v3/authentication/register-form.blade.php b/resources/views/billing-portal/v3/authentication/register-form.blade.php
index 83230c043bd8..fcead1bf59df 100644
--- a/resources/views/billing-portal/v3/authentication/register-form.blade.php
+++ b/resources/views/billing-portal/v3/authentication/register-form.blade.php
@@ -47,7 +47,7 @@
@foreach(App\Utils\TranslationHelper::getCurrencies() as $currency)
@endforeach
diff --git a/resources/views/portal/ninja2020/auth/register.blade.php b/resources/views/portal/ninja2020/auth/register.blade.php
index d0f9d4093b1e..7418b1f0b087 100644
--- a/resources/views/portal/ninja2020/auth/register.blade.php
+++ b/resources/views/portal/ninja2020/auth/register.blade.php
@@ -70,7 +70,7 @@
@foreach(App\Utils\TranslationHelper::getCurrencies() as $currency)
@endforeach
diff --git a/resources/views/portal/ninja2020/gateways/rotessa/bank_transfer/pay.blade.php b/resources/views/portal/ninja2020/gateways/rotessa/bank_transfer/pay.blade.php
index af0158e0716d..f614ca0e30aa 100644
--- a/resources/views/portal/ninja2020/gateways/rotessa/bank_transfer/pay.blade.php
+++ b/resources/views/portal/ninja2020/gateways/rotessa/bank_transfer/pay.blade.php
@@ -24,8 +24,8 @@
- {{ App\Models\GatewayType::getAlias($token->gateway_type_id) }} ({{ $token->meta->brand }})
- {{ ctrans('texts.account_number') }}#: {{ $token->meta->account_number }}
+ {{ App\Models\GatewayType::getAlias($token->gateway_type_id) }} ({{ $token->meta->brand ?? 'Bank Transfer' }})
+ {{ ctrans('texts.account_number') }}#: {{ $token->meta?->last4 ?? '' }}
@endforeach
diff --git a/resources/views/portal/ninja2020/gateways/rotessa/components/account.blade.php b/resources/views/portal/ninja2020/gateways/rotessa/components/account.blade.php
index e994cc64fcc1..6f6fa93e9742 100644
--- a/resources/views/portal/ninja2020/gateways/rotessa/components/account.blade.php
+++ b/resources/views/portal/ninja2020/gateways/rotessa/components/account.blade.php
@@ -13,6 +13,10 @@
{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror diff --git a/resources/views/portal/ninja2020/gateways/rotessa/components/banks/CA/bank.blade.php b/resources/views/portal/ninja2020/gateways/rotessa/components/banks/CA/bank.blade.php index 6ad256c3e6a3..3ea417b4672f 100644 --- a/resources/views/portal/ninja2020/gateways/rotessa/components/banks/CA/bank.blade.php +++ b/resources/views/portal/ninja2020/gateways/rotessa/components/banks/CA/bank.blade.php @@ -4,6 +4,9 @@{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror{{ $message }}
+ @enderror diff --git a/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/CA.blade.php b/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/CA.blade.php index 248ce5b5c316..070931b3eeba 100644 --- a/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/CA.blade.php +++ b/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/CA.blade.php @@ -8,5 +8,9 @@ @endforeach + + @error('province_code') +{{ $message }}
+ @enderror diff --git a/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/US.blade.php b/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/US.blade.php index b47e8694d339..f2f4f86e095a 100644 --- a/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/US.blade.php +++ b/resources/views/portal/ninja2020/gateways/rotessa/components/dropdowns/country/US.blade.php @@ -8,5 +8,8 @@ @endforeach + @error('province_code') +{{ $message }}
+ @enderror