Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rule - BankTransfer for File-Products only
{ "commerce_payment_bank_transfer" : {
"LABEL" : "Bank Transfer",
"PLUGIN" : "reaction rule",
"WEIGHT" : "-1",
"REQUIRES" : [ "rules", "commerce_payment" ],
"ON" : [ "commerce_payment_methods" ],
"DO" : [
{ "LOOP" : {
"USING" : { "list" : [ "site:current-cart-order:commerce-line-items" ] },
"ITEM" : { "list_item" : "Current list item" },
"DO" : [
{ "component_rules_bank_transfer_physical" : { "line_item" : [ "list-item" ] } }
]
}
}
]
}
}
{ "rules_bank_transfer_physical" : {
"LABEL" : "Bank Transfer for physical Products",
"PLUGIN" : "rule",
"REQUIRES" : [ "rules", "commerce_payment" ],
"USES VARIABLES" : { "line_item" : { "label" : "Line Item", "type" : "commerce_line_item" } },
"IF" : [
{ "entity_has_field" : { "entity" : [ "line-item" ], "field" : "commerce_file_line_item_files" } }
],
"DO" : [
{ "commerce_payment_enable_bank_transfer" : {
"commerce_order" : [ "site:current-cart-order" ],
"payment_method" : { "value" : {
"method_id" : "bank_transfer",
"settings" : {
"details" : {
"account_owner" : "Account",
"account_number" : "Number",
"account_iban" : "IBAN",
"bank_code_appellation" : "",
"bank_code" : "",
"account_swift" : "",
"account_bank" : "",
"account_branch" : ""
},
"subject_oid" : 0,
"policy" : ""
}
}
}
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.