Jump to content

budiantoip

Member
  • Posts

    5
  • Joined

  • Last visited

Everything posted by budiantoip

  1. The issue is finally resolved, this is the log we found : We have already applied a workaround, thank you for your support, I really appreciate it
  2. I'm trying to access UpdatePayMethod endpoint, but it returns this error message : I'm using stripe credit cards. I have googled around but found no clue.
  3. I've been trying this for a couple days and stuck. I am trying to add a custom function in WHMCS, by creating a file `addstripecard.php`, the idea is based on a given customer token (something like `cus_1GPkTFJEegxX3y3c123456`) and then try to attach it to a card. The custom function is accessed from an API. First, I'm trying to access the Stripe library, by using these commands : ``` $gateway = new \WHMCS\Module\Gateway(); $gateway->load("stripe") ``` PS: the codes were taken from `https://github.com/WHMCSCare/WHMCS-7.8.0-decoded/blob/e7446479de49a28c8801d4c0c95f4cae22dcff33/modules/gateways/stripe/lib/StripeController.php` But, after running the above commands, I got this error message : ``` FastCGI sent in stderr: "PHP message: [WHMCS Application] ERROR: TypeError: Argument 2 passed to WHMCS\Api\ApplicationSupport\Http\ResponseFactory::factory() must be of the type array, string given, called in /www/xxxxxx.xxx/billing/vendor/whmcs/whmcs-foundation/lib/Api/ApplicationSupport/Route/Middleware/HandleProcessor.php on line 0 and defined in /www/xxxxxx.xxx/billing/vendor/whmcs/whmcs-foundation/lib/Api/ApplicationSupport/Http/ResponseFactory.php:0 Stack trace: #0 /www/xxxxxx.xxx/billing/vendor/whmcs/whmcs-foundation/lib/Api/ApplicationSupport/Route/Middleware/HandleProcessor.php(0): WHMCS\Api\ApplicationSupport\Http\ResponseFactory::factory(Object(WHMCS\Api\ApplicationSupport\Http\ServerRequest), '{"legacyGateway...') #1 /www/xxxxxx.xxx/billing/vendor/whmcs/whmcs-foundation/lib/Route/Middleware/Strategy/DelegatingMiddlewareTrait.php(0): WHMCS\Api\ApplicationSupport\Route\Middleware\HandleProcessor->_process(Object(WHMCS\Api\ApplicationSupport\Http\ServerRequest), Object(Middlewares\Utils\Delegate)) #2 /www/dat" while reading response header from upstream, client: 172.81.129.13, server: xxxxxx.xxx, request: "POST /billing/includes/api.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "xxxxxx.xxx.net" ``` Full codes: ``` <?php if (!defined("WHMCS")) { die("This file cannot be access directly!"); } function addStripeCard() { // card parameters $cardNumber = $_POST['cardnumber']; $cardExpiryDate = $_POST['cardexpirydate']; $remoteToken = $_POST['remotetoken']; $billingContactId = $_POST['billingcontactid']; $description = $_POST['description']; $cardType = $_POST['cardtype']; $cardStartDate = $_POST['cardstartdate']; $cardIssueNumber = $_POST['cardissuenumber']; $clientId = $_POST['clientid']; try { $gateway = new \WHMCS\Module\Gateway(); $gateway->load("stripe") return json_encode($gateway); } catch (Exception $e) { $error = [ 'result' => 'error', 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), ]; return $error; } } try { $data = addStripeCard(); $apiresults = $data; } catch (Exception $e) { $error = [ 'result' => 'error', 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), ]; $apiresults = $error; } ``` Does anyone have a clue on what's going on? I've tried googling many times, but couldn't find any answers.
  4. Hi all, This is my first time using Whmcs API. I tried to access this endpoint : https://developers.whmcs.com/api-reference/resetpassword/ But then I received this json message : { "result": "error", "message": "Invalid Permissions: API action \"resetpassword\" is not allowed" } Does it have to do with the API Roles > Role Management in this article ? Somehow I believe the API action "ResetPassword" was unchecked. https://docs.whmcs.com/API_Roles FYI, I don't have the access to the Whmcs dashboard. Any clue? Regards, Budianto IP
×
×
  • 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