Jump to content
  • 0

Gateway callback, seal being altered with whmcs function


Executable

Question

I created a custom a custom gateway module for my needs. I made all the verification (seal, response code,...), if I make a simulation everything is working. Now I need the whmcs function

addInvoicePayment

to accept the invoice. 

Unfortunately, when I add the following code to get the function, my data are altered so my seal is always corrupted.

 

<?php
use WHMCS\Database\Capsule;
use WHMCS\Input\Sanitize;

require("../../../init.php");
$whmcs->load_function('gateway');
$whmcs->load_function('invoice');

$GATEWAY = getGatewayVariables("customgateway");
if (!$GATEWAY["type"]) die("Module Not Activated");


 

I don't know what is happening.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Here is a piece of response I get if I don't use the whmcs function :

Quote

paymentMeanType=CARD|complementaryCode=00|complementaryInfo=,CARD_COUNTRY=FRA,|scoreProfile=profil1

And if I use the whmcs function I get 

 

Quote

paymentMeanType=CARD|complementaryCode=00|complementaryInfo=<RULE_RESULT CR=0 />,CARD_COUNTRY=FRA,<CARD_INFOS BDOM=XXX COUNTRY=FRA PRODUCTCODE=2 NETWORK=CB BANKCODE=20041 PRODUCTNAME=CB 3DS VIS PRODUCTPROFILE=D />|scoreProfile=profil1

As you can see, the complementary key got some new value.

 

To compare the seal, I have the original Seal in

$_POST['Seal']

To recreate the Seal I build it as follow :

 

$seal = hash('sha256', utf8_encode($Data).$secretKey);

So the data is altered then my seal to. How can I fix it ?

Link to comment
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
Answer this question...

×   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