PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Framework
/
Payment
/
PayPal
<?php namespace WilokeListingTools\Framework\Payment\PayPal; use PayPal\Api\Agreement; use PayPal\Api\AgreementStateDescriptor; use WilokeListingTools\Framework\Payment\PayPalPayment; use WilokeListingTools\Framework\Payment\SuspendInterface; use WilokeListingTools\Models\PaymentMetaModel; use WilokeListingTools\Models\PaymentModel; final class PayPalSuspendPlan extends PayPalPayment { private $description; private $agreementID; public function __construct($paymentID) { $this->paymentID = $paymentID; } public function suspend() { $this->setup(); $this->suspendDescrition = esc_html__('Suspended the Agreement', 'wiloke-listing-tools'); $status = PaymentModel::getField('status', $this->paymentID); $this->description = esc_html__('Suspended the Agreement', 'wiloke-listing-tools'); if ($status !== 'active') { return [ 'status' => 'success' ]; } $this->agreementID = PaymentMetaModel::getSubscriptionID($this->paymentID); if (empty($this->agreementID)) { return [ 'status' => 'success' ]; } $agreementStateDescriptor = new AgreementStateDescriptor(); $agreementStateDescriptor->setNote($this->description); $createdAgreement = null; $oAgreementInfo = Agreement::get($this->agreementID, $this->oApiContext); try { $oAgreementInfo->suspend($agreementStateDescriptor, $this->oApiContext); $this->oNewAgreement = Agreement::get($this->agreementID, $this->oApiContext); PaymentModel::updatePaymentStatus('suspended', $this->paymentID); return [ 'status' => 'success' ]; } catch (\Exception $oE) { return [ 'status' => 'error', 'msg' => $oE->getMessage() ]; } } }
[+]
..
[-] PayPalConfiguration.php
[edit]
[-] PayPalRefundNonRecurringPayment.php
[edit]
[-] Webhook.php
[edit]
[-] PayPalRecurringPaymentMethod.php
[edit]
[-] PayPalExecuteRecurringPayment.php
[edit]
[-] PayPalProceededRecurringPaymentHook.php
[edit]
[-] PayPalCancelPlan.php
[edit]
[-] PayPalHelps.php
[edit]
[-] PayPalWebhook.php
[edit]
[-] PayPalGetBillingAgreement.php
[edit]
[-] PayPalAuthentication.php
[edit]
[-] PayPalSuspendPlan.php
[edit]
[-] PayPalValidations.php
[edit]
[-] cert_key.pem
[edit]
[-] PayPalExecuteInterface.php
[edit]
[-] PayPalRecurringPrepareInvoiceFormat.php
[edit]
[-] ConvertPayPalStatusToWilokeStatus.php
[edit]
[-] PayPalChangePlan.php
[edit]
[-] PayPalSetupAPIContext.php
[edit]
[-] PayPalNonRecurringPrepareInvoiceFormat.php
[edit]
[-] PayPalNonRecurringPaymentMethod.php
[edit]
[-] PayPalCancelRecurringPayment.php
[edit]
[-] PayPalExecutePaymentAbstract.php
[edit]
[-] PayPalProceededNonRecurringPaymentHook.php
[edit]
[-] PayPalNonRecurringCreatedPaymentHook.php
[edit]
[-] RemainingItemsInNonRecurringPayPal.php
[edit]
[-] PaypalUpdateBillingAgreement.php
[edit]
[-] ChangePlan.php
[edit]
[-] PayPalReactivePlan.php
[edit]
[-] PayPalExecutePromotionPayment.php
[edit]
[-] PayPalGetSubscriptionStatus.php
[edit]
[-] PayPalRecurringCreatedPaymentHook.php
[edit]
[-] PayPalGenerateUrls.php
[edit]
[-] PayPalExecuteNonRecurringPayment.php
[edit]