Compare commits
4 Commits
7.x-3.x-de
...
add-metada
Author | SHA1 | Date | |
---|---|---|---|
c0cb9f8f81 | |||
0675dcb249 | |||
8493a9c1f7 | |||
c2a752501f |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.patch
|
@ -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.
|
This is an Ubercart payment gateway module for Stripe.
|
||||||
|
|
||||||
Versions of the Stripe PHP Library and Stripe API that this module currently
|
Versions of the Stripe PHP Library and Stripe API that this module currently
|
||||||
|
@ -8,9 +8,9 @@ core = 7.x
|
|||||||
php = 5.3
|
php = 5.3
|
||||||
|
|
||||||
|
|
||||||
; Information added by Drupal.org packaging script on 2016-10-03
|
; Information added by Drupal.org packaging script on 2017-05-19
|
||||||
version = "7.x-2.2+1-dev"
|
version = "7.x-2.2+2-dev"
|
||||||
core = "7.x"
|
core = "7.x"
|
||||||
project = "uc_stripe"
|
project = "uc_stripe"
|
||||||
datestamp = "1475516941"
|
datestamp = "1495159090"
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ function uc_stripe_form_uc_cart_checkout_form_alter(&$form, &$form_state) {
|
|||||||
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,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -561,24 +561,18 @@ function uc_stripe_charge($order_id, $amount, $data) {
|
|||||||
throw new Exception('No customer ID found');
|
throw new Exception('No customer ID found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up titles and SKUs
|
|
||||||
$titles = array();
|
|
||||||
$models = 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) {
|
|
||||||
$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();
|
$metadata = array();
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!empty($models)) {
|
||||||
|
$metadata['models'] = implode(";", $models);
|
||||||
|
}
|
||||||
|
if (!empty($titles)) {
|
||||||
|
$metadata['titles'] = implode(";", $titles);
|
||||||
|
}
|
||||||
$params = array(
|
$params = array(
|
||||||
"amount" => $amount,
|
"amount" => $amount,
|
||||||
"currency" => strtolower($order->currency),
|
"currency" => strtolower($order->currency),
|
||||||
|
Reference in New Issue
Block a user