Skip to content

Get Transaction ID although exception is thrown #136

@wittfabian

Description

@wittfabian

Hi,

I use the following code to generate a transaction:

try{
            $paymillRequest = new Paymill\Request( 'PAYMILL_PRIVATE_KEY' );
            $transaction = new Paymill\Models\Request\Transaction();
            $transaction->setAmount('1000')
                        ->setPayment('paymill_payment_id')
                        ->setCurrency('EUR')
                        ->setClient('paymill_client_id')
                        ->setDescription('Premium XYZ');
            $response = $paymillRequest->create($transaction);

        } catch(Exception $e){ 
syslog(....)
}

Tonight I got the following error. According to the webhook, the transaction was created and then failed. The problem is, I am not getting a transaction number at the creation step, because an exception is thrown. The error itself is clear, by the way.

Paymill\Services\PaymillException' with message 'Card blacklisted.' in /.../paymill/paymill/lib/Paymill/Request.php:264
Stack trace:
#0 /.../paymill/paymill/lib/Paymill/Request.php(81): Paymill\Request->_request(Object(Paymill\Models\Request\Transaction), 'create')
#1 /../: Paymill\Request->create(Object(Paymill\Models\Request\Transaction))
#2 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions