mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 14:42:42 +01:00
commit
7612ae4ba8
@ -194,8 +194,15 @@ class LoginController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$user->setCompany($user->account->default_company);
|
$user->setCompany($user->account->default_company);
|
||||||
$timeout = auth()->user()->company()->default_password_timeout / 60000;
|
|
||||||
Cache::put(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
$timeout = $user->company()->default_password_timeout;
|
||||||
|
|
||||||
|
if($timeout == 0)
|
||||||
|
$timeout = 30*60*1000*1000;
|
||||||
|
else
|
||||||
|
$timeout = $timeout/1000;
|
||||||
|
|
||||||
|
Cache::put($user->hashed_id.'_logged_in', Str::random(64), $timeout);
|
||||||
|
|
||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
->where('user_id', auth()->user()->id);
|
->where('user_id', auth()->user()->id);
|
||||||
@ -333,7 +340,15 @@ class LoginController extends BaseController
|
|||||||
|
|
||||||
Auth::login($existing_user, true);
|
Auth::login($existing_user, true);
|
||||||
$existing_user->setCompany($existing_user->account->default_company);
|
$existing_user->setCompany($existing_user->account->default_company);
|
||||||
$timeout = $existing_user->company()->default_password_timeout / 60000;
|
|
||||||
|
$timeout = $existing_user->company()->default_password_timeout;
|
||||||
|
|
||||||
|
if($timeout == 0)
|
||||||
|
$timeout = 30*60*1000*1000;
|
||||||
|
else
|
||||||
|
$timeout = $timeout/1000;
|
||||||
|
|
||||||
|
|
||||||
Cache::put($existing_user->hashed_id.'_logged_in', Str::random(64), $timeout);
|
Cache::put($existing_user->hashed_id.'_logged_in', Str::random(64), $timeout);
|
||||||
|
|
||||||
$cu = CompanyUser::query()
|
$cu = CompanyUser::query()
|
||||||
@ -375,7 +390,15 @@ class LoginController extends BaseController
|
|||||||
|
|
||||||
auth()->user()->email_verified_at = now();
|
auth()->user()->email_verified_at = now();
|
||||||
auth()->user()->save();
|
auth()->user()->save();
|
||||||
$timeout = auth()->user()->company()->default_password_timeout / 60000;
|
|
||||||
|
$timeout = auth()->user()->company()->default_password_timeout;
|
||||||
|
|
||||||
|
if($timeout == 0)
|
||||||
|
$timeout = 30*60*1000*1000;
|
||||||
|
else
|
||||||
|
$timeout = $timeout/1000;
|
||||||
|
|
||||||
|
|
||||||
Cache::put(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
Cache::put(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
||||||
|
|
||||||
$cu = CompanyUser::whereUserId(auth()->user()->id);
|
$cu = CompanyUser::whereUserId(auth()->user()->id);
|
||||||
|
@ -107,10 +107,11 @@ class BaseController extends Controller
|
|||||||
'token',
|
'token',
|
||||||
'company.activities',
|
'company.activities',
|
||||||
'company.documents',
|
'company.documents',
|
||||||
//'company.users.company_user',
|
'company.users.company_user',
|
||||||
'company.tax_rates',
|
'company.tax_rates',
|
||||||
'company.groups',
|
'company.groups',
|
||||||
'company.payment_terms',
|
'company.payment_terms',
|
||||||
|
'company.designs.company',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@ -416,12 +417,12 @@ class BaseController extends Controller
|
|||||||
$query->where('credits.user_id', $user->id)->orWhere('credits.assigned_user_id', $user->id);
|
$query->where('credits.user_id', $user->id)->orWhere('credits.assigned_user_id', $user->id);
|
||||||
|
|
||||||
},
|
},
|
||||||
'company.designs'=> function ($query) use ($created_at, $user) {
|
// 'company.designs'=> function ($query) use ($created_at, $user) {
|
||||||
$query->where('created_at', '>=', $created_at)->with('company');
|
// $query->where('created_at', '>=', $created_at)->with('company');
|
||||||
|
|
||||||
if(!$user->isAdmin())
|
// if(!$user->isAdmin())
|
||||||
$query->where('designs.user_id', $user->id);
|
// $query->where('designs.user_id', $user->id);
|
||||||
},
|
// },
|
||||||
'company.documents'=> function ($query) use ($created_at, $user) {
|
'company.documents'=> function ($query) use ($created_at, $user) {
|
||||||
$query->where('created_at', '>=', $created_at);
|
$query->where('created_at', '>=', $created_at);
|
||||||
},
|
},
|
||||||
|
@ -208,6 +208,9 @@ class PaymentController extends BaseController
|
|||||||
{
|
{
|
||||||
$payment = $this->payment_repo->save($request->all(), PaymentFactory::create(auth()->user()->company()->id, auth()->user()->id));
|
$payment = $this->payment_repo->save($request->all(), PaymentFactory::create(auth()->user()->company()->id, auth()->user()->id));
|
||||||
|
|
||||||
|
if($request->has('email_receipt') && $request->input('email_receipt') == 'true' && !$payment->client->getSetting('client_manual_payment_notification'))
|
||||||
|
$payment->service()->sendEmail();
|
||||||
|
|
||||||
return $this->itemResponse($payment);
|
return $this->itemResponse($payment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,12 @@
|
|||||||
namespace App\Http\Livewire;
|
namespace App\Http\Livewire;
|
||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
use App\Models\CompanyGateway;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\PaymentDrivers\WePayPaymentDriver;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
use WePay;
|
||||||
|
|
||||||
class WepaySignup extends Component
|
class WepaySignup extends Component
|
||||||
{
|
{
|
||||||
@ -25,29 +28,42 @@ class WepaySignup extends Component
|
|||||||
public $first_name;
|
public $first_name;
|
||||||
public $last_name;
|
public $last_name;
|
||||||
public $email;
|
public $email;
|
||||||
|
public $company_name;
|
||||||
|
public $country;
|
||||||
|
public $ach;
|
||||||
|
public $wepay_payment_tos_agree;
|
||||||
|
public $debit_cards;
|
||||||
|
|
||||||
public $terms;
|
public $terms;
|
||||||
public $privacy_policy;
|
public $privacy_policy;
|
||||||
|
|
||||||
public $saved;
|
public $saved;
|
||||||
|
public $company;
|
||||||
|
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
'first_name' => ['sometimes'],
|
'first_name' => ['required'],
|
||||||
'last_name' => ['sometimes'],
|
'last_name' => ['required'],
|
||||||
'email' => ['required', 'email'],
|
'email' => ['required', 'email'],
|
||||||
|
'company_name' => ['required'],
|
||||||
|
'country' => ['required'],
|
||||||
|
'ach' => ['sometimes'],
|
||||||
|
'wepay_payment_tos_agree' => ['accepted'],
|
||||||
];
|
];
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
$user = User::find($this->user_id);
|
$user = User::find($this->user_id);
|
||||||
$company = Company::where('company_key', $this->company_key)->first();
|
$this->company = Company::where('company_key', $this->company_key)->firstOrFail();
|
||||||
|
|
||||||
$this->fill([
|
$this->fill([
|
||||||
|
'wepay_payment_tos_agree' => '',
|
||||||
|
'ach' => '',
|
||||||
|
'country' => 'US',
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
'first_name' => $user->first_name,
|
'first_name' => $user->first_name,
|
||||||
'last_name' => $user->last_name,
|
'last_name' => $user->last_name,
|
||||||
'email' => $user->email,
|
'email' => $user->email,
|
||||||
'company_name' => $company->present()->name(),
|
'company_name' => $this->company->present()->name(),
|
||||||
'saved' => ctrans('texts.confirm'),
|
'saved' => ctrans('texts.confirm'),
|
||||||
'terms' => '<a href="https://go.wepay.com/terms-of-service" target="_blank">'.ctrans('texts.terms_of_service').'</a>',
|
'terms' => '<a href="https://go.wepay.com/terms-of-service" target="_blank">'.ctrans('texts.terms_of_service').'</a>',
|
||||||
'privacy_policy' => '<a href="https://go.wepay.com/privacy-policy" target="_blank">'.ctrans('texts.privacy_policy').'</a>',
|
'privacy_policy' => '<a href="https://go.wepay.com/privacy-policy" target="_blank">'.ctrans('texts.privacy_policy').'</a>',
|
||||||
@ -61,13 +77,72 @@ class WepaySignup extends Component
|
|||||||
|
|
||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
|
//need to create or get a new WePay CompanyGateway
|
||||||
|
$cg = CompanyGateway::where('id', 49)
|
||||||
|
->where('company_id', $this->company->id)
|
||||||
|
->firstOrNew();
|
||||||
|
|
||||||
|
if(!$cg->id) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$data = $this->validate($this->rules);
|
$data = $this->validate($this->rules);
|
||||||
|
|
||||||
// $this->user
|
$this->saved = ctrans('texts.processing');
|
||||||
// ->fill($data)
|
|
||||||
// ->save();
|
$wepay_driver = new WePayPaymentDriver(new CompanyGateway, null, null);
|
||||||
|
|
||||||
|
$wepay_driver->init();
|
||||||
|
|
||||||
|
$user_details = [
|
||||||
|
'client_id' => config('ninja.wepay.client_id'),
|
||||||
|
'client_secret' => config('ninja.wepay.client_secret'),
|
||||||
|
'email' => $data['email'],
|
||||||
|
'first_name' => $data['first_name'],
|
||||||
|
'last_name' => $data['last_name'],
|
||||||
|
'original_ip' => request()->ip(),
|
||||||
|
'original_device' => request()->server('HTTP_USER_AGENT'),
|
||||||
|
'tos_acceptance_time' => time(),
|
||||||
|
'redirect_uri' => route('wepay.process_signup'),
|
||||||
|
'scope' => 'manage_accounts,collect_payments,view_user,preapprove_payments,send_money',
|
||||||
|
];
|
||||||
|
|
||||||
|
$wepay_user = $wepay_driver->request('user/register/', $user_details);
|
||||||
|
|
||||||
|
$access_token = $wepay_user->access_token;
|
||||||
|
|
||||||
|
$access_token_expires = $wepay_user->expires_in ? (time() + $wepay_user->expires_in) : null;
|
||||||
|
|
||||||
|
$wepay = new WePay($access_token);
|
||||||
|
|
||||||
|
$account_details = [
|
||||||
|
'name' => $data['company_name'],
|
||||||
|
'description' => ctrans('texts.wepay_account_description'),
|
||||||
|
'theme_object' => json_decode('{"name":"Invoice Ninja","primary_color":"0b4d78","secondary_color":"0b4d78","background_color":"f8f8f8","button_color":"33b753"}'),
|
||||||
|
'callback_uri' => route('payment_webhook', ['company_key' => $this->company->company_key, 'company_gateway_id' => $cg->hashed_id]),
|
||||||
|
'rbits' => $this->company->present()->rBits,
|
||||||
|
'country' => $data['country'],
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($data['country'] == 'CA') {
|
||||||
|
$account_details['currencies'] = ['CAD'];
|
||||||
|
$account_details['country_options'] = ['debit_opt_in' => boolval($data['debit_cards'])];
|
||||||
|
} elseif ($data['country'] == 'GB') {
|
||||||
|
$account_details['currencies'] = ['GBP'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$wepay_account = $wepay->request('account/create/', $account_details);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$wepay->request('user/send_confirmation/', []);
|
||||||
|
$confirmation_required = true;
|
||||||
|
} catch (\WePayException $ex) {
|
||||||
|
if ($ex->getMessage() == 'This access_token is already approved.') {
|
||||||
|
$confirmation_required = false;
|
||||||
|
} else {
|
||||||
|
throw $ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->saved = ctrans('texts.saved_at', ['time' => now()->toTimeString()]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,14 +40,13 @@ class PasswordProtection
|
|||||||
$timeout = auth()->user()->company()->default_password_timeout;
|
$timeout = auth()->user()->company()->default_password_timeout;
|
||||||
|
|
||||||
if($timeout == 0)
|
if($timeout == 0)
|
||||||
$timeout = null;
|
$timeout = 30*60*1000*1000;
|
||||||
else
|
else
|
||||||
$timeout = now()->addMinutes($timeout/60000);
|
$timeout = $timeout/1000;
|
||||||
|
|
||||||
if (Cache::get(auth()->user()->hashed_id.'_logged_in')) {
|
if (Cache::get(auth()->user()->hashed_id.'_logged_in')) {
|
||||||
|
|
||||||
Cache::pull(auth()->user()->hashed_id.'_logged_in');
|
Cache::put(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
||||||
Cache::add(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
||||||
@ -69,12 +68,12 @@ class PasswordProtection
|
|||||||
//If OAuth and user also has a password set - check both
|
//If OAuth and user also has a password set - check both
|
||||||
if ($existing_user = MultiDB::hasUser($query) && auth()->user()->has_password && Hash::check(auth()->user()->password, $request->header('X-API-PASSWORD'))) {
|
if ($existing_user = MultiDB::hasUser($query) && auth()->user()->has_password && Hash::check(auth()->user()->password, $request->header('X-API-PASSWORD'))) {
|
||||||
|
|
||||||
Cache::add(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
Cache::put(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
elseif($existing_user = MultiDB::hasUser($query) && !auth()->user()->has_password){
|
elseif($existing_user = MultiDB::hasUser($query) && !auth()->user()->has_password){
|
||||||
|
|
||||||
Cache::add(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
Cache::put(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,7 +83,7 @@ class PasswordProtection
|
|||||||
|
|
||||||
}elseif ($request->header('X-API-PASSWORD') && Hash::check($request->header('X-API-PASSWORD'), auth()->user()->password)) {
|
}elseif ($request->header('X-API-PASSWORD') && Hash::check($request->header('X-API-PASSWORD'), auth()->user()->password)) {
|
||||||
|
|
||||||
Cache::add(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
Cache::put(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class UpdateUserRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function authorize() : bool
|
public function authorize() : bool
|
||||||
{
|
{
|
||||||
return auth()->user()->id === $this->id || auth()->user()->isAdmin();
|
return auth()->user()->id == $this->user->id || auth()->user()->isAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rules()
|
public function rules()
|
||||||
|
@ -459,6 +459,19 @@ class Import implements ShouldQueue
|
|||||||
$user_repository = null;
|
$user_repository = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function checkUniqueConstraint($model, $column, $value)
|
||||||
|
{
|
||||||
|
$model_query = (new $model())
|
||||||
|
->query()
|
||||||
|
->where($column, $value)
|
||||||
|
->exists();
|
||||||
|
|
||||||
|
if($model_query)
|
||||||
|
return $value.'_'. Str::random(5);
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
@ -476,6 +489,7 @@ class Import implements ShouldQueue
|
|||||||
$modified['user_id'] = $this->processUserId($resource);
|
$modified['user_id'] = $this->processUserId($resource);
|
||||||
$modified['balance'] = $modified['balance'] ?: 0;
|
$modified['balance'] = $modified['balance'] ?: 0;
|
||||||
$modified['paid_to_date'] = $modified['paid_to_date'] ?: 0;
|
$modified['paid_to_date'] = $modified['paid_to_date'] ?: 0;
|
||||||
|
$modified['number'] = $this->checkUniqueConstraint(Client::class, 'number', $modified['number']);
|
||||||
|
|
||||||
unset($modified['id']);
|
unset($modified['id']);
|
||||||
unset($modified['contacts']);
|
unset($modified['contacts']);
|
||||||
@ -488,6 +502,14 @@ class Import implements ShouldQueue
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(array_key_exists('created_at', $modified))
|
||||||
|
$client->created_at = $modified['created_at'];
|
||||||
|
|
||||||
|
if(array_key_exists('updated_at', $modified))
|
||||||
|
$client->updated_at = $modified['updated_at'];
|
||||||
|
|
||||||
|
$client->save(['timestamps' => false]);
|
||||||
|
|
||||||
$client->contacts()->forceDelete();
|
$client->contacts()->forceDelete();
|
||||||
|
|
||||||
if (array_key_exists('contacts', $resource)) { // need to remove after importing new migration.json
|
if (array_key_exists('contacts', $resource)) { // need to remove after importing new migration.json
|
||||||
@ -891,6 +913,14 @@ class Import implements ShouldQueue
|
|||||||
QuoteFactory::create($this->company->id, $modified['user_id'])
|
QuoteFactory::create($this->company->id, $modified['user_id'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(array_key_exists('created_at', $modified))
|
||||||
|
$quote->created_at = $modified['created_at'];
|
||||||
|
|
||||||
|
if(array_key_exists('updated_at', $modified))
|
||||||
|
$quote->updated_at = $modified['updated_at'];
|
||||||
|
|
||||||
|
$quote->save(['timestamps' => false]);
|
||||||
|
|
||||||
$old_user_key = array_key_exists('user_id', $resource) ?? $this->user->id;
|
$old_user_key = array_key_exists('user_id', $resource) ?? $this->user->id;
|
||||||
|
|
||||||
$key = "quotes_{$resource['id']}";
|
$key = "quotes_{$resource['id']}";
|
||||||
@ -957,6 +987,14 @@ class Import implements ShouldQueue
|
|||||||
PaymentFactory::create($this->company->id, $modified['user_id'])
|
PaymentFactory::create($this->company->id, $modified['user_id'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(array_key_exists('created_at', $modified))
|
||||||
|
$payment->created_at = $modified['created_at'];
|
||||||
|
|
||||||
|
if(array_key_exists('updated_at', $modified))
|
||||||
|
$payment->updated_at = $modified['updated_at'];
|
||||||
|
|
||||||
|
$payment->save(['timestamps' => false]);
|
||||||
|
|
||||||
if (array_key_exists('company_gateway_id', $resource) && isset($resource['company_gateway_id']) && $resource['company_gateway_id'] != 'NULL') {
|
if (array_key_exists('company_gateway_id', $resource) && isset($resource['company_gateway_id']) && $resource['company_gateway_id'] != 'NULL') {
|
||||||
$payment->company_gateway_id = $this->transformId('company_gateways', $resource['company_gateway_id']);
|
$payment->company_gateway_id = $this->transformId('company_gateways', $resource['company_gateway_id']);
|
||||||
$payment->save();
|
$payment->save();
|
||||||
@ -1319,6 +1357,14 @@ class Import implements ShouldQueue
|
|||||||
|
|
||||||
$task = Task::Create($modified);
|
$task = Task::Create($modified);
|
||||||
|
|
||||||
|
if(array_key_exists('created_at', $modified))
|
||||||
|
$task->created_at = $modified['created_at'];
|
||||||
|
|
||||||
|
if(array_key_exists('updated_at', $modified))
|
||||||
|
$task->updated_at = $modified['updated_at'];
|
||||||
|
|
||||||
|
$task->save(['timestamps' => false]);
|
||||||
|
|
||||||
$old_user_key = array_key_exists('user_id', $resource) ?? $this->user->id;
|
$old_user_key = array_key_exists('user_id', $resource) ?? $this->user->id;
|
||||||
|
|
||||||
$this->ids['tasks'] = [
|
$this->ids['tasks'] = [
|
||||||
@ -1399,6 +1445,14 @@ class Import implements ShouldQueue
|
|||||||
|
|
||||||
$expense = Expense::Create($modified);
|
$expense = Expense::Create($modified);
|
||||||
|
|
||||||
|
if(array_key_exists('created_at', $modified))
|
||||||
|
$expense->created_at = $modified['created_at'];
|
||||||
|
|
||||||
|
if(array_key_exists('updated_at', $modified))
|
||||||
|
$expense->updated_at = $modified['updated_at'];
|
||||||
|
|
||||||
|
$expense->save(['timestamps' => false]);
|
||||||
|
|
||||||
$old_user_key = array_key_exists('user_id', $resource) ?? $this->user->id;
|
$old_user_key = array_key_exists('user_id', $resource) ?? $this->user->id;
|
||||||
|
|
||||||
$key = "expenses_{$resource['id']}";
|
$key = "expenses_{$resource['id']}";
|
||||||
|
@ -49,7 +49,7 @@ class VersionCheck implements ShouldQueue
|
|||||||
if(!$account)
|
if(!$account)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if($account->plan == 'white_label' && $account->plan_expires->lt(now())){
|
if($account->plan == 'white_label' && $account->plan_expires && $account->plan_expires->lt(now())){
|
||||||
$account->plan = null;
|
$account->plan = null;
|
||||||
$account->plan_expires = null;
|
$account->plan_expires = null;
|
||||||
$account->save();
|
$account->save();
|
||||||
|
@ -442,4 +442,24 @@ class Company extends BaseModel
|
|||||||
{
|
{
|
||||||
return $this->slack_webhook_url;
|
return $this->slack_webhook_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function rBits()
|
||||||
|
{
|
||||||
|
$account = $this->account;
|
||||||
|
$user = $this->owner();
|
||||||
|
$data = [];
|
||||||
|
|
||||||
|
$data[] = $this->createRBit('business_name', 'user', ['business_name' => $this->present()->name()]);
|
||||||
|
$data[] = $this->createRBit('industry_code', 'user', ['industry_detail' => $this->industry->name]);
|
||||||
|
$data[] = $this->createRBit('comment', 'partner_database', ['comment_text' => 'Logo image not present']);
|
||||||
|
$data[] = $this->createRBit('business_description', 'user', ['business_description' => $company->present()->size()]);
|
||||||
|
|
||||||
|
$data[] = $this->createRBit('person', 'user', ['name' => $user->present()->getFullName()]);
|
||||||
|
$data[] = $this->createRBit('email', 'user', ['email' => $user->email]);
|
||||||
|
$data[] = $this->createRBit('phone', 'user', ['phone' => $user->phone]);
|
||||||
|
$data[] = $this->createRBit('website_uri', 'user', ['uri' => $this->entity->settings->website]);
|
||||||
|
$data[] = $this->createRBit('external_account', 'partner_database', ['is_partner_account' => 'yes', 'account_type' => 'Invoice Ninja', 'create_time' => time()]);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,4 +106,8 @@ class CompanyPresenter extends EntityPresenter
|
|||||||
"SPC\n0200\n1\n{$user_iban}\nK\n{$this->name}\n{$settings->address1}\n{$settings->postal_code} {$settings->city}\n\n\nCH\n\n\n\n\n\n\n\n{$balance_due_raw}\n{$client_currency}\n\n\n\n\n\n\n\nNON\n\n{$invoice_number}\nEPD\n";
|
"SPC\n0200\n1\n{$user_iban}\nK\n{$this->name}\n{$settings->address1}\n{$settings->postal_code} {$settings->city}\n\n\nCH\n\n\n\n\n\n\n\n{$balance_due_raw}\n{$client_currency}\n\n\n\n\n\n\n\nNON\n\n{$invoice_number}\nEPD\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function size()
|
||||||
|
{
|
||||||
|
return $this->entity->size ? $this->entity->size->name : '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,4 +26,28 @@ class UserPresenter extends EntityPresenter
|
|||||||
|
|
||||||
return $first_name.' '.$last_name;
|
return $first_name.' '.$last_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getDisplayName()
|
||||||
|
{
|
||||||
|
if ($this->getFullName()) {
|
||||||
|
return $this->getFullName();
|
||||||
|
} elseif ($this->entity->email) {
|
||||||
|
return $this->entity->email;
|
||||||
|
} else {
|
||||||
|
return ctrans('texts.guest');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getFullName()
|
||||||
|
{
|
||||||
|
if ($this->entity->first_name || $this->entity->last_name) {
|
||||||
|
return $this->entity->first_name.' '.$this->entity->last_name;
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,8 @@ class WePayPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
$this->wepay = new WePay(null);
|
$this->wepay = new WePay(null);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setup(array $data)
|
public function setup(array $data)
|
||||||
|
@ -71,7 +71,14 @@ class InvoiceMigrationRepository extends BaseRepository
|
|||||||
|
|
||||||
$model->fill($tmp_data);
|
$model->fill($tmp_data);
|
||||||
$model->status_id = $tmp_data['status_id'];
|
$model->status_id = $tmp_data['status_id'];
|
||||||
$model->save();
|
|
||||||
|
if(array_key_exists('created_at', $data))
|
||||||
|
$model->created_at = $data['created_at'];
|
||||||
|
|
||||||
|
if(array_key_exists('updated_at', $data))
|
||||||
|
$model->updated_at = $data['updated_at'];
|
||||||
|
|
||||||
|
$model->save(['timestamps' => false]);
|
||||||
|
|
||||||
if (array_key_exists('documents', $data)) {
|
if (array_key_exists('documents', $data)) {
|
||||||
$this->saveDocuments($data['documents'], $model);
|
$this->saveDocuments($data['documents'], $model);
|
||||||
|
@ -154,7 +154,7 @@ class HtmlEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data['$portal_url'] = ['value' => $this->invitation->getPortalLink(), 'label' =>''];
|
$data['$portal_url'] = ['value' => $this->invitation->getPortalLink(), 'label' =>''];
|
||||||
|
|
||||||
$data['$entity_number'] = &$data['$number'];
|
$data['$entity_number'] = &$data['$number'];
|
||||||
$data['$invoice.discount'] = ['value' => Number::formatMoney($this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.discount')];
|
$data['$invoice.discount'] = ['value' => Number::formatMoney($this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.discount')];
|
||||||
$data['$discount'] = &$data['$invoice.discount'];
|
$data['$discount'] = &$data['$invoice.discount'];
|
||||||
@ -238,7 +238,7 @@ class HtmlEngine
|
|||||||
$data['$vat_number'] = ['value' => $this->client->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
|
$data['$vat_number'] = ['value' => $this->client->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
|
||||||
$data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')];
|
$data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')];
|
||||||
$data['$phone'] = ['value' => $this->client->present()->phone() ?: ' ', 'label' => ctrans('texts.phone')];
|
$data['$phone'] = ['value' => $this->client->present()->phone() ?: ' ', 'label' => ctrans('texts.phone')];
|
||||||
$data['$country'] = ['value' => isset($this->client->country->name) ? $this->client->country->name : '', 'label' => ctrans('texts.country')];
|
$data['$country'] = ['value' => isset($this->client->country->name) ? ctrans('texts.country_' . $this->client->country->name) : '', 'label' => ctrans('texts.country')];
|
||||||
$data['$email'] = ['value' => isset($this->contact) ? $this->contact->email : 'no contact email on record', 'label' => ctrans('texts.email')];
|
$data['$email'] = ['value' => isset($this->contact) ? $this->contact->email : 'no contact email on record', 'label' => ctrans('texts.email')];
|
||||||
$data['$client_name'] = ['value' => $this->entity->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
|
$data['$client_name'] = ['value' => $this->entity->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
|
||||||
$data['$client.name'] = &$data['$client_name'];
|
$data['$client.name'] = &$data['$client_name'];
|
||||||
|
@ -62,7 +62,7 @@ class PaymentLibrariesSeeder extends Seeder
|
|||||||
['id' => 36, 'name' => 'AGMS', 'provider' => 'Agms', 'key' => '1b3c6f3ccfea4f5e7eadeae188cccd7f', 'fields' => '{"username":"","password":"","apiKey":"","accountNumber":""}'],
|
['id' => 36, 'name' => 'AGMS', 'provider' => 'Agms', 'key' => '1b3c6f3ccfea4f5e7eadeae188cccd7f', 'fields' => '{"username":"","password":"","apiKey":"","accountNumber":""}'],
|
||||||
['id' => 37, 'name' => 'Barclays', 'provider' => 'BarclaysEpdq\Essential', 'key' => '7cba6ce5c125f9cb47ea8443ae671b68', 'fields' => '{"clientId":"","testMode":false,"language":"en_US","callbackMethod":"POST"}'],
|
['id' => 37, 'name' => 'Barclays', 'provider' => 'BarclaysEpdq\Essential', 'key' => '7cba6ce5c125f9cb47ea8443ae671b68', 'fields' => '{"clientId":"","testMode":false,"language":"en_US","callbackMethod":"POST"}'],
|
||||||
['id' => 38, 'name' => 'Cardgate', 'provider' => 'Cardgate', 'key' => 'b98cfa5f750e16cee3524b7b7e78fbf6', 'fields' => '{"merchantId":"","language":"nl","apiKey":"","siteId":"","notifyUrl":"","returnUrl":"","cancelUrl":"","testMode":false}'],
|
['id' => 38, 'name' => 'Cardgate', 'provider' => 'Cardgate', 'key' => 'b98cfa5f750e16cee3524b7b7e78fbf6', 'fields' => '{"merchantId":"","language":"nl","apiKey":"","siteId":"","notifyUrl":"","returnUrl":"","cancelUrl":"","testMode":false}'],
|
||||||
['id' => 39, 'name' => 'Checkout.com', 'provider' => 'CheckoutCom', 'key' => '3758e7f7c6f4cecf0f4f348b9a00f456', 'fields' => '{"secretApiKey":"","publicApiKey":"","testMode":false,"threeds:false"}'],
|
['id' => 39, 'name' => 'Checkout.com', 'provider' => 'CheckoutCom', 'key' => '3758e7f7c6f4cecf0f4f348b9a00f456', 'fields' => '{"secretApiKey":"","publicApiKey":"","testMode":false,"threeds":false}'],
|
||||||
['id' => 40, 'name' => 'Creditcall', 'provider' => 'Creditcall', 'key' => 'cbc7ef7c99d31ec05492fbcb37208263', 'fields' => '{"terminalId":"","transactionKey":"","testMode":false,"verifyCvv":true,"verifyAddress":false,"verifyZip":false}'],
|
['id' => 40, 'name' => 'Creditcall', 'provider' => 'Creditcall', 'key' => 'cbc7ef7c99d31ec05492fbcb37208263', 'fields' => '{"terminalId":"","transactionKey":"","testMode":false,"verifyCvv":true,"verifyAddress":false,"verifyZip":false}'],
|
||||||
['id' => 41, 'name' => 'Cybersource', 'provider' => 'Cybersource', 'key' => 'e186a98d3b079028a73390bdc11bdb82', 'fields' => '{"profileId":"","secretKey":"","accessKey":"","testMode":false}'],
|
['id' => 41, 'name' => 'Cybersource', 'provider' => 'Cybersource', 'key' => 'e186a98d3b079028a73390bdc11bdb82', 'fields' => '{"profileId":"","secretKey":"","accessKey":"","testMode":false}'],
|
||||||
['id' => 42, 'name' => 'ecoPayz', 'provider' => 'Ecopayz', 'key' => '761040aca40f685d1ab55e2084b30670', 'fields' => '{"merchantId":"","merchantPassword":"","merchantAccountNumber":"","testMode":false}'],
|
['id' => 42, 'name' => 'ecoPayz', 'provider' => 'Ecopayz', 'key' => '761040aca40f685d1ab55e2084b30670', 'fields' => '{"merchantId":"","merchantPassword":"","merchantAccountNumber":"","testMode":false}'],
|
||||||
|
@ -5037,6 +5037,7 @@ pedantic
|
|||||||
platform
|
platform
|
||||||
process
|
process
|
||||||
stream_transform
|
stream_transform
|
||||||
|
sync_http
|
||||||
term_glyph
|
term_glyph
|
||||||
|
|
||||||
Copyright 2017, the Dart project authors. All rights reserved.
|
Copyright 2017, the Dart project authors. All rights reserved.
|
||||||
@ -5420,6 +5421,7 @@ charts_flutter
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
clock
|
clock
|
||||||
coverage
|
coverage
|
||||||
|
fake_async
|
||||||
quiver
|
quiver
|
||||||
|
|
||||||
|
|
||||||
@ -7161,6 +7163,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
flutter_styled_toast
|
flutter_styled_toast
|
||||||
|
webdriver
|
||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
|
4
public/flutter_service_worker.js
vendored
4
public/flutter_service_worker.js
vendored
@ -9,8 +9,8 @@ const RESOURCES = {
|
|||||||
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
|
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
|
||||||
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35",
|
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35",
|
||||||
"manifest.json": "ce1b79950eb917ea619a0a30da27c6a3",
|
"manifest.json": "ce1b79950eb917ea619a0a30da27c6a3",
|
||||||
"main.dart.js": "1611483da0db927703a9fdff4a860b7f",
|
"main.dart.js": "ebae742cbdb100acc50ff9790d1c3496",
|
||||||
"assets/NOTICES": "dcba058006722202a4906fb433998480",
|
"assets/NOTICES": "687b68d41e137cfbdee105c0b9be3e9d",
|
||||||
"assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac",
|
"assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac",
|
||||||
"assets/AssetManifest.json": "659dcf9d1baf3aed3ab1b9c42112bf8f",
|
"assets/AssetManifest.json": "659dcf9d1baf3aed3ab1b9c42112bf8f",
|
||||||
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "174c02fc4609e8fc4389f5d21f16a296",
|
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "174c02fc4609e8fc4389f5d21f16a296",
|
||||||
|
206344
public/main.dart.js
vendored
206344
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
203876
public/main.foss.dart.js
vendored
203876
public/main.foss.dart.js
vendored
File diff suppressed because one or more lines are too long
16
public/main.foss.dart.js.map
Normal file
16
public/main.foss.dart.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@
|
|||||||
@section('meta_title', ctrans('texts.sign_up_with_wepay'))
|
@section('meta_title', ctrans('texts.sign_up_with_wepay'))
|
||||||
|
|
||||||
@section('body')
|
@section('body')
|
||||||
|
<div class="bg-gray-50">
|
||||||
|
|
||||||
<div class="flex flex-col justify-center items-center mt-10">
|
<div class="flex flex-col justify-center items-center mt-10">
|
||||||
<img src="{{ asset('images/wepay.svg') }}" alt="We Pay">
|
<img src="{{ asset('images/wepay.svg') }}" alt="We Pay">
|
||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
@livewire('wepay-signup', ['user_id' => $user_id, 'company_key' => $company_key])
|
@livewire('wepay-signup', ['user_id' => $user_id, 'company_key' => $company_key])
|
||||||
|
|
||||||
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@push('footer')
|
@push('footer')
|
||||||
|
@ -50,17 +50,17 @@
|
|||||||
<label for="country" class="input-label">@lang('texts.country')</label>
|
<label for="country" class="input-label">@lang('texts.country')</label>
|
||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<input class="form-radio mr-2" type="radio" value="US" name="country" checked>
|
<input class="form-radio mr-2" type="radio" value="US" name="country" checked wire:model="country">
|
||||||
<span>{{ ctrans('texts.country_United States') }}</span>
|
<span>{{ ctrans('texts.country_United States') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<input class="form-radio mr-2" type="radio" value="CA" name="country">
|
<input class="form-radio mr-2" type="radio" value="CA" name="country" wire:model="country">
|
||||||
<span>{{ ctrans('texts.country_Canada') }}</span>
|
<span>{{ ctrans('texts.country_Canada') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<input class="form-radio mr-2" type="radio" value="GB" name="country">
|
<input class="form-radio mr-2" type="radio" value="GB" name="country" wire:model="country">
|
||||||
<span>{{ ctrans('texts.country_United Kingdom') }}</span>
|
<span>{{ ctrans('texts.country_United Kingdom') }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -69,7 +69,7 @@
|
|||||||
<div class="col-span-6 sm:col-span-4">
|
<div class="col-span-6 sm:col-span-4">
|
||||||
<label for="country" class="input-label">@lang('texts.ach')</label>
|
<label for="country" class="input-label">@lang('texts.ach')</label>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<input class="switch-input" type="checkbox" name="ach">
|
<input class="switch-input" type="checkbox" name="ach" value="1" wire:model="ach">
|
||||||
<span>{{ ctrans('texts.enable_ach')}}</span>
|
<span>{{ ctrans('texts.enable_ach')}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -77,9 +77,14 @@
|
|||||||
<div class="col-span-6 sm:col-span-4">
|
<div class="col-span-6 sm:col-span-4">
|
||||||
<label for="country" class="input-label"></label>
|
<label for="country" class="input-label"></label>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<input class="switch-input" type="checkbox" name="wepay_payment_tos_agree">
|
<input type="checkbox" name="wepay_payment_tos_agree" value="1" wire:model="wepay_payment_tos_agree">
|
||||||
<span>{!! ctrans('texts.wepay_payment_tos_agree', ['terms' => $terms, 'privacy_policy' => $privacy_policy]) !!}</span>
|
<span>{!! ctrans('texts.wepay_payment_tos_agree', ['terms' => $terms, 'privacy_policy' => $privacy_policy]) !!}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@error('wepay_payment_tos_agree')
|
||||||
|
<div class="validation validation-fail">
|
||||||
|
{{ $message }}
|
||||||
|
</div>
|
||||||
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-span-6 sm:col-span-4">
|
<div class="col-span-6 sm:col-span-4">
|
||||||
|
@ -199,8 +199,7 @@ Route::get('webcron', 'WebCronController@index');
|
|||||||
Route::group(['middleware' => ['locale']], function () {
|
Route::group(['middleware' => ['locale']], function () {
|
||||||
Route::get('stripe_connect/{token}', 'StripeConnectController@initialize')->name('stripe_connect.initialization');
|
Route::get('stripe_connect/{token}', 'StripeConnectController@initialize')->name('stripe_connect.initialization');
|
||||||
Route::get('stripe_connect/completed', 'StripeConnectController@completed')->name('stripe_connect.return');
|
Route::get('stripe_connect/completed', 'StripeConnectController@completed')->name('stripe_connect.return');
|
||||||
Route::get('wepay/signup/{token}', 'WePayController@signup')->name('wepay.signup');
|
|
||||||
Route::post('wepay/processSignup', 'WePayController@processSignup')->name('wepay.process_signup');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::fallback('BaseController@notFound');
|
Route::fallback('BaseController@notFound');
|
||||||
|
@ -20,6 +20,9 @@ Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail'
|
|||||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
|
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
|
||||||
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
|
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
|
||||||
|
|
||||||
|
Route::get('wepay/signup/{token}', 'WePayController@signup')->name('wepay.signup');
|
||||||
|
Route::get('wepay/processSignup', 'WePayController@processSignup')->name('wepay.process_signup');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Social authentication
|
* Social authentication
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user