gopaycommunity / gopay-php-api

GoPay's PHP SDK for Payments REST API
MIT License
81 stars 38 forks source link

500 Internal Server Error #28

Closed krehak closed 6 years ago

krehak commented 6 years ago

I have this code:

$gopay = GoPay\payments(array(
    'goid' => GOPAY_GOID,
    'clientId' => GOPAY_CLIENT_ID,
    'clientSecret' => GOPAY_CLIENT_SECRET,
    'isProductionMode' => false,
    'scope' => TokenScope::ALL,
    'language' => Language::SLOVAK,
    'timeout' => 30,
));

$response = $gopay->createPayment(array(
    'payer' => array(
        'default_payment_instrument' => PaymentInstrument::PAYMENT_CARD,
        'allowed_payment_instruments' => array(PaymentInstrument::PAYMENT_CARD, PaymentInstrument::GOPAY),
        'contact' => ...,
    ),
    'amount' => $total,
    'currency' => Currency::EUROS,
    'order_number' => $orderId,
    'order_description' => $orderName,
    'items' => ...,
    'lang' => 'sk',
    'callback' => array(
        'return_url' => CALLBACK_URL,
        'notification_url' => CALLBACK_URL
    )
));

This is what I get:

GoPay\Http\Response Object
(
    [rawBody:GoPay\Http\Response:private] => Server error: `POST https://gw.sandbox.gopay.com/api/payments/payment` resulted in a `500 Internal Server Error` response:
{"date_issued":"2018-05-10T11:06:52.208+0200","errors":[{"scope":"G","error_code":500}]}

    [statusCode] => 
    [json] => Array
        (
        )

    [status_code] => 500
)

What's wrong? There is nothing in the response telling me what I'm missing.

gopayprovoz commented 6 years ago

Hello, thank you for your message. Please send us complete dump of your request (without using variables) on e-mail integrace@gopay.cz. Best regards