Git Product home page Git Product logo

gopay-php-api's People

Contributors

bobkorinek avatar dependabot[bot] avatar dfridrich avatar florianjiri avatar geeshta avatar gopayprovoz avatar jfilla avatar jzaplet avatar matej21 avatar mki-miro avatar sojki avatar soukicz avatar standakouba avatar zdenekdrahos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gopay-php-api's Issues

Error after upgrading 1.7.0 to 1.7.3

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?

Nefunguje mi Api s http://gopay-gw:8180/gp/ na localhostu

Dle dokumnetace https://doc.gopay.com/cs/ je testovaci bazova url adresa API: https://gw.sandbox.gopay.com/api

Ale kdyz jsem patral proc se mi stale ukazuje error pri zalozeni platby: Could not resolve host: gopay-gw [statusCode] => 500 tak jsem skoncil jsem zde:
ve vendor\gopay\payments-sdk-php\src\GoPay.php fce buildUrl() ktera tvori API call
adresu s 'http://gopay-gw:8180/gp/' kdyz jsem zamenil za https://gw.sandbox.gopay.com/api vse zaclo fungovat. Muzete poradit co delam spatne? diky.

500 Internal Server Error

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.

Payment refund returns curl error - timeout

When refunding payments in the test environment I sometimes get an error from $statusResult = $this->client->refundPayment($paymentId, round($entity->amount * 100)); -> (string)$statusResult

cURL error 28: Operation timed out after 30001 milliseconds with 0 out of -1 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Subsequent payment status check shows the payment as REFUNDED.
Other operations seem to work fine and the refund call does too sometimes, but not always.

Uncaught Exception: Failed to parse time string (now + -1799 seconds)

Hi,
I have an error possibly related to daylight savings time (CET):

[Sun Oct 30 02:52:08.380692 2022] [php:error] PHP Fatal error: Uncaught Exception: Failed to parse time string (now + -1799 seconds) at position 4 (+): Unexpected character in .../vendor/gopay/payments-sdk-php/src/OAuth2.php:31\nStack trace:\n#0 .../vendor/gopay/payments-sdk-php/src/OAuth2.php(31): DateTime->__construct()\n#1 /var/www/html/mclab/account/assets/vendor/gopay/payments-sdk-php/src/Token/CachedOAuth.php(24): GoPay\\OAuth2->authorize()\n#2 .../vendor/gopay/payments-sdk-php/src/Payments.php(116): GoPay\\Token\\CachedOAuth->authorize()\n#3 .../vendor/gopay/payments-sdk-php/src/Payments.php(27): GoPay\\Payments->post()\n#4 .../index.php(109): GoPay\\Payments->createPayment()\n#5 {main}\n thrown in /.../vendor/gopay/payments-sdk-php/src/OAuth2.php on line 31, referer: ---

Guzzle 5

Aktuální verze vyžaduje Guzzle 5, který už je ale poměrně zastaralý. Pokud je cílem podporovat dávno mrtvé PHP 5.4, nebylo by lepší použít buď nějaký jiný balíček nebo udělat podporou obou verzí (tak to řeší například AWS SDK https://github.com/aws/aws-sdk-php/blob/master/composer.json)?

Aktuálně totiž GoPay sice v nové verzi podporuje historické aplikace na PHP 5.4 (zajímalo by mě, kolik jich reálně používá poslední verzi), ale my z tohoto století už neupdatujeme a musíme používat starou verzi kvůli konfliktu s aktuálním Guzzle 6

unclear changelog

It's tough to understand what was done in what version and why. The releases page on Github is missing a large number of versions and changelog.md file was not updated for two years.

The last version breaks the application with the necessity of specifying the gateway URL, but it's nearly impossible to find this information somewhere.

GoPay oops, API returned :

Installed latest plugin in shopware and entered our details. This is our log. What to do now? I've set mode to production. Do you need GoID or Cliend Id to investigate?

Fatal error: Class 'PHPUnit_Framework_TestCase' not found ...

Error

When i install gopay-php-api wia composer:

composer require gopay/payments-sdk-php

And do simple scipt like:

<?php

require_once "vendor/autoload.php";

And run it i get this error:

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in vendor/gopay/payments-sdk-php/tests/remote/GivenGoPay.php on line 9

Reason

This is because composer.json loads tests/remote/GivenGoPay.php for non-dev installation, but phpunit is installed only when dev is used.

Fix

tests/remote/GivenGoPay.php should not be autoloaded at all it is test not something we need to run from our code

CURLOPT_FOLLOWLOCATION vs open_basedir

Hello,

got this warning:

Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in /***/vendor/mashape/unirest-php/src/Unirest/Request.php on line 430

Open_basedir is pretty common on shared hosting. In fact this broke payment. Most ridiculous is that, it's look like we don't need this option set to TRUE, or not? What's optimal fix for this issue?

Super ❤

Krásná dokumentace i třída... velmi chválím!
Vše funguje jak má!
Toto opravdu není zvykem 👍 ❤

When the $response is unsuccessful, $response->json is an object instead of an array

$response->json = json_decode($e->getResponse()->getBody());

The documentation promises that $response->json is an associative array. But if the response is unsuccessful, $response->json is an object (of stdClass).

In the line above, json_decode() is missing its second argument.

The potential bugfix breaks compatibility for all who process Gopay response errors.

Edit: Ahh, I see the same issue is mentioned in #21

composer guzzle 6

I have guzzle 6.3.0
may be you must use double pipe in composer.json

- Installation request for gopay/payments-sdk-php ^1.3 -> satisfiable by gopay/payments-sdk-php[v1.3.0].
- gopay/payments-sdk-php v1.3.0 requires guzzlehttp/guzzle ~5.0 -> satisfiable by guzzlehttp/guzzle[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.x-dev] but these conflict with your requirements or minimum-stability.

Nefunkční neprodukční prostředí v Symfony

Problém: Při nastavení isProductionMode na false se použije produkční prostředí v novém Symfony, které používá .env na konfiguraci.

Proč: Ve třídě GoPay v metodě buildUrl() na řádku 49 se používá (bool)$this->getConfig('isProductionMode'). To je v novém symfony problém, protože parametry z .env souboru jsou by default přetypovány na string a (bool) 'false' vrací true. Samozřejmě programátor může pole přetypovat, ale není to moc typické a v Symfony dokumentaci je to docela utopené.

Řešení: Předělat funkci buildUrl například takto. Pravděpodobně se najde i hezčí řešení.

public function buildUrl($urlPath)
    {
        $isProductionMode = $this->getConfig('isProductionMode');
        if (!(bool) $isProductionMode || $isProductionMode === 'false') {
            return 'https://gw.sandbox.gopay.com/';
        } 
        
        return 'https://gate.gopay.cz/';
    }

Údaje o zákazníkovi

Dobrý den,

nevím kde jinde se zeptat, takže píšu sem.
Proč GoPay chce údaje o zákazníkovi při vytvoření platby(hlavně jméno, příjemní, adresa, telefon)?
Ptám se kvůli GDPR a popř. jak to řešit.

Díky

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.