Missing Perform Transaction Action on Drupal 10.4

Created on 16 May 2025, 21 days ago

Commerce funds use case

Mainly using escrows for buyers and service providers.

Drupal Commerce contrib modules list

Only the ones required by Commerce Funds

Payment gateway module list

None yet

Issue description

I'm on a semi-fresh install of Drupal 10.4. I've installed Commerce 3 and Commerce Funds 3. The Perform Transaction Action is not present in the list of Actions so I have no way of properly setting up the rule according to the external documentation. Has anyone experienced this issue? Or, in general, Drupal Rules not loading some custom Rules Actions from other modules?

💬 Support request
Status

Active

Version

3.0

Component

Code

Created by

🇨🇦Canada rupertraphael

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • 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: {  }
    
  • 🇭🇷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!

  • 🇭🇷Croatia Aporie

    Awesome!

    Closing the ticket then.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024