Jump to content
  • 0
Executable

Gateway callback, seal being altered with whmcs function

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.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Would need more info unfortunately.  How is the data changed exactly and how is the seal being verified? 

Share this post


Link to post
Share on other sites
  • 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 ?

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