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 when using createCard() #25

Open
adamjgriffith opened this issue Aug 22, 2019 · 1 comment
Open

Fatal error when using createCard() #25

adamjgriffith opened this issue Aug 22, 2019 · 1 comment

Comments

@adamjgriffith
Copy link

adamjgriffith commented Aug 22, 2019

Fatal error: Uncaught Error: Call to undefined method Omnipay\Cybersource\Message\CreateCardRequest::getCardData() in /vendor/dioscouri/omnipay-cybersource/src/Message/CreateCardRequest.php:18
Stack trace:
#0 /vendor/omnipay/common/src/Common/Message/AbstractRequest.php(732): Omnipay\Cybersource\Message\CreateCardRequest->getData()
#1 /CreateCard.php(95): Omnipay\Common\Message\AbstractRequest->send()
try {
    $gateway = Omnipay::create('Cybersource');

    $gateway->setProfileId('REDACTED');
    $gateway->setAccessKey('REDACTED');
    $gateway->setSecretKey('REDACTED');
    $gateway->setCurrency('GBP');

    if (isDevelopment()) {
        $gateway->setTestMode(TRUE);
    }

    $cardOptions = array(
        'firstName' => 'John',
        'lastName' => 'Doe',
        'number' => '4111111111111111',
        'expiryMonth' => '12',
        'expiryYear' => '2022',
        ...
    );

    $options = array(
        'card' => $cardOptions,
        ...
    );

    $request = $gateway->createCard($options);

    $response = $request->send();

    if ($response->isSuccessful()) {

    } elseif ($response->isRedirect()) {
        $response->redirect();
    } else {
        exit($response->getMessage());
    }
} catch ($e) {
    exit('Sorry, there was an error processing your payment. Please try again later.');
}
@adriangordon1231
Copy link

adriangordon1231 commented Jul 21, 2020

Following the strack-trace, the "send" function triggers a "getData" function which in turn triggers a function that has not actually been implemented in the library called "getCardData". This library does not seem to support tokenization.

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