Jump to content

New API? /api/delete

Recommended Posts

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.


Share this post

Link to post
Share on other sites

But I need to pass to whmcs which credit card a need to delete, before was easy because was only one... Now, how I know which credit card I should delete in whmcs? So how do I delete a credit card token when user request?



Thanks to write back.

Share this post

Link to post
Share on other sites

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:



Share this post

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

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 





Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

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