Jump to content

AddPayMethod gives Unsupported Gateway Type for Storage


wish

Recommended Posts

Hi,

I'm trying to create custom order page for my site.

I manage to :

Add order using AddOrder API.

create Stripe charge using Stripe genuine API.

Add Payment using AddInvoicePayment

 

but I can't add or link payment method for client.

I tried using AddPayMethod API, but it gives me error "Unsupported Gateway Type for Storage".

    require_once("/var/www/www.addme.com/webroot/my_account/init.php");
 
    $postData = array(
        'clientid' => '1001400',
        'type' => 'RemoteCreditCard',
        'card_number' => '4007000000027',
        'card_expiry' => '2023',
        'responsetype' => 'json',
        'gateway_module_name' => 'stripe',
        'set_as_default' => '1'
    );
    $results = localAPI('AddPayMethod'$postData);

I aware that WHMCS not saving card details anymore for certain payment gateway.

 

My question is,

how do I link or add payment method for a client?

 

Thanks

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 months later...
On 3/31/2020 at 9:35 PM, wish said:

Hi,

I'm trying to create custom order page for my site.

I manage to :

Add order using AddOrder API.

create Stripe charge using Stripe genuine API.

Add Payment using AddInvoicePayment

 

but I can't add or link payment method for client.

I tried using AddPayMethod API, but it gives me error "Unsupported Gateway Type for Storage".

    require_once("/var/www/www.addme.com/webroot/my_account/init.php");
 
    $postData = array(
        'clientid' => '1001400',
        'type' => 'RemoteCreditCard',
        'card_number' => '4007000000027',
        'card_expiry' => '2023',
        'responsetype' => 'json',
        'gateway_module_name' => 'stripe',
        'set_as_default' => '1'
    );
    $results = localAPI('AddPayMethod'$postData);

I aware that WHMCS not saving card details anymore for certain payment gateway.

 

My question is,

how do I link or add payment method for a client?

 

Thanks

One thing sticks out here right off the bat, but I completely understand the error. The Card Expiry works in MMYY not just year. Here's something I've done since my Gateway runs differently...

$expYr = $finCardRes["card"]["exp_year"];
$expMo = $finCardRes["card"]["exp_month"];
if ($expMo < '10') {$finExpMo = '0' .$expMo;}else {$finExpMo = $expMo;}
$finYr = substr( $expYr, -2);
$finExp = $finExpMo.$finYr;

Again, I still hope WHMCS can pipe in here. The API I'm working with (Square) has the date as a one number integer for single months 1-9 and 2 digits for 10-12 (reasoning if my if statement). The Year has 4 digits (from the API) so I had to create the substring to take off the first two numbers for the year (eg 20) which leaves you with the last remaining part of the year to fit it in WHMCS's MMYY format.

Edited by mfoland
Forgot to touch up on Code Reason
Link to comment
Share on other sites

  • 2 months later...
  • 7 months later...
  • WHMCS Technical Analyst

This is a valid error as mentioned in our AddPayMethod API documentation 
https://developers.whmcs.com/api-reference/addpaymethod/

Quote

Note that some tokenised payment gateways cannot be utilised via the API.

For Stripe this will mean you cannot add Stripe cards via API. The reason for this would be, because that would involve the full card details touching your server. Thereby negating the point of remotely hosting the card fields.

In the case of Stripe, that would mean, you will need to use the client area interface, so that the remote fields can be loaded from 'stripe.js'

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.

  • 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