mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Minor fixes for subscription URL spec
This commit is contained in:
parent
64410d18ce
commit
2fbe1698ae
@ -370,7 +370,7 @@ class CompanyExport implements ShouldQueue
|
|||||||
|
|
||||||
})->makeHidden(['id'])->toArray();
|
})->makeHidden(['id'])->toArray();
|
||||||
|
|
||||||
$this->export_data['users'] = $this->company->users->map(function ($user){
|
$this->export_data['users'] = $this->company->users()->withTrashed()->cursor()->map(function ($user){
|
||||||
|
|
||||||
$user->account_id = $this->encodePrimaryKey($user->account_id);
|
$user->account_id = $this->encodePrimaryKey($user->account_id);
|
||||||
$user->id = $this->encodePrimaryKey($user->id);
|
$user->id = $this->encodePrimaryKey($user->id);
|
||||||
|
@ -60,7 +60,7 @@ class SubscriptionTransformer extends EntityTransformer
|
|||||||
'allow_plan_changes' => (bool)$subscription->allow_plan_changes,
|
'allow_plan_changes' => (bool)$subscription->allow_plan_changes,
|
||||||
'refund_period' => (int)$subscription->refund_period,
|
'refund_period' => (int)$subscription->refund_period,
|
||||||
'webhook_configuration' => $subscription->webhook_configuration ?: [],
|
'webhook_configuration' => $subscription->webhook_configuration ?: [],
|
||||||
'purchase_page' => (string)$company->domain() . "/client/subscription/{$subscription->hashed_id}/purchase",
|
'purchase_page' => (string)$company->domain() . "/client/subscriptions/{$subscription->hashed_id}/purchase",
|
||||||
//'purchase_page' => (string)route('client.subscription.purchase', $subscription->hashed_id),
|
//'purchase_page' => (string)route('client.subscription.purchase', $subscription->hashed_id),
|
||||||
'currency_id' => (string) $subscription->currency_id,
|
'currency_id' => (string) $subscription->currency_id,
|
||||||
'is_deleted' => (bool)$subscription->is_deleted,
|
'is_deleted' => (bool)$subscription->is_deleted,
|
||||||
|
@ -80,7 +80,7 @@ Route::group(['middleware' => ['auth:contact', 'locale', 'check_client_existence
|
|||||||
Route::get('logout', 'Auth\ContactLoginController@logout')->name('logout');
|
Route::get('logout', 'Auth\ContactLoginController@logout')->name('logout');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('client/subscription/{subscription}/purchase', 'ClientPortal\SubscriptionPurchaseController@index')->name('client.subscription.purchase')->middleware('domain_db');
|
Route::get('client/subscriptions/{subscription}/purchase', 'ClientPortal\SubscriptionPurchaseController@index')->name('client.subscription.purchase')->middleware('domain_db');
|
||||||
|
|
||||||
Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'client.'], function () {
|
Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'client.'], function () {
|
||||||
/*Invitation catches*/
|
/*Invitation catches*/
|
||||||
|
@ -16,6 +16,7 @@ use App\Models\Expense;
|
|||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
|
use App\Models\User;
|
||||||
use App\Models\Vendor;
|
use App\Models\Vendor;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Routing\Middleware\ThrottleRequests;
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
||||||
@ -63,23 +64,28 @@ class ImportCompanyTest extends TestCase
|
|||||||
$this->assertTrue(property_exists($backup_json_file, 'app_version'));
|
$this->assertTrue(property_exists($backup_json_file, 'app_version'));
|
||||||
$this->assertTrue(property_exists($backup_json_file, 'users'));
|
$this->assertTrue(property_exists($backup_json_file, 'users'));
|
||||||
|
|
||||||
// User::unguard();
|
User::unguard();
|
||||||
|
|
||||||
// foreach ($this->backup_file->users as $user)
|
foreach ($backup_json_file->users as $user)
|
||||||
// {
|
{
|
||||||
|
|
||||||
// $new_user = User::firstOrNew(
|
$new_user = User::firstOrNew(
|
||||||
// ['email' => $user->email],
|
['email' => $user->email],
|
||||||
// (array)$user,
|
(array)$user,
|
||||||
// );
|
);
|
||||||
|
|
||||||
// $new_user->account_id = $this->account->id;
|
$new_user->account_id = $this->account->id;
|
||||||
// $new_user->save(['timestamps' => false]);
|
$new_user->save(['timestamps' => false]);
|
||||||
|
|
||||||
// $this->ids['users']["{$user->id}"] = $new_user->id;
|
nlog($new_user->toArray());
|
||||||
// }
|
|
||||||
|
|
||||||
// User::reguard();
|
$this->ids['users']["{$user->id}"] = $new_user->id;
|
||||||
|
|
||||||
|
nlog($this->ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
User::reguard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user