summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gensel2012-11-15 18:10:04 (GMT)
committer Mike Gensel2012-11-15 18:10:04 (GMT)
commitd6f6edd7462dea97280d05103c895e6737d8ecde (patch)
tree5133d1147d6201ada67bcc5cb2aa236b3d1cee9d
parent30c9e82815b5df1e3aaab362867d570c94c4ba55 (diff)
Code cleanup7.x-1.0-beta3
-rw-r--r--commerce_be2bill.module35
-rw-r--r--includes/commerce_be2bill.admin.inc10
2 files changed, 19 insertions, 26 deletions
diff --git a/commerce_be2bill.module b/commerce_be2bill.module
index f4918ae..94113a4 100644
--- a/commerce_be2bill.module
+++ b/commerce_be2bill.module
@@ -412,12 +412,10 @@ function commerce_be2bill_server_url($txn_mode, $request_mode = 'form') {
* Rule settings
* @param stdClass $order
* Order object returned by commerce_order_load
- * @param $user
- * User object tied to the order
*
* @return array $parameters
*/
-function commerce_be2bill_request_base($settings, $order, $user) {
+function commerce_be2bill_request_base($settings, $order) {
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
// Required for all requests.
$parameters = array(
@@ -449,7 +447,7 @@ function commerce_be2bill_request_payment($settings, $order, $user){
}
// Prepare the billing address for use in the request.
$name = commerce_be2bill_get_name($billing_address, 'join');
- $parameters = commerce_be2bill_request_base($settings, $order, $user);
+ $parameters = commerce_be2bill_request_base($settings, $order);
$parameters += array(
'OPERATIONTYPE' => $settings['txn_type'],
'AMOUNT' => $order_wrapper->commerce_order_total->amount->value(),
@@ -493,14 +491,12 @@ function commerce_be2bill_request_payment($settings, $order, $user){
* Rule settings
* @param stdClass $order
* Order object returned by commerce_order_load
- * @param $user
- * User object tied to the order
* @return array $parameters
*/
-function commerce_be2bill_request_capture($settings, $order, $user, $transaction){
+function commerce_be2bill_request_capture($settings, $order, $transaction){
global $base_url;
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
- $parameters = commerce_be2bill_request_base($settings, $order, $user);
+ $parameters = commerce_be2bill_request_base($settings, $order);
$parameters += array(
'OPERATIONTYPE' => 'capture',
'TRANSACTIONID' => $transaction->remote_id,
@@ -515,18 +511,17 @@ function commerce_be2bill_request_capture($settings, $order, $user, $transaction
/**
* Builds a request array for the Capture type
- * @param $settings
- * Rule settings
+ *
+ * @param array $settings
+ * Rule settings
* @param stdClass $order
- * Order object returned by commerce_order_load
- * @param $user
- * User object tied to the order
- * @return array $parameters
+ * Order object returned by commerce_order_load
+ * @return array
*/
-function commerce_be2bill_request_refund_void($settings, $order, $user, $transaction){
+function commerce_be2bill_request_refund_void($settings, $order, $transaction) {
global $base_url;
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);
- $parameters = commerce_be2bill_request_base($settings, $order, $user);
+ $parameters = commerce_be2bill_request_base($settings, $order);
$parameters += array(
'OPERATIONTYPE' => 'refund',
'TRANSACTIONID' => $transaction->remote_id,
@@ -539,14 +534,14 @@ function commerce_be2bill_request_refund_void($settings, $order, $user, $transac
return $parameters;
}
-// Helper functions below
-
/**
* Generate hash for form submission.
*
* @param string $password
- * Password as defined by Be2Bill for your account
+ * Password as defined by Be2Bill for your account.
* @param array $parameters
+ * Parameters to be hashed.
+ * @return string
*/
function commerce_be2bill_signature($password, array $parameters) {
// Alpha sort.
@@ -563,7 +558,7 @@ function commerce_be2bill_signature($password, array $parameters) {
}
/**
- * Either split name or join name depending on method.
+ * Split name into seperate fields if needed.
*/
function commerce_be2bill_get_name(array $address = array()) {
if (empty($address)) {
diff --git a/includes/commerce_be2bill.admin.inc b/includes/commerce_be2bill.admin.inc
index 1c3ee76..8ef4d18 100644
--- a/includes/commerce_be2bill.admin.inc
+++ b/includes/commerce_be2bill.admin.inc
@@ -6,8 +6,7 @@
*/
/**
- * Implements hook_form
- * Form for Be2Bill Capture Funds process.
+ * Implements hook_form().
*/
function commerce_be2bill_capture_form($form, &$form_state, $order, $transaction) {
$form_state['order'] = $order;
@@ -96,7 +95,7 @@ function commerce_be2bill_capture_form_submit($form, &$form_state) {
'method' => 'capture',
'params' => $params,
);
- $url = commerce_be2bill_server_url($settings['txn_mode'],'server');
+ $url = commerce_be2bill_server_url($settings['txn_mode'], 'server');
$payload = http_build_query($request);
$options = array(
'method' => 'POST',
@@ -134,8 +133,7 @@ function commerce_be2bill_capture_form_submit($form, &$form_state) {
}
/**
- * Implements hook_form
- * Form for Be2Bill Refund/Void process.
+ * Implements hook_form().
*/
function commerce_be2bill_refund_void_form($form, &$form_state, $order, $transaction) {
$form_state['order'] = $order;
@@ -209,7 +207,7 @@ function commerce_be2bill_refund_void_form_submit($form, &$form_state) {
'method' => 'refund',
'params' => $params,
);
- $url = commerce_be2bill_server_url($settings['txn_mode'],'server');
+ $url = commerce_be2bill_server_url($settings['txn_mode'], 'server');
$payload = http_build_query($request);
$options = array(
'method' => 'POST',