Jump to content
wish

AddPayMethod gives Unsupported Gateway Type for Storage

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

Share this post


Link to post
Share on other sites

I'd like to bump this. The API says it will store Remote Data, which, in the Gateway I have built and works, except recurring payments (reason I'm running into this), but it says Unsupported Gateway Type for Storage. Can anyone from WHMCS pipe in on this?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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