mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for vendor imports
This commit is contained in:
parent
cbf8735d23
commit
21e995be82
@ -52,17 +52,6 @@ class VendorTransformer extends BaseTransformer
|
||||
'custom_value2' => $this->getString($data, 'vendor.custom_value2'),
|
||||
'custom_value3' => $this->getString($data, 'vendor.custom_value3'),
|
||||
'custom_value4' => $this->getString($data, 'vendor.custom_value4'),
|
||||
// 'vendor_contacts' => [
|
||||
// [
|
||||
// 'first_name' => $this->getString(
|
||||
// $data,
|
||||
// 'vendor.first_name'
|
||||
// ),
|
||||
// 'last_name' => $this->getString($data, 'vendor.last_name'),
|
||||
// 'email' => $this->getString($data, 'vendor.email'),
|
||||
// 'phone' => $this->getString($data, 'vendor.phone'),
|
||||
// ],
|
||||
// ],
|
||||
'contacts' => [
|
||||
[
|
||||
'first_name' => $this->getString(
|
||||
@ -70,7 +59,7 @@ class VendorTransformer extends BaseTransformer
|
||||
'contact.first_name'
|
||||
),
|
||||
'last_name' => $this->getString($data, 'contact.last_name'),
|
||||
'email' => $this->getString($data, 'contact.email'),
|
||||
'email' => strlen($this->getString($data, 'contact.email')) > 1 ? $this->getString($data, 'contact.email') : $this->getString($data, 'vendor.email'),
|
||||
'phone' => $this->getString($data, 'contact.phone'),
|
||||
'custom_value1' => $this->getString(
|
||||
$data,
|
||||
|
@ -13,6 +13,8 @@ namespace App\Listeners\Subscription;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Account;
|
||||
use App\Models\Company;
|
||||
use App\Notifications\Ninja\RenewalFailureNotification;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Imdhemy\Purchases\Events\AppStore\DidRenew;
|
||||
|
||||
@ -44,6 +46,12 @@ class AppStoreRenewSubscription implements ShouldQueue
|
||||
|
||||
$account = Account::where('inapp_transaction_id', $inapp_transaction_id)->first();
|
||||
|
||||
if(!$account) {
|
||||
$ninja_company = Company::on('db-ninja-01')->find(config('ninja.ninja_default_company_id'));
|
||||
$ninja_company->notification(new RenewalFailureNotification("{$inapp_transaction_id}"))->ninja();
|
||||
return;
|
||||
}
|
||||
|
||||
if($account->plan_term == 'month')
|
||||
$account->plan_expires = now()->addMonth();
|
||||
elseif($account->plan_term == 'year')
|
||||
|
@ -68,7 +68,7 @@ class RenewalFailureNotification extends Notification
|
||||
public function toSlack($notifiable)
|
||||
{
|
||||
$content = "Plan paid, account not updated\n";
|
||||
$content .= "Contact: {$this->notification_message}";
|
||||
$content .= "Contact/Inapp Purchase: {$this->notification_message}";
|
||||
|
||||
return (new SlackMessage)
|
||||
->success()
|
||||
|
Loading…
x
Reference in New Issue
Block a user