Compare commits
2 Commits
master
...
7.x-2.x-de
Author | SHA1 | Date | |
---|---|---|---|
8493a9c1f7 | |||
c2a752501f |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
*.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"
|
||||||
|
|
||||||
|
@ -323,20 +323,6 @@ function uc_stripe_settings_form() {
|
|||||||
'#default_value' => variable_get('uc_stripe_poweredby', FALSE),
|
'#default_value' => variable_get('uc_stripe_poweredby', FALSE),
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['uc_stripe_settings']['uc_stripe_metadata_titles'] = array(
|
|
||||||
'#type' => 'checkbox',
|
|
||||||
'#title' => t('Metadata: Title'),
|
|
||||||
'#description' => t('Include order item title(s) in Stripe metadata.'),
|
|
||||||
'#default_value' => variable_get('uc_stripe_metadata_titles', FALSE),
|
|
||||||
);
|
|
||||||
|
|
||||||
$form['uc_stripe_settings']['uc_stripe_metadata_models'] = array(
|
|
||||||
'#type' => 'checkbox',
|
|
||||||
'#title' => t('Metadata: Model'),
|
|
||||||
'#description' => t('Include item model(s) (SKU(s)) in Stripe metadata.'),
|
|
||||||
'#default_value' => variable_get('uc_stripe_metadata_models', FALSE),
|
|
||||||
);
|
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,37 +539,20 @@ function uc_stripe_charge($order_id, $amount, $data) {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Charge the customer
|
// Charge the customer
|
||||||
try {
|
try {
|
||||||
|
|
||||||
//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
|
|
||||||
$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 (!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),
|
||||||
"customer" => $stripe_customer_id,
|
"customer" => $stripe_customer_id,
|
||||||
"description" => t("Order #@order_id", array("@order_id" => $order_id)),
|
"description" => t("Order #@order_id", array("@order_id" => $order_id)),
|
||||||
"metadata" => $metadata,
|
|
||||||
);
|
);
|
||||||
if (!empty($shipping_info)) {
|
if (!empty($shipping_info)) {
|
||||||
$params['shipping'] = $shipping_info;
|
$params['shipping'] = $shipping_info;
|
||||||
|
Reference in New Issue
Block a user