From b3036f1583fa3d0ca119f29609806e6639279dbd Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 7 May 2017 21:56:23 -0500 Subject: [PATCH 1/4] Make suggested changes from https://www.drupal.org/node/2840526#comment-12074990. --- uc_stripe.module | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/uc_stripe.module b/uc_stripe.module index ba489e0..11edc16 100644 --- a/uc_stripe.module +++ b/uc_stripe.module @@ -548,6 +548,24 @@ function uc_stripe_charge($order_id, $amount, $data) { throw new Exception('No customer ID found'); } + // Set up titles and SKUs + $titles = array(); + $models = array(); + foreach($order->products as $item){ + $titles[] = $item->title; + $models[] = $item->model; + } + + if (variable_get('uc_stripe_metadata_titles',FALSE)==1 && variable_get('uc_stripe_metadata_models',FALSE)==1) { + $metadata = array("titles" => implode(";", $titles),"models" => implode(";", $models)); + } elseif (variable_get('uc_stripe_metadata_titles',FALSE)==1 && variable_get('uc_stripe_metadata_models',FALSE)==0) { + $metadata = array("titles" => implode(";", $titles)); + } elseif (variable_get('uc_stripe_metadata_titles',FALSE)==0 && variable_get('uc_stripe_metadata_models',FALSE)==1) { + $metadata = array("models" => implode(";", $models)); + } elseif (variable_get('uc_stripe_metadata_titles',FALSE)==0 && variable_get('uc_stripe_metadata_models',FALSE)==0) { + $metadata = array(); + } + $params = array( "amount" => $amount, "currency" => strtolower($order->currency), -- 2.39.5 From c33bf55abd4a68dc5793a1c61231712594221bf0 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 7 May 2017 22:15:27 -0500 Subject: [PATCH 2/4] Ignore patches. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96857d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +*.patch -- 2.39.5 From c4932c09d3b0b182b7570a52c5dbdb362d7d4562 Mon Sep 17 00:00:00 2001 From: mattbk Date: Fri, 19 May 2017 16:12:14 -0500 Subject: [PATCH 3/4] Remove extra lines. --- uc_stripe.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uc_stripe.module b/uc_stripe.module index 11edc16..67c3122 100644 --- a/uc_stripe.module +++ b/uc_stripe.module @@ -553,7 +553,7 @@ function uc_stripe_charge($order_id, $amount, $data) { $models = array(); foreach($order->products as $item){ $titles[] = $item->title; - $models[] = $item->model; + $models[] = $item->model; } if (variable_get('uc_stripe_metadata_titles',FALSE)==1 && variable_get('uc_stripe_metadata_models',FALSE)==1) { -- 2.39.5 From 9db65e750c111ab4ef30d2f7077431a4e81f8e67 Mon Sep 17 00:00:00 2001 From: mattbk Date: Fri, 23 Feb 2018 12:52:12 -0600 Subject: [PATCH 4/4] Revert "Add "Powered by Stripe"" This reverts commit 0e2671b975300cfbf34cac67e38f9807a13de6a1. --- images/solid-dark.svg | 7 ------- uc_stripe.module | 11 +---------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 images/solid-dark.svg diff --git a/images/solid-dark.svg b/images/solid-dark.svg deleted file mode 100644 index 77561bd..0000000 --- a/images/solid-dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/uc_stripe.module b/uc_stripe.module index 67c3122..92a41f9 100644 --- a/uc_stripe.module +++ b/uc_stripe.module @@ -150,15 +150,6 @@ function uc_stripe_form_uc_cart_checkout_form_alter(&$form, &$form_state) { '#weight' => -1000, ); - // Powered by Stripe (logo from https://stripe.com/about/resources) - if (variable_get('uc_stripe_poweredby', FALSE)) { - $payment_form['field_message'] = array( - '#type' => 'item', - '#markup' => "Powered by Stripe", - '#weight' => 1, - ); - } - $payment_form['stripe_token'] = array( '#type' => 'hidden', '#default_value' => 'default', @@ -319,7 +310,7 @@ function uc_stripe_settings_form() { $form['uc_stripe_settings']['uc_stripe_poweredby'] = array( '#type' => 'checkbox', '#title' => t('Powered by Stripe'), - '#description' => 'Show "powered by Stripe" in checkout.', + '#description' => 'Show "powered by Stripe" in shopping cart.', '#default_value' => variable_get('uc_stripe_poweredby', FALSE), ); -- 2.39.5