From ee03f3243d7e75eb687b380ae6c5d0024074f5fb Mon Sep 17 00:00:00 2001 From: mattbk Date: Fri, 19 May 2017 11:31:59 -0500 Subject: [PATCH] Clean up. --- README.txt | 6 ------ uc_stripe.module | 28 +++++++++++++--------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/README.txt b/README.txt index a01d055..2e42089 100644 --- a/README.txt +++ b/README.txt @@ -1,9 +1,3 @@ -Based on the 7.x-2.x-dev branch at https://www.drupal.org/project/uc_stripe. Using -this as a working repo to track changes. I’m using this on some production sites, -but no guarantees are made for anyone else. Look through the code! - -—— - This is an Ubercart payment gateway module for Stripe. Versions of the Stripe PHP Library and Stripe API that this module currently diff --git a/uc_stripe.module b/uc_stripe.module index bf240f4..fbe8da8 100644 --- a/uc_stripe.module +++ b/uc_stripe.module @@ -558,25 +558,23 @@ function uc_stripe_charge($order_id, $amount, $data) { //Bail if there's no customer ID if (empty($stripe_customer_id)) { - throw new Exception('No customer ID found'); + throw new Exception('No customer ID found'); } // Set up titles and SKUs - $titles = variable_get('uc_stripe_metadata_titles', FALSE); - $models = variable_get('uc_stripe_metadata_models', FALSE); - $metadata = array(); - - foreach($order->products as $item){ - $titles[] = $item->title; - $models[] = $item->model; - } + $titles = variable_get('uc_stripe_metadata_titles', FALSE); + $models = variable_get('uc_stripe_metadata_models', FALSE); + $metadata = array(); - if (!empty($models)) { - $metadata['models'] = implode(";", $models); - } - if (!empty($titles)) { - $metadata['titles'] = implode(";", $titles); - } + foreach($order->products as $item){ + $titles[] = $item->title; + $models[] = $item->model;} + + if (!empty($models)) { + $metadata['models'] = implode(";", $models); + + if (!empty($titles)) { + $metadata['titles'] = implode(";", $titles); $params = array( "amount" => $amount,