Jump to content

How to add new types of credit card in creditcard.tpl ?


souzadavi

Recommended Posts

23 minutes ago, souzadavi said:

How to add new type (brand) of creditcard in creditcard.tpl??

I would assume that the array pulls the list from the AcceptedCardTypes field in the configuration table... editing the table wouldn't be a good idea as I imagine using the general settings tab list would overwrite any changes (I think it's a hardcoded list)... using a ClientAreaPageCreditCard hook might work to alter the array, but I don't know how WHMCS would react with a new card brand... might be worth you trying in a dev though and see what it does.

Link to comment
Share on other sites

1 hour ago, souzadavi said:

I just changed in template, isn't nice, but is solved for now...

it never occurred to me to suggest just editing the template! 🙂

though this wouldn't have any effect on the cart, where the cc options are still being pulled from the configured options.

Link to comment
Share on other sites

To add new credit card  brands, I created a hook like @brian! said, work nicely for CIELO brands api 3.0 gateways.

<?php
add_hook('ClientAreaPageCreditCard', 1, function($vars) {
    
    $array = array('Visa', 'Master', 'Amex', 'Elo', 'Aura', 'JCB', 'Diners','Discover','Hipercard');
	return  array("acceptedcctypes" => $array);

});

add_hook('ClientAreaPageCreditCardCheckout', 1, function($vars) {

    $array = array('Visa', 'Master', 'Amex', 'Elo', 'Aura', 'JCB', 'Diners','Discover','Hipercard');
	return  array("acceptedcctypes" => $array);
});

 

thanks 🙂

 

Link to comment
Share on other sites

  • 1 year later...
On 1/21/2019 at 4:59 PM, souzadavi said:

To add new credit card  brands, I created a hook like @brian! said, work nicely for CIELO brands api 3.0 gateways.


<?php
add_hook('ClientAreaPageCreditCard', 1, function($vars) {
    
    $array = array('Visa', 'Master', 'Amex', 'Elo', 'Aura', 'JCB', 'Diners','Discover','Hipercard');
	return  array("acceptedcctypes" => $array);

});

add_hook('ClientAreaPageCreditCardCheckout', 1, function($vars) {

    $array = array('Visa', 'Master', 'Amex', 'Elo', 'Aura', 'JCB', 'Diners','Discover','Hipercard');
	return  array("acceptedcctypes" => $array);
});

 

thanks 🙂

 

Did you get it to work with Cielo API 3.0? I have this payment gateway but it's not accepting Hipercard. Any help with this?

Link to comment
Share on other sites

6 hours ago, Patty said:

Did you get it to work with Cielo API 3.0? I have this payment gateway but it's not accepting Hipercard. Any help with this?

@Patty - which WHMCS version are you using ? if it's a more recent one, maybe you will need to use ClientAreaPaymentMethods ?

however, there is a nagging fragment of a memory that, during a recent beta period (I think v7.9 rather than v7.10), it was said by someone at  WHMCS that it's not possible to add new cc types - obviously, you can't add them to the list in general settings as they're hardcoded, but I don't know whether they meant not possible at all...

Link to comment
Share on other sites

@Patty unfortunately it's not possible to add new brands. Is really bad!  Other talk about it at: 

 

From credit card whmcs I didn't find a way to use other credit card brands...On database the WHMCS do not save right the credit card brand.  There is some similar request for WHMCS since 2016, https://requests.whmcs.com/topic/new-credit-card-brand-and-bins

WHMCS develop team is never available to talk....  I developed other CIELO API 3.0 gateway module from invoice... So there it's possible to use other credit card brands... I will send the link in PM...

Link to comment
Share on other sites

  • 2 months later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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