Example #1
0
 /**
  * Remove an intention and payment session records.
  *
  * @param Crowdfunding\Payment\Session $paymentSession
  * @param bool $removeIntention Remove or not the intention record.
  */
 protected function closePaymentSession($paymentSession, $removeIntention = false)
 {
     // Remove intention record.
     if ($paymentSession->getIntentionId() and $removeIntention) {
         $intention = new Crowdfunding\Intention(\JFactory::getDbo());
         $intention->load($paymentSession->getIntentionId());
         if ($intention->getId()) {
             $intention->delete();
         }
     }
     // Remove payment session record.
     $paymentSession->delete();
 }
Example #2
0
 /**
  * Remove an intention and payment session records.
  *
  * @param Crowdfunding\Payment\Session $paymentSession
  * @param string                       $txnStatus
  */
 protected function closePaymentSession($paymentSession, $txnStatus)
 {
     if (strcmp("completed", $txnStatus) == 0) {
         // Remove intention record.
         if ($paymentSession->getIntentionId()) {
             $intention = new Crowdfunding\Intention(\JFactory::getDbo());
             $intention->load($paymentSession->getIntentionId());
             if ($intention->getId()) {
                 $intention->delete();
             }
         }
         // Remove payment session record.
         $paymentSession->delete();
     }
 }
 /**
  * Remove an intention records.
  *
  * @param PaymentSessionRemote $paymentSession
  * @param Transaction $transaction
  */
 protected function removeIntention(PaymentSessionRemote $paymentSession, Transaction $transaction)
 {
     // Remove intention record.
     $removeIntention = (strcmp('completed', $transaction->getStatus()) === 0 or strcmp('pending', $transaction->getStatus()) === 0);
     if ($paymentSession->getIntentionId() and $removeIntention) {
         $intention = new Crowdfunding\Intention(\JFactory::getDbo());
         $intention->load($paymentSession->getIntentionId());
         if ($intention->getId()) {
             $intention->delete();
         }
     }
 }