错误的sha1hash realexpayments?

时间:2018-05-03 08:25:01

标签: php hash sha realex-payments-api

我正在尝试设置一个付费的网络应用程序,我正在使用realexpayments sdk。现在我只是测试它是否有效。

这是错误:

Fatal error: Uncaught exception 'com\realexpayments\remote sdk\RealexServerException'with message 'incorrect sha1hash: check your code and developer's documentation' in D:\home\site\wwwroot\Composer\vendor\realexpayments\rxp-remote-php\src\main\php\com-realexpayments-remote-sdk\RealexClient.php:206 Stack trace: #0 D:\home\site\wwwroot\authorisation.php(35): com\realexpayments\remote\sdk\RealexClient->send(Object(com\realexpayments\remote\sdk\domain\payment\PaymentRequest)) #1 {main} thrown in D:\home\site\wwwroot\Composer\vendor\realexpayments\rxp-remote-php\src\main\php\com-realexpayments-remote-sdk\RealexClient.php on line 206 

这是authorisation.php:

    require_once ( 'Composer/vendor/autoload.php' );
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);

use com\realexpayments\remote\sdk\domain\Card;                                            
use com\realexpayments\remote\sdk\domain\CardType;
use com\realexpayments\remote\sdk\domain\PresenceIndicator;
use com\realexpayments\remote\sdk\domain\payment\AutoSettle;                              
use com\realexpayments\remote\sdk\domain\payment\AutoSettleFlag;
use com\realexpayments\remote\sdk\domain\payment\PaymentRequest;
use com\realexpayments\remote\sdk\domain\payment\PaymentResponse;                   
use com\realexpayments\remote\sdk\domain\payment\PaymentType;                             
use com\realexpayments\remote\sdk\RealexClient;

$card = ( new Card() )                                                            
    ->addType( CardType::VISA ) 
    ->addNumber( "4263971921001307" )                                         
    ->addExpiryDate( "1220" )
    ->addCvn( "123" )
    ->addCvnPresenceIndicator( PresenceIndicator::CVN_PRESENT )
    ->addCardHolderName( "James Mason" );                                     

$request = ( new PaymentRequest() )
    ->addMerchantId( "Merchant ID" )
    ->addAccount( "internet" )                                                  
    ->addType( PaymentType::AUTH )                                            
    ->addCard( $card )                                                                                      
    ->addAmount( 1001 )                                                         
    ->addCurrency( "EUR" )                                                    
    ->addAutoSettle( ( new AutoSettle() )->addFlag( AutoSettleFlag::TRUE ) ); 


$client   = new RealexClient( "Shared Secret" );                                     
$response = $client->send( $request );

// do something with the response
echo $response->toXML();

$resultCode = $response->getResult();
$message = $response->getMessage();

所有示例都被实际值替换。

谢谢!

1 个答案:

答案 0 :(得分:0)

在大多数情况下,sha1hash错误表示您签署请求的共享密钥不正确。

Global Payments支持团队的成员将能够帮助您确认共享密钥。

最佳,

肖恩

全球付款