8 Commits

Author SHA1 Message Date
aea105c1ab Revert "Merge pull request #9 from mattbk/7.x-3.1"
This reverts commit 6324febf04, reversing
changes made to fed9880872.
2019-10-03 21:53:02 -05:00
6324febf04 Merge pull request #9 from mattbk/7.x-3.1
Update from official release
2019-10-03 21:30:40 -05:00
b0c82fbcc5 Update from official release. 2019-10-03 21:29:05 -05:00
fed9880872 Fix pseudocode. 2017-05-19 10:04:42 -05:00
5920620f0d Update from 7.x-2.x-dev. 2017-05-19 09:59:40 -05:00
6d7a49f424 Ignore patches. 2017-05-07 22:15:27 -05:00
20c909cd49 Clean up pseudocode. 2017-05-07 22:09:53 -05:00
db90890002 Make suggested changes from https://www.drupal.org/node/2840526#comment-12074990. 2017-05-07 21:56:23 -05:00
2 changed files with 21 additions and 20 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.patch

View File

@ -150,14 +150,14 @@ function uc_stripe_form_uc_cart_checkout_form_alter(&$form, &$form_state) {
'#weight' => -1000, '#weight' => -1000,
); );
// Powered by Stripe (logo from https://stripe.com/about/resources) // Powered by Stripe (logo from https://stripe.com/about/resources)
if (variable_get('uc_stripe_poweredby', FALSE)) { if (variable_get('uc_stripe_poweredby', FALSE)) {
$payment_form['field_message'] = array( $payment_form['field_message'] = array(
'#type' => 'item', '#type' => 'item',
'#markup' => "<a href='http://stripe.com'><img src=".base_path().drupal_get_path('module', 'uc_stripe') . '/images/solid-dark.svg' . " alt='Powered by Stripe'></a>", '#markup' => "<a href='http://stripe.com'><img src=" . '/' . drupal_get_path('module', 'uc_stripe') . '/images/solid-dark.svg' . " alt='Powered by Stripe'></a>",
'#weight' => 1, '#weight' => 1,
); );
} }
$payment_form['stripe_token'] = array( $payment_form['stripe_token'] = array(
'#type' => 'hidden', '#type' => 'hidden',
@ -558,26 +558,25 @@ function uc_stripe_charge($order_id, $amount, $data) {
//Bail if there's no customer ID //Bail if there's no customer ID
if (empty($stripe_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 // Set up titles and SKUs
$titles = array(); $titles = variable_get('uc_stripe_metadata_titles', FALSE);
$models = array(); $models = variable_get('uc_stripe_metadata_models', FALSE);
$metadata = array();
foreach($order->products as $item){ foreach($order->products as $item){
$titles[] = $item->title; $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) { if (!empty($models)) {
$metadata = array("titles" => implode(";", $titles),"models" => implode(";", $models)); $metadata['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)); if (!empty($titles)) {
} elseif (variable_get('uc_stripe_metadata_titles',FALSE)==0 && variable_get('uc_stripe_metadata_models',FALSE)==1) { $metadata['titles'] = implode(";", $titles);
$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( $params = array(
"amount" => $amount, "amount" => $amount,