function commerce_payment_method_instance_id in Commerce Core 7
Returns a payment method instance ID given a payment method ID and the Rule containing an enabling action with settings.
Parameters
$method_id: The ID of the payment method.
$rule: The Rules configuration object used to provide settings for the method.
Return value
A string used as the payment method instance ID.
4 calls to commerce_payment_method_instance_id()
- commerce_payment_enable_method in modules/
payment/ commerce_payment.rules.inc - Generic execution callback for the payment method.
- commerce_payment_entity_load in modules/
payment/ commerce_payment.module - Implements hook_entity_load().
- commerce_payment_form_rules_ui_edit_element_alter in modules/
payment/ commerce_payment.module - Implements hook_form_FORM_ID_alter().
- commerce_payment_order_transaction_add_form in modules/
payment/ includes/ commerce_payment.forms.inc - Allows an administrator to choose a payment method type and add a transaction for a specific order.
File
- modules/
payment/ commerce_payment.module, line 709 - Defines the payment system and checkout integration.
Code
function commerce_payment_method_instance_id($method_id, $rule) {
$parts = array(
$method_id,
$rule->name,
);
return implode('|', $parts);
}