Merge branch 'v5-develop' into v5-develop

This commit is contained in:
David Bomba 2021-09-14 22:02:06 +10:00 committed by GitHub
commit 8d733ed725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 385870 additions and 385447 deletions

View File

@ -12,6 +12,7 @@
namespace App\Models\Presenters;
use App\Models\Country;
use Illuminate\Support\Str;
/**
* Class CompanyPresenter.
@ -139,4 +140,24 @@ class CompanyPresenter extends EntityPresenter
{
return $this->entity->size ? $this->entity->size->name : '';
}
/**
* Return company website URL.
*
* @return string
*/
public function website(): string
{
$website = $this->entity->getSetting('website');
if (empty($website)) {
return $website;
}
if (Str::contains($website, ['http', 'https'])) {
return $website;
}
return \sprintf('http://%s', $website);
}
}

View File

@ -61,6 +61,13 @@ class CreditCard
$data['gateway'] = $this->braintree;
$data['client_token'] = $this->braintree->gateway->clientToken()->generate();
if ($this->braintree->company_gateway->getConfigField('merchantAccountId')) {
/** https://developer.paypal.com/braintree/docs/reference/request/client-token/generate#merchant_account_id */
$data['client_token'] = $this->braintree->gateway->clientToken()->generate([
'merchantAccountId' => $this->braintree->company_gateway->getConfigField('merchantAccountId')
]);
}
return render('gateways.braintree.credit_card.pay', $data);
}
@ -136,13 +143,15 @@ class CreditCard
$gateway_response = \json_decode($data['gateway_response']);
$response = $this->braintree->gateway->paymentMethod()->create([
$data = [
'customerId' => $customerId,
'paymentMethodNonce' => $gateway_response->nonce,
'options' => [
'verifyCard' => true,
],
]);
];
$response = $this->braintree->gateway->paymentMethod()->create($data);
if ($response->success) {
return $response->paymentMethod->token;

View File

@ -424,6 +424,7 @@ class StripePaymentDriver extends BaseDriver
sleep(2);
if ($request->type === 'charge.succeeded') {
foreach ($request->data as $transaction) {
$payment = Payment::query()
->where('transaction_reference', $transaction['id'])

View File

@ -51,6 +51,7 @@
"hashids/hashids": "^4.0",
"hedii/laravel-gelf-logger": "^6.0",
"intervention/image": "^2.5",
"invoiceninja/inspector": "dev-main",
"laracasts/presenter": "^0.2.1",
"laravel/framework": "^8.0",
"laravel/slack-notification-channel": "^2.2",

68
composer.lock generated
View File

@ -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": "0b4a7e813c3e563d631164bd24968964",
"content-hash": "b5675738fe061ea09b0bbd89e553d074",
"packages": [
{
"name": "asm/php-ansible",
@ -3326,6 +3326,69 @@
],
"time": "2021-07-22T14:31:53+00:00"
},
{
"name": "invoiceninja/inspector",
"version": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/invoiceninja/inspector.git",
"reference": "3f5beb9854c0d1d6f65bc0d9ba847503e6e84583"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/invoiceninja/inspector/zipball/3f5beb9854c0d1d6f65bc0d9ba847503e6e84583",
"reference": "3f5beb9854c0d1d6f65bc0d9ba847503e6e84583",
"shasum": ""
},
"require": {
"doctrine/dbal": "^3.1",
"illuminate/support": "^8.0",
"php": "^7.4|^8.0"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.0"
},
"default-branch": true,
"type": "library",
"extra": {
"laravel": {
"providers": [
"InvoiceNinja\\Inspector\\InspectorServiceProvider"
],
"aliases": {
"Inspector": "InvoiceNinja\\Inspector\\InspectorFacade"
}
}
},
"autoload": {
"psr-4": {
"InvoiceNinja\\Inspector\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Benjamin Beganović",
"email": "benjamin.beganovic4@outlook.com",
"role": "Developer"
}
],
"description": "Simplified database records management",
"homepage": "https://github.com/invoiceninja/inspector",
"keywords": [
"inspector",
"invoiceninja"
],
"support": {
"issues": "https://github.com/invoiceninja/inspector/issues",
"source": "https://github.com/invoiceninja/inspector/tree/main"
},
"time": "2021-09-11T11:35:02+00:00"
},
{
"name": "jean85/pretty-package-versions",
"version": "2.0.4",
@ -15598,6 +15661,7 @@
"minimum-stability": "dev",
"stability-flags": {
"asm/php-ansible": 20,
"invoiceninja/inspector": 20,
"webpatser/laravel-countries": 20
},
"prefer-stable": true,
@ -15611,5 +15675,5 @@
"platform-dev": {
"php": "^7.3|^7.4|^8.0"
},
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}

View File

@ -3,12 +3,12 @@ const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {
"main.dart.js": "5737d30da23ff502a55061345fd08bd1",
"main.dart.js": "17e5b654f448781d79f55e1b223eda44",
"version.json": "9ec5e3813adc4bfd8713556c5059e97d",
"manifest.json": "ef43d90e57aa7682d7e2cfba2f484a40",
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35",
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
"/": "1692e36290d6065cb75b3b2dd7dac863",
"/": "11547dbccd61ee164f3e727ec78c2fd4",
"assets/NOTICES": "9eb7e2eb2888ea5bae5f536720db37cd",
"assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
"assets/AssetManifest.json": "38d9aea341601f3a5c6fa7b5a1216ea5",

127967
public/main.dart.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

174321
public/main.foss.dart.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

147367
public/main.last.dart.js vendored

File diff suppressed because one or more lines are too long

140661
public/main.next.dart.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

174505
public/main.wasm.dart.js vendored

File diff suppressed because one or more lines are too long

View File

@ -77,10 +77,10 @@
</div>
@endif
@if(!is_null($company) && !empty($company->getSetting('website')))
@if(!empty($company->present()->website()))
<div class="mt-5 text-center">
<a class="button-link text-sm" href="{{ $company->getSetting('website') }}">
{{ ctrans('texts.back_to', ['url' => parse_url($company->getSetting('website'))['host'] ?? $company->getSetting('website') ]) }}
<a class="button-link text-sm" href="{{ $company->present()->website() }}">
{{ ctrans('texts.back_to', ['url' => parse_url($company->present()->website())['host'] ?? $company->present()->website() ]) }}
</a>
</div>
@endif