eWAYPayment / eway-rapid-php

Eway Rapid PHP library
https://www.eway.com.au
MIT License
14 stars 24 forks source link

Duplicate Transactions #14

Closed sumbria closed 5 years ago

sumbria commented 6 years ago

Hello there, Each time the user tries to create a transaction from the Firefox browser, a duplicate transaction occurs. On other browsers, everything is working fine.

Here is the code:

      $apiEndpoint = \Eway\Rapid\Client::MODE_PRODUCTION;
       $client = \Eway\Rapid::createClient(env('EWAY_API_KEY'), env('EWAY_API_PASSWORD'), $apiEndpoint);
        $transaction = [
            'Customer' => [
                'FirstName' => $firstname,
                'LastName' => $lastname,
                'Email' => $email,
                'CardDetails' => [
                    'Name' => $nameoncard,
                    'Number' => $cardnumber,
                    'ExpiryMonth' => $expiry_m,
                    'ExpiryYear' => $expiry_y,
                    'CVN' => $ccv,
                ],
            ],
            'Payment' => [
                'TotalAmount' => $sub_total * 100,
                'InvoiceNumber' => date('YmdHis'),
                'InvoiceDescription' => 'Description',
            ],
            'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE,
        ];
        $response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);

Attached is the screenshot of duplicate transactions. The transaction time is also the same. duplicate_transactions

incarnate commented 6 years ago

Hi @sumbria

If the issue only affects one browser it is likely to be a problem in the client side code rather than the server side PHP SDK.

The best place to start would be to have a look in the Firefox network inspector to see if multiple requests are being made to your payment endpoint. If you still need help resolving the issue, please get in touch with the friendly eWAY customer care team.