gopay-php-api icon indicating copy to clipboard operation
gopay-php-api copied to clipboard

Error after upgrading 1.7.0 to 1.7.3

Open MKI-Miro opened this issue 1 year ago • 4 comments

Hi

I have this error after Error after upgrading 1.7.0 to 1.7.3:

[2023-12-24 13-21-44] PHP Warning: Undefined array key "gatewayUrl" in endor/gopay/payments-sdk-php/src/GoPay.php:42 @ /order/status?id=117885 [2023-12-24 13-21-44] PHP Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in endor/gopay/payments-sdk-php/src/GoPay.php:42 @ /order/status?id=117885 [2023-12-24 13-21-45] PHP Warning: Undefined array key "gatewayUrl" in endor/gopay/payments-sdk-php/src/GoPay.php:28 @ /order/status?id=117885 [2023-12-24 13-21-45] PHP Warning: Undefined array key "gatewayUrl" in endor/gopay/payments-sdk-php/src/GoPay.php:42 @ /order/status?id=117885 [2023-12-24 13-21-45] PHP Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in endor/gopay/payments-sdk-php/src/GoPay.php:42 @ /order/status?id=117885 [2023-12-24 13-21-45] GoPay Response: @ /order/status?id=117885 [2023-12-24 13-21-45] GoPay\Http\Response #230 rawBody: 'cURL error 3: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for /api/oauth2/token' statusCode: 500 json: array (0) @ /order/status?id=117885

How to fix it?

MKI-Miro avatar Dec 24 '23 12:12 MKI-Miro

Some information on Slack from Rixafy

Api url payment gateway for production is https://gate.gopay.cz/api and for sandbox https://gw.sandbox.gopay.com/api

tomas-kulhanek avatar Feb 28 '24 17:02 tomas-kulhanek

cc @MKI-Miro

tomas-kulhanek avatar Feb 28 '24 17:02 tomas-kulhanek

I am sorry I dont understand. It works on 1.7.0 but not on 1.7.3 without any change in code. I am not changing urls

MKI-Miro avatar Mar 08 '24 20:03 MKI-Miro

@MKI-Miro


//sandbox
$gopay = GoPay\Api::payments([
    'goid' => 'my goid',
    'clientId' => 'my id',
    'clientSecret' => 'my secret',
    'gatewayUrl' => 'https://gw.sandbox.gopay.com/api',
    'scope' => GoPay\Definition\TokenScope::ALL,
    'language' => GoPay\Definition\Language::CZECH,
    'timeout' => 30
]);

//production

$gopay = GoPay\Api::payments([
    'goid' => 'my goid',
    'clientId' => 'my id',
    'clientSecret' => 'my secret',
    'gatewayUrl' => 'https://gate.gopay.cz/api',
    'scope' => GoPay\Definition\TokenScope::ALL,
    'language' => GoPay\Definition\Language::CZECH,
    'timeout' => 30
]);

You must change input argument for GoPay\Api::payments and specify gatewayUrl

tomas-kulhanek avatar May 15 '24 08:05 tomas-kulhanek

@MKI-Miro Is everything clear? Can we close this?

geeshta avatar Aug 26 '24 14:08 geeshta

@geeshta I think you can close this.

tomas-kulhanek avatar Aug 27 '24 08:08 tomas-kulhanek

yes you can close

MKI-Miro avatar Aug 28 '24 09:08 MKI-Miro