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

No error message shown #27

Open
ashussen opened this issue Aug 7, 2018 · 3 comments
Open

No error message shown #27

ashussen opened this issue Aug 7, 2018 · 3 comments

Comments

@ashussen
Copy link

ashussen commented Aug 7, 2018

Hi everyone,

I have been working with this code for a while and still couldn't figure out what is the problem with it.

Maybe some of the code has a problem, but Omnipay didn't show anything as the error message.

Can anyone please help me find out my mistakes, and make this work?

        $gateway = Omnipay::create('Eway_RapidDirect');
        write_log($gateway->getDefaultParameters());
        $gateway->initialize([
            'apiKey' => 'API KEY',
            'password' => 'PASSWORD',
            'testMode' => true
        ]);

       $card = new CreditCard([
          'number' => '4444333322221111',
          'expiryMonth' => '6',
          'expiryYear' => '2030',
          'cvn' => '123'
         ]
       );

       $transaction = $gateway->purchase([
           'amount'        => '10.00',
           'currency'      => 'AUD',
           'transactionId' => 'RAM0001',
           'card'          => $card,
         ]
       );

       $response = $transaction->send();
       if ($response->isSuccessful()) {
           write_log('success');
       } else {
           write_log('failed');
           write_log($response->getMessage());
       }

The code always print

[07-Aug-2018 09:07:01 UTC] failed
[07-Aug-2018 09:07:01 UTC]

Thanks before.

@incarnate
Copy link
Contributor

Hi @ashussen

Thanks for raising this issue. After a bit of digging it turns out that in the v3 upgrade the authorisation line got removed from the request. So the transaction is failing with an authorisation failure (which the Omnipay library also isn't handling gracefully).

Putting the auth back is fairly straight forward, I'll try and find some time this weekend to put it back - unless someone else would like a shot.

@ashussen
Copy link
Author

@incarnate Awesome!

Thank you for your help. I end up using eWay default API.
But it would be great if this can be fixed so that we can uniform all types of transaction process.

@incarnate
Copy link
Contributor

Version 3.0.1 has been released which resolves this issue (PR #28)

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