Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught Error: Undefined class constant 'DBNORDEAFI' #89

Closed
timint opened this issue Jul 12, 2021 · 2 comments
Closed

Fatal error: Uncaught Error: Undefined class constant 'DBNORDEAFI' #89

timint opened this issue Jul 12, 2021 · 2 comments

Comments

@timint
Copy link

timint commented Jul 12, 2021

I am unable to perform a specific test with Nordea Finland. I am told to use DBNORDEAFI.

$response = $swp->usePaymentMethod(\Svea\WebPay\Constant\PaymentMethod::DBNORDEAFI)

Fatal error: Uncaught Error: Undefined class constant 'DBNORDEAFI'

For the full set of code:

      try {

        require_once FS_DIR_APP . 'ext/sveawebpay/autoloader.php';

        $config = Svea\WebPay\Config\ConfigurationService::getTestConfig();

        $swp = Svea\WebPay\WebPay::createOrder($config);

        $swp->addCustomerDetails(....);

        $swp->addOrderRow($orderRows);

          $response = $swp->usePaymentMethod(\Svea\WebPay\Constant\PaymentMethod::DBNORDEAFI)
                    ->setPayPageLanguage($order->data['language_code'])
                    ->setReturnUrl(document::ilink('order_process'))
                    ->setCancelUrl(document::ilink('checkout'))
                    ->getPaymentUrl();

      } catch ( \Exception $e ) {
        die($e->getMessage());
      }

Using the following test account:

    'commonCredentials' => array(
        'merchantId' => '6708',
        'secret' => 'a1.........................................................31'
    ),
@alexanderwiden95
Copy link
Collaborator

Hi,

If you'd like to use "DBNORDEAFI" you either enter it directly or use the constant \Svea\WebPay\Constant\PaymentMethod::NORDEA_FI

$order->usePaymentMethod(\Svea\WebPay\Constant\PaymentMethod::NORDEA_FI);

or

$order->usePaymentMethod('DBNORDEAFI');

The constants can be seen here:
https://github.com/sveawebpay/php-integration/blob/master/src/Constant/PaymentMethod.php#L20

@timint
Copy link
Author

timint commented Jul 13, 2021

Thank you. Confirmed that the following works:

$order->usePaymentMethod(\Svea\WebPay\Constant\PaymentMethod::NORDEA_FI);

You should put ALL the definitions in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants