Skip to content

Instantly share code, notes, and snippets.

@steffenr
Created December 21, 2011 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steffenr/1506564 to your computer and use it in GitHub Desktop.
Save steffenr/1506564 to your computer and use it in GitHub Desktop.
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