-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommerce_sbpayment.api.php
43 lines (40 loc) · 1.46 KB
/
commerce_sbpayment.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* @file
* API documentation for the Commerce SoftBank Payment Service module.
*/
/**
* Alter the list of SoftBank payment method options.
*
* This list is used in the payment method submit form.
*
* @param string[] $payment_method_options
* Array of payment method names keyed by machine name.
*
* @see commerce_sbpayment_submit_form()
* @see commerce_payment_pane_checkout_form()
*/
function hook_commerce_sbpayment_payment_method_options_alter(array &$payment_method_options) {
// Combine mobile based payment options into one.
$payment_method_options['docomo,auone,softbank2'] = t('Pay by Mobile (Docomo, AU, SoftBank)');
unset($payment_method_options['docomo']);
unset($payment_method_options['auone']);
unset($payment_method_options['softbank2']);
}
/**
* Alter the payment data before it is submitted to the SoftBank service.
*
* @param array $payment_data
* Array of payment data from a \Commerce\SBPayment\SBPayment object.
* @param string $sbpayment_service_name
* Machine name of the payment service.
* @param object $order
* A fully loaded Drupal commerce order object.
*/
function hook_commerce_sbpayment_service_order_form_data_alter(array &$payment_data, $sbpayment_service_name, stdClass $order) {
if ($sbpayment_service_name == 'link_type') {
$payment_data['item_name'] = t('This awesome order came from the awesome site: @site_name', array(
'@site_name' => variable_get('site_name', 'Drupal'),
));
}
}