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

Undefined constant Flutterwave\Config\PackageConfig::BASE_URL #68

Open
Corneille9 opened this issue Feb 21, 2024 · 0 comments
Open

Undefined constant Flutterwave\Config\PackageConfig::BASE_URL #68

Corneille9 opened this issue Feb 21, 2024 · 0 comments
Assignees

Comments

@Corneille9
Copy link

Description

When attempting to verify a transaction using the verifyWithTxref() method in the flutterwavedev/flutterwave-v3 package, an error occurs indicating "Undefined constant Flutterwave\Config\PackageConfig::BASE_URL". This issue arises during the initialization of the Transactions service.

Steps to Reproduce

  1. Initialize the Transactions service with the appropriate configuration using the following code:

    $transaction = new \Flutterwave\Service\Transactions(
        PackageConfig::setUp(
            ……,
            ……,
            ……,
        )
    );
    
  2. Attempt to verify the transaction using the verifyWithTxref($id) method.

Expected behaviour

The Transactions service should initialize successfully.

Actual behaviour

The error "Undefined constant Flutterwave\Config\PackageConfig::BASE_URL" occurs during the initialization of the Transactions service, specifically in the constructor at line 34: $this->baseUrl = $this->config::BASE_URL.

Configuration

  • API Version: v3
  • Environment: live
  • Language: PHP 8.1 | Laravel 10.10

Additional Information

The issue seems to stem from the constructor of the \Flutterwave\Service\Transactions class. The line $this->baseUrl = $this->config::BASE_URL attempts to access the constant BASE_URL from PackageConfig, resulting in an undefined constant error.

@Abraham-Flutterwave Abraham-Flutterwave self-assigned this Feb 21, 2024
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