globalpayments / php-sdk

GNU General Public License v2.0
49 stars 66 forks source link

Unexpected Gateway Response: 505 - sha1hash incorrect #92

Closed shahzaibanwar009 closed 9 months ago

shahzaibanwar009 commented 3 years ago

i'm using these credentials

card_number =4263970000005262 exp_month=12 exp_year=2025 cvn=131 card_holder_name = James Mason

$config = new GpEcomConfig(); $config->merchantId = ""; $config->accountId = "internet"; $config->sharedSecret = ""; $config->serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi"; ServicesContainer::configureService($config);

$card = new CreditCardData(); $card->number = $request->card_number ?? ''; $card->expMonth = (int) $request->exp_month ?? ''; $card->expYear = (int) $request->exp_year ?? ''; $card->cvn = $request->cvn ?? ''; $card->cardHolderName = $request->card_holder_name ?? ''; $card->cardType = 'Visa';

    $response = $card->charge(19.99)
            ->withCurrency("EUR")
            ->execute();
cristina-nechita commented 3 years ago

Hello,

The merchantId, secret and the card number (among others) are used in the hash generation. Please check that you have valid information on those keys. You can find a working unit test here if it helps: https://github.com/globalpayments/php-sdk/blob/master/test/Integration/Gateways/RealexConnector/ApiCaseTest.php#L42