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

Validating transaction is throwing Application error via PHP SDK #64

Open
dersure opened this issue Sep 18, 2023 · 0 comments
Open

Validating transaction is throwing Application error via PHP SDK #64

dersure opened this issue Sep 18, 2023 · 0 comments
Assignees
Labels

Comments

@dersure
Copy link

dersure commented Sep 18, 2023

Hello I am trying to make a Direct Card Charge via the PHP SDK but getting Error: Undefined constant Flutterwave\Helper\Config::BASE_URL in /Users/andre/Desktop/Workspace/saas-manager/vendor/flutterwavedev/flutterwave-v3/src/Service/Transactions.php:34

When I passed a custom config with the base url to constant to Flutterwave\Service\Transactions class, it then throws an ArgumentCountError: Too few arguments to function Flutterwave\EventHandlers\TransactionVerificationEventHandler::__construct(), 0 passed in /Users/andre/Desktop/Workspace/saas-manager/vendor/flutterwavedev/flutterwave-v3/src/Service/Transactions.php on line 36 and exactly 1 expected in /Users/andre/Desktop/Workspace/saas-manager/vendor/flutterwavedev/flutterwave-v3/src/EventHandlers/TransactionVerificationEventHandler.php:17

MY PHP CODE BELOW:

    public function validate(string $ref, string|int $otp): string
    {
        $res = (new Transactions())->validate($otp, $ref);

        if ($res->status === 'success') {
            return "Your payment status: " . $res->processor_response;
        }
    }
@Abraham-Flutterwave Abraham-Flutterwave self-assigned this Sep 18, 2023
Abraham-Flutterwave referenced this issue Oct 15, 2023
The Transaction Service no longer requires a separate event handler as it not has the trait of a event handler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants