- Issue created by @rupertraphael
- 🇭🇷Croatia Aporie
Hi,
The perform transaction rule action is dependant of the transaction context.
It means it won't be shown before you have configured an "Action", "Create a new transaction entity".Though, from my test, it's not possible to use a Drupal commerce currency field in the rule definition as it expects a string and commerce funds transaction expects a "decimal" data type. This means you might need to create two fields (and not a single commerce currency), one for the number as decimal, the other for currency as list, probably.
Make sure you can't do what you want using Commerce Funds transaction fields (which you can add directly in your content type).
- 🇨🇦Canada rupertraphael
Though, from my test, it's not possible to use a Drupal commerce currency field in the rule definition as it expects a string and commerce funds transaction expects a "decimal" data type. This means you might need to create two fields (and not a single commerce currency), one for the number as decimal, the other for currency as list, probably.
So my current way around is to use the Convert data action (target_type: decimal and rounding_behavior: round). I think accuracy is fine since the values don't include cents.
The perform transaction rule action is dependant of the transaction context.
It means it won't be shown before you have configured an "Action", "Create a new transaction entity".That's what is weird. I already have the "Create a new transaction entity " action configured.
uuid: 3b747d70-e7c8-4437-8bee-5041b648c327 langcode: en status: true dependencies: { } id: create_escrow_transaction_for_service_request label: 'Create Escrow Transaction for Service Request' events: - event_name: 'rules_entity_insert:node--service_request' description: 'Automatically a Commerce Funds Escrow transaction for a Service Request node.' tags: { } config_version: '3' expression: id: rules_rule uuid: 766ab070-c759-48e8-9a59-7e3b5b0f8650 weight: 0 conditions: id: rules_and uuid: 8bcdc867-a618-452a-bffc-7b747713bc31 weight: 0 conditions: - id: rules_condition uuid: f44222f6-0a82-44d6-96e5-7530fbaa5a81 weight: 0 condition_id: rules_entity_is_of_bundle negate: false context_values: type: node bundle: service_request context_mapping: entity: node context_processors: type: rules_tokens: { } bundle: rules_tokens: { } provides_mapping: { } actions: id: rules_action_set uuid: 413dc3da-ba93-4916-bb56-968dfb482a43 weight: 0 actions: - id: rules_action uuid: 56c0080e-d61f-410f-b7d4-0eae6d53eb2c weight: -50 action_id: rules_data_convert context_values: target_type: decimal rounding_behavior: round context_mapping: value: node.field_price.number context_processors: target_type: rules_tokens: { } rounding_behavior: rules_tokens: { } provides_mapping: conversion_result: brut_amount - id: rules_action uuid: f7e3a4b6-d511-4a61-9f7a-ebca2b526a64 weight: -49 action_id: 'rules_entity_create:commerce_funds_transaction' context_values: type: escrow method: internal net_amount: '' fee: '' status: Completed context_mapping: issuer: node.uid.target_id recipient: node.field_to_user.target_id brut_amount: brut_amount currency: node.field_price.currency_code hash: node.uuid.value context_processors: type: rules_tokens: { } method: rules_tokens: { } net_amount: rules_tokens: { } fee: rules_tokens: { } status: rules_tokens: { } provides_mapping: { } - id: rules_action uuid: e3b4eef6-7748-4cf3-9c09-50fd194402a7 weight: 0 action_id: rules_data_set context_values: { } context_mapping: data: commerce_funds_transaction_created.notes value: node.title.value context_processors: { } provides_mapping: { } - id: rules_action uuid: 736a425d-30f6-43f4-a6dc-03913a35a844 weight: 0 action_id: rules_entity_save context_values: immediate: '1' context_mapping: entity: commerce_funds_transaction_created context_processors: immediate: rules_tokens: { } provides_mapping: { }
- 🇨🇦Canada rupertraphael
You fixed it already in this commit: https://git.drupalcode.org/project/commerce_funds/-/commit/fabdbc0a0aea2...
Thank you so much! :)
- 🇨🇦Canada rupertraphael
You fixed it already here: https://git.drupalcode.org/project/commerce_funds/-/commit/fabdbc0a0aea2...
Thank you so much!
- 🇭🇷Croatia Aporie
It is indeed weird. I'm on dev branch and there is only the typo I fixed from the rule action.
Maybe can you check under "Ban" in the list if you see "perform transaction"? That's the typo I've fixed.
From your import, I get this:
- 🇨🇦Canada rupertraphael
Yeah, fixing the typo allowed me to see the "Perform Transaction" action. Thanks so much!
Automatically closed - issue fixed for 2 weeks with no activity.