D
D
dake12312019-10-07 08:00:12
PHP
dake1231, 2019-10-07 08:00:12

How to sign a request in Masterpass?

Hello everyone, the task is to connect Masterpass. So far, I only have an understanding that I will use the PHP OAuth module.
So far there is this piece:

try {
  $oauth = new OAuth('conskey',
        'conssec',
        OAUTH_SIG_METHOD_RSASHA1);
    $oauth->enableDebug();

        $requestTokenSigned = $oauth->generateSignature('POST','https://testwallet.masterpass.ru/mpapiv2/GetRequestToken', [
      'MerchantName' => 'MercantName',
            'Phone' => 'PhoneNumber'
        ]);

  $accessInfo = $oauth->getRequestToken($requestTokenSigned);

    if(!empty($accessInfo)) {
        print_r($accessInfo);
    } else {
        print "Failed fetching request token, response was: " . $oauth->getLastResponse();
    }
} catch (OAuthException $e) {
  print_r($e->getMessage());
}

I get an exception "Segmentation fault (core dumped)", which is interesting, the generateSignature() method is not highlighted in my IDE, although it is listed as public in the documentation.
Maybe I'm not doing everything right and everything is generally needed differently, I will be grateful if you direct me.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question