Transaction permission denied Error

Created on 29 May 2024, about 1 month ago
Updated 13 June 2024, 17 days ago

Problem/Motivation

The website encountered an unexpected error. Try again later.

Drupal\commerce_funds\Exception\TransactionException: Transaction permission denied: payment in Drupal\commerce_funds\TransactionManager->performTransaction() (line 186 of modules/contrib/commerce_funds/src/TransactionManager.php).

Steps to reproduce

Commerce funds is a great module. I just need some help to make it work. Here is my setup for the Commerce funds module. I intend to use this module to allow my customer to pay for orders from their store credit. Site admin deposits X dollars. Then site admin creates escore payment of X dollars to customer A and releases the funds. Customer A makes payment by Funds Balance. At the last step, I got this error. I have no restriction set for the Funds payment method. Any suggestions on how to make this work?

Thank you!

πŸ’¬ Support request
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States iseeaflyingcrane

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

Comments & Activities

  • Issue created by @iseeaflyingcrane
  • πŸ‡­πŸ‡·Croatia Aporie

    Hey,

    I think you're just trying to perform a transaction (whatever the type is) with a user that doesn't have the permission to do so.
    Just check permissions under /admin/people/permissions and make sure the user you're using has the necessary role and permission to perform the transaction you want.

    That should do it.

  • πŸ‡ΊπŸ‡ΈUnited States iseeaflyingcrane

    Thank you Aporie. I changed the permission as you said, and it works!!

    While you are here, I have another question. On the payment page, we now have the following two options. How can I relabel them?

    • Funds balance (create a new wallet)
    • Wallet (USD)

    I would like to relabel

    • "Funds balance (create a new wallet)" to "Credit balance (create a new wallet)"
    • "Wallet (USD)" to "Credit Wallet (USD)".

    Is it possible?

    Thank you again for a great module!

  • πŸ‡­πŸ‡·Croatia Aporie

    Well, you seem to have a very weird use case for this module :) If I got it correctly, you actually use the payment option to credit currency (which is perfectly fine, just not the way it was intended to).

    So ... I took a look, and unfortunately it's not possible to change "Funds balance (create a new wallet)" easily as it's the way Drupal Commerce is built and display the payment method type label (which is hard coded). You might be able to do it with a hook or something, though.

    For the "Wallet (USD)", if you can apply this small patch attached, that should do it. I still have to hard-code the currency though, but it will now display the "Display name" of your payment gateway followed by hard-coded selected (@currency).

  • πŸ‡ΊπŸ‡ΈUnited States iseeaflyingcrane

    Thank you Aporie for always prompt response. We would like display the wallet balance to the user. Can you tell me how to retrieve that value? As always, thank you for the amazing work!

  • πŸ‡­πŸ‡·Croatia Aporie

    Hi,

    If you haven't found the answer yet on your side. You should be able to do that with a block which is available. I think It's called "funds balance" if I recall correctly.

  • πŸ‡ΊπŸ‡ΈUnited States iseeaflyingcrane

    Thank you Aporie! Yes, there is a User Balance block and it is exactly what I need.

  • πŸ‡ΊπŸ‡ΈUnited States iseeaflyingcrane

    Hi Aporie, I have another question regarding how to use the balance feature of Commerce Funds module. The total of the customer's order is $100. The customer's funds balance is only $40. When customer selects "Wallet" option, a message that reads "Not enough USD to pay this order, please make a deposit first." will be displayed. How can we realize the feature in the following way? Deduct the amount of balance ($40) from the total of the order and only ask the customer to make a payment of $60 using his payment method of choice.

    Thank you!

  • πŸ‡­πŸ‡·Croatia Aporie

    This won't be possible out of the box.

    I recommend you to take a look at the drupal doc β†’ to understand the scope of the module and to the external doc on how to integrate Commerce Funds with Rules for customized workflow. This might be enough to do what you want.

    Otherwise, as your requirements seem pretty specifics, you might also want to look into hiring a dev.

  • πŸ‡ΊπŸ‡ΈUnited States iseeaflyingcrane

    Thank you! I sent you a message on https://orao-web.net/en/contact.

Production build 0.69.0 2024