summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Feenstra2012-11-18 12:35:13 (GMT)
committer Bart Feenstra2012-11-18 12:35:13 (GMT)
commit9924260af9d309f3562b48771af8b8caf5c55289 (patch)
treef00be325cbc6fda16bef6a207af3626410214a2d
parent2c2c20c9816f96bbc645328aa9c4a61d3f3da2da (diff)
Fixed #1831784: Use Payment 7.x-1.1 prefixed line item callback.
-rw-r--r--payment_webform.info1
-rw-r--r--payment_webform.module16
-rw-r--r--tests/payment_webform_test/tests/PaymentWebformTestCallablesWebTestCase.test4
3 files changed, 4 insertions, 17 deletions
diff --git a/payment_webform.info b/payment_webform.info
index 0a1326d..ea64217 100644
--- a/payment_webform.info
+++ b/payment_webform.info
@@ -2,6 +2,7 @@ name = Payment for Webform
description = Allows Webform submissions to receive payments.
configure = admin/config/services/payment/payment_webform
core = 7.x
+dependencies[] = payment (>1.0)
dependencies[] = paymentreference
dependencies[] = webform
package = Payment \ No newline at end of file
diff --git a/payment_webform.module b/payment_webform.module
index 7b7b95e..de18362 100644
--- a/payment_webform.module
+++ b/payment_webform.module
@@ -46,7 +46,7 @@ function payment_webform_page_alter(&$page) {
function payment_webform_payment_line_item_info() {
return array(
new PaymentLineItemInfo(array(
- 'callback' => 'payment_webform_line_item_get_all',
+ 'callback' => 'payment_line_item_get_prefixed',
'name' => 'payment_webform',
'title' => t('All Payment for Webform items'),
)),
@@ -101,20 +101,6 @@ function payment_webform_payment_delete($entity) {
}
/**
- * Implements PaymentLineItemInfo::callback.
- */
-function payment_webform_line_item_get_all($name, Payment $payment) {
- $line_items = array();
- foreach ($payment->line_items as $line_item) {
- if (strpos($line_item->name, 'payment_webform_') === 0) {
- $line_items[$line_item->name] = $line_item;
- }
- }
-
- return $line_items;
-}
-
-/**
* Load the Webform NID for a Payment.
*
* @param integer $pid
diff --git a/tests/payment_webform_test/tests/PaymentWebformTestCallablesWebTestCase.test b/tests/payment_webform_test/tests/PaymentWebformTestCallablesWebTestCase.test
index 9d16b62..32c9fcf 100644
--- a/tests/payment_webform_test/tests/PaymentWebformTestCallablesWebTestCase.test
+++ b/tests/payment_webform_test/tests/PaymentWebformTestCallablesWebTestCase.test
@@ -10,8 +10,8 @@ class PaymentWebformTestCallablesWebTestCase extends XtoolsWebTestCase {
);
}
- function setUp() {
- parent::setUp(array('xtools'));
+ function setUp(array $modules = array()) {
+ parent::setUp($modules + array('xtools'));
}
function testCoreHookReturnValue() {