PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Framework
/
Payment
/
PayPal
<?php namespace WilokeListingTools\Framework\Payment\PayPal; use WilokeListingTools\Models\PaymentModel; use WilokeListingTools\Models\PlanRelationshipModel; use WilokeListingTools\Framework\UserPlan\GetUserPlan; use WilokeListingTools\Framework\UserPlan\RemainingItemsInNonRecurringPaymentInterface; class RemainingItemsInNonRecurringPayPal extends GetUserPlan{ protected $userID; protected $planID; protected $sessionID; protected $unlimitedItems = 100000; /** * @param array $aUserInfo: It contains userID and planID */ public function __construct(array $aUserInfo) { $this->setUserID($aUserInfo['userID']); $this->setPlanID($aUserInfo['planID']); $this->setSessionID($aUserInfo['sessionID']); $this->getUserPlan(); $this->getPlanType(); $this->getPlan(); $this->getBilledDate(); $this->getPlanSettings(); } public function setUserID( $userID ) { $this->userID = $userID; } public function setPlanID( $planID ) { $this->planID = $planID; } public function setSessionID( $sessionID ) { $this->sessionID = $sessionID; } /** * Calculating the remaining item * * @return number $remainingItems */ public function remainingItems(){ $status = PaymentModel::getSessionStatus($this->sessionID); if ( $status != 'succeeded' ){ return 0; } $maximumAllowableItems = abs($this->aPlanSettings['number_of_posts']); if ( empty($maximumAllowableItems) ){ return $this->unlimitedItems; } $countItemsUsed = PlanRelationshipModel::countItemsUsedBySessionIDAndPlanID($this->userID, $this->sessionID, $this->planID); return $maximumAllowableItems - $countItemsUsed; } }
[+]
..
[-] 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]