Compare commits
8 Commits
7.x-2.x-de
...
master
Author | SHA1 | Date | |
---|---|---|---|
aea105c1ab | |||
6324febf04 | |||
b0c82fbcc5 | |||
fed9880872 | |||
5920620f0d | |||
6d7a49f424 | |||
20c909cd49 | |||
db90890002 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
*.patch
|
@ -150,14 +150,14 @@ 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' => "<a href='http://stripe.com'><img src=".base_path().drupal_get_path('module', 'uc_stripe') . '/images/solid-dark.svg' . " alt='Powered by Stripe'></a>",
|
||||
'#weight' => 1,
|
||||
);
|
||||
}
|
||||
// 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' => "<a href='http://stripe.com'><img src=" . '/' . drupal_get_path('module', 'uc_stripe') . '/images/solid-dark.svg' . " alt='Powered by Stripe'></a>",
|
||||
'#weight' => 1,
|
||||
);
|
||||
}
|
||||
|
||||
$payment_form['stripe_token'] = array(
|
||||
'#type' => 'hidden',
|
||||
@ -558,26 +558,25 @@ 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 = array();
|
||||
$models = array();
|
||||
$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;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
if (!empty($models)) {
|
||||
$metadata['models'] = implode(";", $models);
|
||||
}
|
||||
if (!empty($titles)) {
|
||||
$metadata['titles'] = implode(";", $titles);
|
||||
}
|
||||
|
||||
$params = array(
|
||||
"amount" => $amount,
|
||||
|
Reference in New Issue
Block a user