changes
This commit is contained in:
@@ -155,7 +155,7 @@ class StripeWebhookController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$subscriptionProductData = SubscriptionProducts::with('product')->where('id', $subscriptionProductId)->first();
|
||||
$subscriptionProductData = SubscriptionProducts::where('id', $subscriptionProductId)->first();
|
||||
|
||||
//checkout store in db
|
||||
$subscriptionData = $stripe->checkout->sessions->retrieve($session->id, []);
|
||||
@@ -258,11 +258,11 @@ class StripeWebhookController extends Controller
|
||||
Log::info("Created entry in Referral User table");
|
||||
|
||||
}
|
||||
Log::info($subscriptionData);
|
||||
|
||||
$getUserData = IamPrincipal::where('id', $userId)->first();
|
||||
|
||||
$title = "Congratulations your subscription is now active";
|
||||
$message = $getUserData->first_name . " has subscribed for " . $subscriptionProductData->name;
|
||||
$message = $getUserData->first_name . " has subscribed for " . $subscriptionProductData->product_name;
|
||||
$content_type = "new_subscription";
|
||||
|
||||
onesignalhelper::sendNotificationApi($getUserData->one_signal_player_id, $title, $message, $content_type, $image = null, $id = null);
|
||||
@@ -291,7 +291,7 @@ class StripeWebhookController extends Controller
|
||||
|
||||
//
|
||||
$productID = $invoice->lines->data[0]->price->product;
|
||||
$subscriptionProductData = SubscriptionProducts::with('product')->where('stripe_product_id', $productID)->first();
|
||||
$subscriptionProductData = SubscriptionProducts::where('stripe_product_id', $productID)->first();
|
||||
|
||||
$customerID = $invoice->customer;
|
||||
|
||||
@@ -321,10 +321,9 @@ class StripeWebhookController extends Controller
|
||||
$iamPrincialData = IamPrincipal::where('id', $subscriptionInDatabase->iam_principal_xid)->first();
|
||||
|
||||
|
||||
Log::info($subscriptionData);
|
||||
|
||||
$title = "Congratulations your Subscription has been Renewed";
|
||||
$message = $iamPrincialData->first_name . " has subscribed for " . $subscriptionProductData->name;
|
||||
$message = $iamPrincialData->first_name . " has subscribed for " . $subscriptionProductData->product_name;
|
||||
$content_type = "recurring_subscription";
|
||||
|
||||
onesignalhelper::sendNotificationApi($iamPrincialData->one_signal_player_id, $title, $message, $content_type, $image = null, $id = null);
|
||||
|
||||
@@ -28,8 +28,4 @@ class SubscriptionProducts extends Model
|
||||
];
|
||||
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(SubscriptionProducts::class, 'subscription_product_xid', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user