{"id":37010239,"url":"https://github.com/lesterchan/gp-php-sdk","last_synced_at":"2026-01-14T00:59:08.392Z","repository":{"id":62516872,"uuid":"202459465","full_name":"lesterchan/gp-php-sdk","owner":"lesterchan","description":"GP PHP SDK","archived":false,"fork":false,"pushed_at":"2019-08-16T04:02:03.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-09T04:37:24.123Z","etag":null,"topics":["gp","php-sdk"],"latest_commit_sha":null,"homepage":"https://github.com/lesterchan/gp-php-sdk-sample","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesterchan.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":"2019-08-15T02:26:49.000Z","updated_at":"2019-08-16T04:02:05.000Z","dependencies_parsed_at":"2022-11-02T13:31:19.605Z","dependency_job_id":null,"html_url":"https://github.com/lesterchan/gp-php-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lesterchan/gp-php-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesterchan%2Fgp-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesterchan%2Fgp-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesterchan%2Fgp-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesterchan%2Fgp-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesterchan","download_url":"https://codeload.github.com/lesterchan/gp-php-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesterchan%2Fgp-php-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","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":["gp","php-sdk"],"created_at":"2026-01-14T00:59:06.577Z","updated_at":"2026-01-14T00:59:08.339Z","avatar_url":"https://github.com/lesterchan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GP PHP SDK\nThe GP SDK for PHP provides a native interface to the GP API.\nThis is still a work in progress (WIP) project and hence it will be on the master branch.\n\n# Installation\n```bash\ncomposer require lesterchan/gp-php-sdk\n```\n# Usage\n## OAuth\n### Generate a web URL that provides a web interface for OAuth authentication.\nThis helps the end-user login or register for GP.\n```php\n/**\n * @param string $codeVerifier Code verifier\n * @param string $requestToken Request token\n * @param string $redirectUri Redirect URI\n * @param string $scope Scope (payment.one_time_charge or payment.recurring_charge)\n */\n$gp-\u003egetOauthAuthorizeUrl($codeVerifier, $requestToken, $redirectUri, $scope);\n```\n### Generate the oauth token by passing ​code​ received in the return URL from GP.\n```php\n/**\n * @param string $code Code\n * @param string $redirectUri Redirect URI\n * @param string $codeVerifier Code verifier\n */\n$gp-\u003egetAccessToken($code, $redirectUri, $codeVerifier);\n```\n## One-Time Charge\n### Initialise.\n```php\n/**\n * @param string $partnerId Partner ID\n * @param string $partnerSecret Partner Secret\n * @param string $clientId Client ID\n * @param string $clientSecret Client Secret\n * @param string $merchantId Merchant ID\n */\n$gp = new GP\\OneTimeCharge($partnerId, $partnerSecret, $clientId, $clientSecret, $merchantId);\n```\n### Set up the details required to initiate a one-time payment.\n```php\n/**\n * @param string $txId order ID\n * @param string $groupTxId partner transaction ID\n * @param int $amount ​Transaction amount as integer\n * @param string $description description of the charge (optional)\n */\n$gp-\u003einitCharge($txId, $groupTxId, $amount, $description);\n```\n### Complete the payment authorised by the user.\n```php\n/**\n * @param string $accessToken OAuth access token\n * @param string $partnerTxId partner transaction ID\n */\n$gp-\u003ecompleteCharge($accessToken, $partnerTxId);\n```\n\n## Tokenization\n### Initialise.\n```php\n/**\n * @param string $partnerId Partner ID\n * @param string $partnerSecret Partner Secret\n * @param string $clientId Client ID\n * @param string $clientSecret Client Secret\n * @param string $merchantId Merchant ID\n */\n$gp = new GP\\Tokenization($partnerId, $partnerSecret, $clientId, $clientSecret, $merchantId);\n```\n### Initiate the binding process with customer credits.\n```php\n/**\n * @param string $txId order ID\n */\n$gp-\u003ebind($txId);\n```\n### Charge a customer who has completed the bind process with GP.\n```php\n/**\n * @param string $accessToken OAuth access token\n * @param string $txId order ID\n * @param string $groupTxId partner transaction ID\n * @param int $amount ​Transaction amount as integer\n * @param string $description description of the charge (optional)\n */\n$gp-\u003echarge($accessToken, $txId, $groupTxId, $amount, $description);\n```\n### Deactivate the token generated during the binding process.\n```php\n/**\n * @param string $accessToken OAuth access token\n * @param string $txId order ID\n */\n$gp-\u003eunbind($accessToken, $txId);\n```\n### View the wallet balance of the bound user.\n```php\n/**\n * @param string $accessToken OAuth access token\n */\n$gp-\u003egetWalletInfo($accessToken);\n```\n\n## Status/Refunds\n### Check the status of a transaction.\n```php\n/**\n * @param string $accessToken OAuth access token\n * @param string $txId order ID\n */\n$gp-\u003echeckChargeStatus($accessToken, $txId);\n```\n### Refund a full or partial refunds for a specific transaction.\n```php\n/**\n * @param string $accessToken OAuth access token\n * @param string $txId order ID\n * @param string $groupTxId partner transaction ID\n * @param string $originTxID original partner transaction ID\n * @param int $amount ​Transaction amount as integer\n * @param string $description description of the charge (optional)\n */\n$gp-\u003erefund($accessToken, $txId, $groupTxId, $originTxID, $amount, $description);\n```\n### Check the status of a refund transaction.\n```php\n/**\n * @param string $accessToken OAuth access token\n * @param string $txId order ID\n */\n$gp-\u003echeckRefundStatus($accessToken, $txId);\n```\n\n## POS\n### Initialise.\n```php\n/**\n * @param string $partnerId Partner ID\n * @param string $partnerSecret Partner Secret\n * @param string $merchantId Merchant ID\n * @param string $terminalId Terminal ID\n */\n$gp = new GP\\Pos($partnerId, $partnerSecret, $merchantId, $terminalId);\n```\n### Creates a payment order and returns a QR code.\n```php\n/**\n * @param string $txId order ID\n * @param int $amount ​Transaction amount as integer\n */\n$gp-\u003ecreateMerchantPresentQrCode($txId, $amount);\n```\n### Performs a payment transaction which charges from the wallet associated with the request QR code.\n```php\n/**\n * @param string $txId order ID\n * @param int $amount ​Transaction amount as integer\n * @param string $qrCode QR code being scanned\n */\n$gp-\u003eperformConsumerPresentQrCode($txId, $amount, $qrCode);\n```\n### Returns details for a payment transaction or refund transaction.\n```php\n/**\n * @param string $txId order ID\n */\n$gp-\u003eqrCodeInquiry($txId);\n```\n### Cancels a pending payment.\n```php\n/**\n * @param string $origTxID Original order ID\n */\n$gp-\u003ecancelTransaction($origTxID);\n```\n### Refunds a previously successful payment.\n```php\n/**\n * @param string $txID order ID\n * @param string $origTxID Original order ID\n * @param int $amount ​Transaction amount as integer\n */\n$gp-\u003erefundTransaction($txID, $origTxID, $amount);\n```\n\n## Others\n### By default, the SDK will be using Staging URL. To switch to Production URL, use:\n```php\n$gp-\u003euseProduction();\n```\n### Defaults to SG. Accepted values are SG, MY, VN, PH, and TH.\n```php\n/**\n * @param string $countryCode Country code (alpha-2)\n */\n$gp-\u003esetCountryCode($countryCode);\n```\n### Defaults to SGD. Accepted values are SGD, MYR, VND, PHP, and THB.\n```php\n/**\n * @param string $currency Currency\n */\n$gp-\u003esetCurrency($currency);\n```\n### Generate nonce.\n```php\n/**\n * @param int $length Length\n */\n$gp-\u003egenerateNonce($length);\n```\n\nPlease refer to the [GP PHP SDK Sample Code Repository](https://github.com/lesterchan/gp-php-sdk-sample) for some sample codes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesterchan%2Fgp-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesterchan%2Fgp-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesterchan%2Fgp-php-sdk/lists"}