starnetwork Posted June 25, 2013 Share Posted June 25, 2013 Hi, We finished to build new third party gateway module. (customer leaves my site and make the payment on the gateway providers). After billing process is finished the gateway calls to the callback page of the module with POST request and send the token and other transaction data. I would like to save the token for future recurring billing so I did as you described in the documentation. I build the function _storeremote() and call it from the callback page. This is the code: name of module = pcredirect: pcredirect.php function pcredirect_storeremote() { $token = $_POST['token']; return array("status"=>"success","gatewayid"=>$token,"rawdata"=>$results); } callback/pcredirect.php pcredirect_storeremote(); This function doesn't work because the data of the token doesn't saved in the database. any Idea? Best Regards, Star Network. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted June 27, 2013 Share Posted June 27, 2013 The storeremote function is called internally by WHMCS when updating a credit card via the WHMCS admin or client interface, calling the method directly would do nothing other than return an array back to call back containing the values you return. To save the token you would need to do this manually via SQL. e.g. This is how I do this from my stripe gateway module. full_query("UPDATE tblclients set expdate = AES_ENCRYPT('".$params['cardexp']."','". $cchash. "') WHERE id = ". $whmcs_client_id); update_query("tblclients", array("cardtype" => $stripe_customer->active_card->type, "cardnum" => '', "gatewayid" =>$stripe_customer->id,"cardlastfour" => $stripe_customer->active_card->last4), array("id" => $whmcs_client_id)); 0 Quote Link to comment Share on other sites More sharing options...
starnetwork Posted June 29, 2013 Author Share Posted June 29, 2013 Thanks! Best Regards, Star Network. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.