Skip to content

No error message shown #27

@ashussen

Description

@ashussen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions