From d3f3b7c7dd7a774a76ec2dbaaa67f16e72224f6b Mon Sep 17 00:00:00 2001
From: drastik <jwjoshuawalker@gmail.com>
Date: Sat, 11 Aug 2012 19:08:34 -0700
Subject: [PATCH] pull  out of loop

---
 extension-4.1/extern/civicrm_stripe_cron_live.php           | 2 +-
 extension-4.1/extern/civicrm_stripe_cron_test.php           | 2 +-
 extension-4.2/com.drastikbydesign.payment.stripe/stripe.php | 2 +-
 source/extern/civicrm_stripe_cron_live.php                  | 2 +-
 source/extern/civicrm_stripe_cron_test.php                  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/extension-4.1/extern/civicrm_stripe_cron_live.php b/extension-4.1/extern/civicrm_stripe_cron_live.php
index 079f2773..4208094e 100644
--- a/extension-4.1/extern/civicrm_stripe_cron_live.php
+++ b/extension-4.1/extern/civicrm_stripe_cron_live.php
@@ -21,10 +21,10 @@ $query = "
   WHERE   end_time <= '$time' 
 ";
 
+$end_date = date("Y-m-d H:i:s");
 $end_recur_query = CRM_Core_DAO::executeQuery($query);
 
 while($end_recur_query->fetch()) {
-  $end_date = date("Y-m-d H:i:s");
   $stripe_customer = Stripe_Customer::retrieve($end_recur_query->customer_id);
   if(isset($stripe_customer)) {
     $stripe_customer->cancelSubscription();
diff --git a/extension-4.1/extern/civicrm_stripe_cron_test.php b/extension-4.1/extern/civicrm_stripe_cron_test.php
index 85cd2770..4318bb55 100644
--- a/extension-4.1/extern/civicrm_stripe_cron_test.php
+++ b/extension-4.1/extern/civicrm_stripe_cron_test.php
@@ -21,10 +21,10 @@ $query = "
   WHERE   end_time <= '$time' 
 ";
 
+$end_date = date("Y-m-d H:i:s");
 $end_recur_query = CRM_Core_DAO::executeQuery($query);
 
 while($end_recur_query->fetch()) {
-  $end_date = date("Y-m-d H:i:s");
   $stripe_customer = Stripe_Customer::retrieve($end_recur_query->customer_id);
   if(isset($stripe_customer)) {
     $stripe_customer->cancelSubscription();
diff --git a/extension-4.2/com.drastikbydesign.payment.stripe/stripe.php b/extension-4.2/com.drastikbydesign.payment.stripe/stripe.php
index cd42409d..31b7c4a5 100644
--- a/extension-4.2/com.drastikbydesign.payment.stripe/stripe.php
+++ b/extension-4.2/com.drastikbydesign.payment.stripe/stripe.php
@@ -160,10 +160,10 @@ class com_drastikbydesign_payment_stripe extends CRM_Core_Payment {
 		WHERE   end_time <= '$time' 
 	";
 
+    $end_date = date("Y-m-d H:i:s");
     $end_recur_query = CRM_Core_DAO::executeQuery($query);
 
     while($end_recur_query->fetch()) {
-      $end_date = date("Y-m-d H:i:s");
       $stripe_customer = Stripe_Customer::retrieve($end_recur_query->customer_id);
       if(isset($stripe_customer)) {
         $stripe_customer->cancelSubscription();
diff --git a/source/extern/civicrm_stripe_cron_live.php b/source/extern/civicrm_stripe_cron_live.php
index 079f2773..4208094e 100644
--- a/source/extern/civicrm_stripe_cron_live.php
+++ b/source/extern/civicrm_stripe_cron_live.php
@@ -21,10 +21,10 @@ $query = "
   WHERE   end_time <= '$time' 
 ";
 
+$end_date = date("Y-m-d H:i:s");
 $end_recur_query = CRM_Core_DAO::executeQuery($query);
 
 while($end_recur_query->fetch()) {
-  $end_date = date("Y-m-d H:i:s");
   $stripe_customer = Stripe_Customer::retrieve($end_recur_query->customer_id);
   if(isset($stripe_customer)) {
     $stripe_customer->cancelSubscription();
diff --git a/source/extern/civicrm_stripe_cron_test.php b/source/extern/civicrm_stripe_cron_test.php
index 85cd2770..4318bb55 100644
--- a/source/extern/civicrm_stripe_cron_test.php
+++ b/source/extern/civicrm_stripe_cron_test.php
@@ -21,10 +21,10 @@ $query = "
   WHERE   end_time <= '$time' 
 ";
 
+$end_date = date("Y-m-d H:i:s");
 $end_recur_query = CRM_Core_DAO::executeQuery($query);
 
 while($end_recur_query->fetch()) {
-  $end_date = date("Y-m-d H:i:s");
   $stripe_customer = Stripe_Customer::retrieve($end_recur_query->customer_id);
   if(isset($stripe_customer)) {
     $stripe_customer->cancelSubscription();
-- 
GitLab