Hi bricolage_
First, I feel I want to make it clear that the buyCRED add-on and the WooCommerce payment gateway via the Gateway add-on are two separate features and there are no built-in connections between the two as not everyone uses both.
But this does not mean you can not connect the two.
The buyCRED Payment Gateway API is lacking I have to admit, I am behind on documenting a few of the APIs myCRED offers so I hope you forgive me.
There is an introductory tutorial on the subject though which I know have helped a few of my users to create their own gateways. You can find the tutorial here.
Now it sounds like you are simply looking to insert the option for users to buy points on the checkout page if their balance is insufficient for the order.
There are two main ways to approach this and both would require some code snippets.
First, assuming you have a dedicated page for buying points, we could insert a link to this page to get the user to “top up” their account.
Second we could use the mycred_buy shortcode which allows us to create links that goes directly to the buyCRED checkout page. The only downside with this shortcode is that you MUST set which gateway the user should use and the amount they would by.
Add some basic CSS styling and you could make these into buttons.
As luck will have it, you choose an awesome shopping plugin so adding this in is very easy.
So lets say that we want to go with the second option and add in a button for a quick buy of points if a users balance is too low.
WooCommerce has two hooks we can use for this:
woocommerce_cart_totals_after_order_total and woocommerce_review_order_after_order_total.
The first one will allow us to insert a new row in the total table on the cart page while the second allows us to do the same but on the checkout page.
Armed with these two hooks, we now need to create a function that will do the following:
1. Calculate the total cost of the cart.
2. Check if the buyer is solvent.
3. If not, present the buy button.
I have written up a piece of code that does this for you. You can find it here.
Copy the code and paste it into your child themes functions.php file and upload.
The code example uses PayPal but you can change this to any other supported gateway.
The button also is set to buy the amount the user is missing so if the total order is 100 points and the user only has 10, the button will be generated for 90 points. (rounded up).
Of course you can change this to a pre set number of points i.e. 1000 and add multiple buttons for multiple values. Totally up to you.