Jump to content

New API? /api/delete


souzadavi

Recommended Posts

At example: https://github.com/WHMCS/developer-docs/blob/master/payment-gateways/tokenised-remote-storage.md on case DELETE there is a CURL for api delete.

423453748_Capturadetelade2019-09-0112-03-21.png.bdada96c30761d04eaf4612e13ea623a.png

But at documentation there is no information about it. Please could explain about this new DELETE function:

481880799_Capturadetelade2019-09-0112-03-55.png.55a654f614e4f24f68703c593850bbf4.png

 

The DOCS should be update to help the adjustment for new version 7.8 of WHMCS.

Link to comment
Share on other sites

  • WHMCS Technical Analyst

The code you're quoting is a sample of the API call you might would make to your payment gateway providers' tokenisation API.

In reality it would need to be your payment gateway API endpoint that you would use in place of the https://www.example.com/api/delete URL - not something within the WHMCS API.

-Ed

Link to comment
Share on other sites

  • WHMCS Technical Analyst

The WHMCS UI will call your custom payment gateway module and pass in the details of the credit card/pay method that has been requested for deletion via the UI.  If your payment module returns that the deletion was successful, WHMCS will automatically delete the appropriate payment method.  You do not need to do this within your module.

If you are doing something different and need to use the API then the following new API methods have been made available for working with Pay Methods:

https://developers.whmcs.com/api-reference/getpaymethods/
https://developers.whmcs.com/api-reference/addpaymethod/
https://developers.whmcs.com/api-reference/updatepaymethod/
https://developers.whmcs.com/api-reference/deletepaymethod/

-Ed

Link to comment
Share on other sites

In the URL: https://github.com/WHMCS/developer-docs/blob/master/payment-gateways/tokenised-remote-storage.md

The action parameter is "delete", but in WHMCS 7.7 version my module remove credit card with action "clear" like this:


    if($_POST['remove'] == 1 && $_GET['action'] != "clear"){
        return array(
            "status" => "success",
            "gatewayid" => NULL,
            "rawdata" => "Cartão Removido",);
    }   

My new one after read the manual:

case 'delete':

            return [
                'status' => 'success',
                "rawdata" => "Cartão Removido: ". $gatewayid,
            ];
            break;

Both is it right? action clear ou delete will do the job? The gatewayid do not need to send?

 

 

it's been really hard to deploy credit card module, because it working only in production 

 

 

Thanks

 

Link to comment
Share on other sites

  • 2 weeks 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.

×
×
  • 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