Jump to content

Only allow certain payment gateway after payment through other gateway is made


Villavu

Recommended Posts

Hello! How can I make it so a new client must fund their account or pay an invoice with, for example, a credit card (stripe gateway) before the client can fund their account or pay an invoice with BitPay gateway? So really what I mean is that I want a payment gateway to be reserved until another payment gateway is used, and only then will the client be able to use this particular reserved payment gateway.


The reason I want this is so that I can avoid fraud and better verify the identity before allowing payment with BitPay, a cryptocurrency payment gateway.


Thanks! I suspect this will require some hook of some sort.

Edited by Villavu
Link to comment
Share on other sites

Hi,

You can determine if BitPay is allowed / disallowed by looking at tblaccounts table. The table stores all transactions therefore you should run a query like this one:

SELECT id FROM tblaccounts WHERE userid = {USER_ID} AND paymentmethod != 'bitpay' LIMIT 1

Please keep in mind that my query is just an example. I'm writing from my phone hence I can't see the actual structure of this table.

Anyway if the result of the above query is true it means that BitPay can be enabled. On the contrary you have to remove BitPay option from the dropdown on viewinvoice.php with an action hook.

The tricky part is that you have to do the same also on cart.php (customers can choose payment method while ordering new services). You also have to override the default payment method of WHMCS in case BitPay is the default option.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated