Problem/Motivation

I installed Commerce Funds module. I intended to use this module to allow my customer to pay with credit. It works well when the customer has credit. I have restricted the Funds Balance payment method only available to authenticated user. However for any authenticated user, the "Wallet (USD)" payment option is always the default option even when the given customer has no credit in his wallet. Is there any configuration or ways to make the Wallet option not show when the customer has no credit or at least not make it a default option?

Steps to reproduce

Log into the website, add a product to the cart, go to check out. Wallet(USD) will be the default payment option.

Proposed resolution

When the customer has no money in their wallet, hide "Wallet" and "Funds Balance" options. At least, make them not the default options.

CommentFileSizeAuthor
#2 payment_gateway_condition.png23.73 KBaporie

Comments

iseeaflyingcrane created an issue. See original summary.

aporie’s picture

StatusFileSize
new23.73 KB

I think a proper way of doing that would be to create a new condition in the payment gateway:
Payment gateway conditions

Regarding the fact that it's the default option, I think it's just a matter of reorganizing your payment methods under admin/commerce/config/payment-gateways.

As a workaround, you can probably perform checks and hide or display "create a wallet" button according to the order currency within the following preprocess: hook_preprocess_commerce_checkout_pane

iseeaflyingcrane’s picture

Hi Aporie, I truly appreciate your prompt response. In my payment gateways, I have arranged the "Funds Balance" to be the last. However it still shows up at the default option in customer's payment options in the check out page.

In terms of creating a a new condition, what condition should be set there? I already set the "Funds Balance" option to be available only to authenticated user. But the problem is that with authenticated users, not all of them has funds in their account. So I don't want the Wallet option to be the default.

Thank you!

aporie’s picture

There is no such option out of the box, unfortunately.

I was just pointing where the extra work should be done.

Just keep the ticket opened and we'll see.