globalpayments / php-sdk

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

Unable to process gift cards #100

Open 7ingyu opened 2 years ago

7ingyu commented 2 years ago
GlobalPayments\Api\Entities\Exceptions\GatewayException {#2285
  +responseCode: "51"
  +responseMessage: "Processor Configuration error. Subject 'GiftCardSale'."
  #message: "Unexpected Gateway Response: 51 - Processor Configuration error. Subject 'GiftCardSale'.. "
  #code: 0
  #file: "/home/vagrant/kitchmeals/vendor/globalpayments/php-sdk/src/Gateways/PorticoConnector.php"
  #line: 1252
  trace: {
    /home/vagrant/kitchmeals/vendor/globalpayments/php-sdk/src/Gateways/PorticoConnector.php:1252 {
      GlobalPayments\Api\Gateways\PorticoConnector->mapResponse($rawResponse, BaseBuilder $builder, $request) …
      › if (!in_array($gatewayRspCode, $acceptedCodes)) {
      ›     throw new GatewayException(
      ›         sprintf(
    }

Same error if I try anything else but it will just change Subject 'GiftCardSale' to 'GiftCardAddValue', etc.

My code if that helps:

        $config = new PorticoConfig();
        $config->secretApiKey = env('PAYMENT_SECRET_KEY');
        ServicesContainer::configureService($config);

        $card = new GiftCard();
            $card->number = $number;

        $response = $card->charge($amount)
            ->withCurrency("USD")
            ->execute();

Anyone know what Processor Configuration error means and how I can fix it?

Screenshot from 2022-05-12 21-12-03 Screenshot from 2022-05-12 21-12-22

slogsdon commented 2 years ago

@7ingyu This is typically caused by not having gift support enabled on your sandbox account. Please reach out to OnlinePayments@heartland.us to get this configured.