PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Framework
/
Payment
/
Stripe
<?php namespace WilokeListingTools\Framework\Payment\Stripe; use WilokeListingTools\Controllers\Retrieve\NormalRetrieve; use WilokeListingTools\Controllers\RetrieveController; use WilokeListingTools\Framework\Payment\StripePayment; final class StripeUpdatePlan extends StripePayment { /** * @var String $planID This is post type slug */ private $planID; private $oPlan; private $aArgs; private $oRetrieve; public function __construct($planID) { $this->planID = $planID; $this->oRetrieve = new RetrieveController(new NormalRetrieve()); } public function setUpdateTrialDays($days) { if (empty($days)) { $this->aArgs['trial_period_days'] = null; } else { $this->aArgs['trial_period_days'] = abs($days); } return $this; } public function getPlan() { $aStatus = $this->setApiContext(); if ($aStatus['status'] == 'error') { return $this->oRetrieve->error([ 'msg' => 'This plan does not exist' ]); } try { $this->oPlan = \Stripe\Plan::retrieve($this->planID); return $this->oRetrieve->success([]); } catch (\Exception $oException) { return $this->oRetrieve->error([ 'msg' => $oException->getMessage() ]); } } public function hasPlan() { $aStatus = $this->getPlan(); return ($aStatus['status'] == 'success'); } public function getArgs() { return $this->aArgs; } public function updatePlan() { try { \Stripe\Plan::update( $this->planID, $this->aArgs ); return $this->oRetrieve->success([ 'msg' => sprintf('The plan %s has been updated', $this->planID) ]); } catch (\Exception $oException) { return $this->oRetrieve->error([ 'msg' => $oException->getMessage() ]); } } }
[+]
..
[-] StripeChangePlan.php
[edit]
[-] StripeNonRecurringCreatedPaymentHook.php
[edit]
[-] StripeUpdatePlan.php
[edit]
[-] StripeRecurringCreatedPaymentHook.php
[edit]
[-] WebhookLog.php
[edit]
[-] StripeRecurringPrepareInvoiceFormat.php
[edit]
[-] StripeSuspendPlan.php
[edit]
[-] StripeWebhook.php
[edit]
[-] StripeNonRecurringIPreparenvoiceFormat.php
[edit]
[-] StripeProceededNonRecurringPaymentHook.php
[edit]
[-] StripeSCARecurringPaymentMethod.php
[edit]
[-] StripeConfiguration.php
[edit]
[-] StripeCancelRecurringPayment.php
[edit]
[-] StripeRefundNonRecurringPayment.php
[edit]
[-] Webhook.php
[edit]
[-] StripeTax.php
[edit]
[-] StripeWebhookInterface.php
[edit]
[-] StripeRecurringPaymentMethod.php
[edit]
[-] StripeProceededRecurringPayment.php
[edit]
[-] StripeSCANonRecurringPaymentMethod.php
[edit]
[-] StripeNonRecurringPaymentMethod.php
[edit]