paynl / magento2-plugin

The Pay. plugin for Magento 2
https://www.pay.nl
27 stars 31 forks source link

Fix terminal in use #196

Closed indykoning closed 5 months ago

indykoning commented 5 months ago

Because (new PayPaymentCreate($order, $this))->create() already creates a new transaction and triggers the pin terminal the subsequent \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]) fails with the message: PAY-9206 - Terminal in use

However this 2nd payment call does not seem necessary, not even to get all required data since transaction start already returns the following data:

{
    "request": {
        "result": "1",
        "errorId": "",
        "errorMessage": ""
    },
    "endUser": {
        "blacklist": "0"
    },
    "transaction": {
        "transactionId": "XXXXXXXXXXX",
        "paymentURL": "https:\/\/safe.pay.nl\/pin\/xxxxxxxxxxxxxxxxxxx\/NL",
        "popupAllowed": "0",
        "paymentReference": "0000 0000 0000 0000"
    },
    "terminal": {
        "hash": "0000000000000aaaaaaaaaaaaaaaa",
        "statusUrl": "https:\/\/pin.pay.nl:9002\/api\/status?hash=0000000000000aaaaaaaaaaaaaaaa&timeout=5",
        "cancelUrl": "https:\/\/pin.pay.nl:9002\/api\/cancel?hash=0000000000000aaaaaaaaaaaaaaaa"
    }
}
woutse commented 5 months ago

Thanks for your PR. Question though, what payment method ID did you use?

woutse commented 5 months ago

We found the problem and going to make a change for this through another channel, based on this pull request. This pull request wil therefore be closed. Thanks again for your pull request.