{"id":36985872,"url":"https://github.com/granam/gpwebpay","last_synced_at":"2026-01-13T23:03:45.992Z","repository":{"id":62512266,"uuid":"82047604","full_name":"granam/gpwebpay","owner":"granam","description":"GPWebPay payment gateway via PHP","archived":false,"fork":true,"pushed_at":"2021-08-30T07:35:30.000Z","size":13906,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-21T12:28:57.009Z","etag":null,"topics":["gateway","gpwebpay","payment","php","php7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Pixidos/GPWebPay","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/granam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T10:15:29.000Z","updated_at":"2022-08-02T09:39:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/granam/gpwebpay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/granam/gpwebpay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granam%2Fgpwebpay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granam%2Fgpwebpay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granam%2Fgpwebpay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granam%2Fgpwebpay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/granam","download_url":"https://codeload.github.com/granam/gpwebpay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/granam%2Fgpwebpay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28403792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gateway","gpwebpay","payment","php","php7"],"created_at":"2026-01-13T23:03:45.335Z","updated_at":"2026-01-13T23:03:45.979Z","avatar_url":"https://github.com/granam.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPWebPay interface\n\n[![Build Status](https://travis-ci.org/jaroslavtyc/granam-gpwebpay.svg?branch=master)](https://travis-ci.org/jaroslavtyc/granam-gpwebpay)\n[![Test Coverage](https://codeclimate.com/github/jaroslavtyc/granam-gpwebpay/badges/coverage.svg)](https://codeclimate.com/github/jaroslavtyc/granam-gpwebpay/coverage)\n[![Latest Stable Version](https://poser.pugx.org/granam/gpwebpay/v/stable)](https://packagist.org/packages/granam/gpwebpay)\n[![License](https://poser.pugx.org/granam/gpwebpay/license)](https://packagist.org/packages/granam/gpwebpay)\n\nGPWebPay is a PHP library for online payments via [GPWebPay service](http://www.gpwebpay.cz/en)\n\nIf you are using [Nette framework](https://nette.org/en/), you may want\n[Pixidos/GPWebPay](https://github.com/Pixidos/GPWebPay) Nette extension instead.\n\n## Quickstart\n\n### Set up \u0026 usage\n\n```php\n\u003c?php\nnamespace Foo\\Bar;\n\nuse Granam\\GpWebPay\\Settings;\nuse Granam\\GpWebPay\\DigestSigner;\nuse Granam\\GpWebPay\\CardPayResponse;\nuse Granam\\GpWebPay\\Codes\\CurrencyCodes;\nuse Alcohol\\ISO4217 as IsoCurrencies;\nuse Granam\\GpWebPay\\CardPayRequestValues;\nuse Granam\\GpWebPay\\CardPayRequest;\nuse Granam\\GpWebPay\\Exceptions\\GpWebPayErrorByCustomerResponse;\nuse Granam\\GpWebPay\\Exceptions\\GpWebPayErrorResponse;\nuse Granam\\GpWebPay\\Exceptions\\ResponseDigestCanNotBeVerified;\nuse Granam\\GpWebPay\\Exceptions\\Exception as GpWebPayException;\n\n// SET UP\n$settings = Settings::createForProduction(\n    __DIR__ . '/foo/bar/your_private_key_downloaded_from_gp_web_pay.pem',\n    'TopSecretPasswordForPrivateKey',\n    __DIR__ . '/foo/bar/gp_web_pay_server_public_key_also_downloaded_from_gp_web_pay.pem',\n    '123456789' // your 'merchant number' given to you by GP WebPay\n    null // without explicit URL for response the current will be used - INCLUDING query string\n);\n$digestSigner = new DigestSigner($settings);\n\n// RESPONSE\nif (count($_POST) \u003e 0) {\n    try {\n        $response = CardPayResponse::createFromArray($_POST, $settings, $digestSigner);\n    } catch (GpWebPayErrorByCustomerResponse $gpWebPayErrorByCustomerResponse) {\n        // some pretty error box for customer information about HIS mistake (for example \"an invalid card number\")\n        /**\n         * WARNING: do not rely blindly on this detection - for example if YOU (developer) are sending\n         * card number in a hidden field, because the customer provided it to its account before and\n         * does not need to enter it again, but the card number has been refused by GP WebPay,\n         * you will show to the customer confusing message about an invalid card number,\n         * although he does not enter it.\n         * For full list of auto-detected customer mistakes @see GpWebPayErrorByCustomerResponse::isErrorCausedByCustomer\n         */\n        echo $gpWebPayErrorByCustomerResponse-\u003egetLocalizedMessage();\n    } catch (GpWebPayErrorResponse $gpWebPayErrorResponse) {\n        /* GP WebPay refuses request by YOUR (developer) mistake (for example \"a duplicate order number\")\n         * - show an apology to the customer and log this, solve this */\n    } catch (ResponseDigestCanNotBeVerified $responseDigestCanNotBeVerified) {\n        /* values in response have been changed(!),\n         * show an apology (or a warning?) to the customer and probably log this for an evidence */\n    } catch (GpWebPayException $gpWebPayException) { // EVERY exception share this interface\n        /* some generic error like \"processing error on GP WebPay server\",\n         * show an apology to the customer and log this, solve this (or just try again later, it happens) */\n    }\n    /**\n     * it is OK, lets process $response-\u003egetParametersForDigest();\n     * @see \\Granam\\GpWebPay\\CardPayResponse::getParametersForDigest\n     */\n} else { // REQUEST\n    $currencyCodes = new CurrencyCodes(new IsoCurrencies());\n    try {\n        $cardPayRequestValues = CardPayRequestValues::createFromArray($_POST, $currencyCodes);\n        $cardPayRequest = new CardPayRequest($cardPayRequestValues, $settings, $digestSigner);\n    } catch (GpWebPayException $exception) {\n        /* show an apology to the customer\n         * (for example \"we are sorry, our payment gateway is temporarily unavailable\") and log it, solve it */\n        exit(); // exit in the middle of a script is not a good idea - this is just a fast-and-dirty example\n    } ?\u003e\n    \u003chtml\u003e\n    \u003cbody\u003e\n        \u003c!-- some pretty recapitulation of the order --\u003e\n        \u003cform method=\"post\" action=\"\u003c?= $cardPayRequest-\u003egetRequestUrl() ?\u003e\"\u003e\n            \u003c?php foreach ($cardPayRequest as $name =\u003e $value) {\n                ?\u003e\u003cinput type=\"hidden\" name=\"\u003c?= $name ?\u003e\" value=\"\u003c?= $value ?\u003e\"\n            \u003c?php } ?\u003e\n            \u003cinput type=\"submit\" value=\"Confirm order\"\u003e\n       \u003c/form\u003e\n    \u003c/body\u003e\n    \u003c/html\u003e\n\u003c?php } ?\u003e\n```\n\n### Troubleshooting\n\nAlmost all possible error cases covers clearly by many of exceptions, but some are so nasty that they can not be covered:\n\n- after sending a request to GP WebPay you see just a logo and HTTP response code is 401\n    - probably the URL for response you provided to GP WebPay in URL parameter is not valid in the point of view of GP\n      WebPay\n        - ensure that URL exists and there is **NO redirection**, like https://www.github.com to https://github.com/\n          with trailing slash\n          (don't believe your eyes in a browser address bar, the trailing slash is often hidden there)\n\nFor tests against [testing payment gateway](https://test.3dsecure.gpwebpay.com/pgw/order.do) you can use payment card\n\n- Card number: `4056070000000008`\n- Card validity: `12/2020`\n- CVC2: `200`\n- 3D Secure password: `password`\n\n### Installation\n\n```sh\ncomposer require granam/gpwebpay\n```\n\n## Credits\n\nThis library originates from [Pixidos/GPWebPay](https://github.com/Pixidos/GPWebPay), which has same\nfunctionality, but can be used **only** as a [Nette framework](https://nette.org/en/) extension. All credits belong to\nthe original author Ondra Votava from Pixidos.\n\nNevertheless, I am grateful to him for sharing that library publicly. Please more of such people!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgranam%2Fgpwebpay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgranam%2Fgpwebpay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgranam%2Fgpwebpay/lists"}