Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: victorquinn/uc_stripe
base: 3641e82bd6
...
head fork: victorquinn/uc_stripe
compare: f4472c6d2f
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Dec 17, 2011
@victorquinn Fixed the issues highlighted by klausi here: http://drupal.org/node/1…
…339850#comment-5371582

Namely:
- Ran more text through t()
- Fixed comical error, "We apologize for the convenience." Must have been channeling Mitch.
- Fixed truncated success message in _uc_stripe_post_transaction
dd18b46
Commits on Apr 22, 2012
@victorquinn Issue #1517034 by stevesmename: Now using uc_price to set things up i…
…nstead of manually multiplying which could lead to rounding errors and small price discrepancies of $0.01.
e1d2f7f
@victorquinn Merge branch '6.x-1.x' of github.com:victorquinn/uc_stripe into 6.x-1.x f4472c6
Showing with 21 additions and 8 deletions.
  1. +21 −8 uc_stripe.module
View
29 uc_stripe.module
@@ -159,17 +159,17 @@ function uc_stripe_product_feature_validate($form, &$form_state) {
// First, ensure the user has selected a SKU.
if ($form_state['values']['model'] == '') {
- form_set_error('model', "You must select an Applicable SKU for payments to work with Stripe.");
+ form_set_error('model', t("You must select an Applicable SKU for payments to work with Stripe."));
return FALSE;
}
if ($form_state['values']['regular_interval_unit'] == 'days' || $form_state['values']['regular_interval_unit'] == 'weeks') {
- form_set_error('regular_interval_unit', "Stripe only allows intervals of months or years. Invalid value given.");
+ form_set_error('regular_interval_unit', t("Stripe only allows intervals of months or years. Invalid value given."));
return FALSE;
}
if ($form_state['values']['regular_interval_value'] > 1) {
- form_set_error('regular_interval_value', "Stripe only allows intervals of 1 month or 1 year.");
+ form_set_error('regular_interval_value', t("Stripe only allows intervals of 1 month or 1 year."));
return FALSE;
}
@@ -187,7 +187,7 @@ function uc_stripe_product_feature_validate($form, &$form_state) {
// We want to programmatically create a Stripe subscription plan
// for this item.
if (!_uc_stripe_load_api()) {
- form_set_error('', "There was a problem loading the Stripe API. Recurring feature could not be created. Please ensure the API is in sites/all/libraries/stripe.");
+ form_set_error('', t("There was a problem loading the Stripe API. Recurring feature could not be created. Please ensure the API is in sites/all/libraries/stripe."));
return FALSE;
}
@@ -315,9 +315,22 @@ function uc_stripe_charge($order_id, $amount, $data) {
if (drupal_strlen($order->payment_details['cc_exp_month']) == 1) {
$order->payment_details['cc_exp_month'] = '0' . $order->payment_details['cc_exp_month'];
}
+
+ $context = array(
+ 'revision' => 'formatted-original',
+ 'type' => 'amount',
+ );
+
+ $options = array(
+ 'sign' => FALSE,
+ 'thou' => FALSE,
+ 'dec' => FALSE,
+ 'prec' => 2,
+ );
+
// Set up minimum fields.
$data = array(
- 'amount' => intval($amount * 100),
+ 'amount' => uc_price($amount, $context, $options),
'currency' => 'usd',
'card' => array(
'number' => $order->payment_details['cc_number'],
@@ -420,7 +433,7 @@ function uc_stripe_process($order, &$fee) {
if (count($nid) > 1) {
watchdog('uc_stripe', "Multiple subscriptions in cart. User %user warned.", array('%user' => $user->name));
- drupal_set_message(t("Currently, only one subscription may be purchased at one time. Please purchase one subscription, then purchase another as a separate order. We apologize for the convenience."), 'error');
+ drupal_set_message(t("Currently, only one subscription may be purchased at one time. Please purchase one subscription, then purchase another as a separate order. We apologize for the inconvenience."), 'error');
return FALSE;
}
$nid = $nid[0];
@@ -659,7 +672,7 @@ function _uc_stripe_fancy_name($nid) {
$product = uc_product_load($node);
$interval = drupal_substr($recurring->regular_interval, 2, -1);
$fee = number_format($recurring->fee_amount, 2);
- $title = "{$node->title} (\${$fee}/{$interval} starting in {$recurring->initial_charge})";
+ $title = t("{$node->title} (\${$fee}/{$interval} starting in {$recurring->initial_charge})");
return $title;
}
}
@@ -704,7 +717,7 @@ function _uc_stripe_post_transaction($order_id, $data) {
$charge_object = Stripe_Charge::create($data);
$result = array(
'success' => TRUE,
- 'message' => t('Credit card payment processed successfully. Tr'),
+ 'message' => t('Credit card payment processed successfully.'),
'uid' => $user->uid,
'trans_id' => $charge_object->__get('id'),
);

No commit comments for this range

Something went wrong with that request. Please try again.