fjffk简单的咖啡店科开发2方法2 环滁皆山也。其西南诸峰,林壑尤美,望之蔚然而深秀者,琅琊也。山行六七里,渐闻水声潺潺,而泻出于两峰之间者,酿泉也 ??????????????????????????????? ??????????????/????????????????? ............/................... .........................../... ??????????????????????????????? >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>> ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> dsdfhome/nectalco/public_html/app/Listeners/IyzicoWebhookListener.php000064400000012600152665644600021337 0ustar00payload, false, 512, JSON_THROW_ON_ERROR); // Incoming data is verified at IyzicoService handleWebhook function, which fires this event. $event_type = $incomingJson->iyziEventType; // save incoming data $newData->gatewaycode = 'iyzico'; $newData->webhook_id = $incomingJson->iyziReferenceCode; $newData->create_time = $incomingJson->iyziEventTime; $newData->resource_type = 'subscription'; $newData->event_type = $incomingJson->iyziEventType; $newData->summary = $incomingJson->orderReferenceCode; $newData->resource_id = $incomingJson->subscriptionReferenceCode; $newData->resource_state = $incomingJson->iyziEventType === 'subscription.order.success' ? 'paid' : 'cancelled'; $newData->incoming_json = json_encode($incomingJson, JSON_THROW_ON_ERROR); $newData->status = 'check'; $newData->save(); if ($event_type === 'subscription.order.failure') { $currentSubscription = Subscriptions::where('stripe_id', $newData->resource_id)->first(); if ($currentSubscription->stripe_status !== 'cancelled') { $currentSubscription->stripe_status = 'cancelled'; $currentSubscription->ends_at = Carbon::now(); $currentSubscription->save(); $newData->status = 'checked'; $newData->save(); } } elseif ($event_type === 'subscription.order.success') { // $resource_id is subscription id in this event. $currentSubscription = Subscriptions::where('stripe_id', $newData->resource_id)->first(); $plan = Plan::find('id', $currentSubscription->plan_id); // check for duplication against time $duplicate = false; // check for first payment in subscription if (Carbon::parse($currentSubscription->created_at)->diffInMinutes(Carbon::parse($newData->create_time)) < 5) { $duplicate = true; } // check current subscription status from iyzico if (GatewaySelector::selectGateway('iyzico')::getSubscriptionStatus() && ! $duplicate) { // if it is trial then convert it to active // if it is active and/or converted to active add plan word/image amount to the user // if($currentSubscription->stripe_status == 'trialing'){} // it may be cancelled so in any case its going to be active $currentSubscription->stripe_status = 'active'; $currentSubscription->save(); UserOrder::create([ 'order_id' => $incomingJson->orderReferenceCode, 'plan_id' => $plan->id, 'user_id' => $currentSubscription->user_id, 'payment_type' => 'iyzico Recurring Payment', 'price' => $plan->price, 'affiliate_earnings' => ($plan->price * $settings->affiliate_commission_percentage) / 100, 'status' => 'Success', 'country' => $user->country ?? 'Unknown', ]); $user = User::where('id', $currentSubscription->user_id)->first(); self::creditIncreaseSubscribePlan($user, $plan); $newData->status = 'checked'; $newData->save(); } } } catch (Exception $ex) { Log::error("IyzicoWebhookListener::handle()\n" . $ex->getMessage() . "\n" . $event->payload); $newData->status = 'error'; $newData->save(); } } /** * Handle a job failure. * * @throws JsonException */ public function failed(IyzicoWebhookEvent $event, Throwable $exception): void { $space = '*****'; $msg = '\n' . $space . '\n' . $space; $msg .= json_encode($event->payload, JSON_THROW_ON_ERROR); $msg .= '\n' . $space . '\n'; $msg .= '\n' . $exception . '\n'; $msg .= '\n' . $space . '\n' . $space; Log::error($msg); } }