{"id":27151391,"url":"https://github.com/checkout/checkout-sdk-php","last_synced_at":"2025-05-16T01:04:54.969Z","repository":{"id":39543515,"uuid":"168517219","full_name":"checkout/checkout-sdk-php","owner":"checkout","description":"Checkout SDK for PHP","archived":false,"fork":false,"pushed_at":"2025-04-17T16:46:16.000Z","size":778,"stargazers_count":52,"open_issues_count":3,"forks_count":40,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-18T07:00:24.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/checkout.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-31T11:52:24.000Z","updated_at":"2025-04-17T16:40:31.000Z","dependencies_parsed_at":"2024-01-30T11:30:36.094Z","dependency_job_id":"2376096d-6f34-4407-a526-c0ffaa51f1d0","html_url":"https://github.com/checkout/checkout-sdk-php","commit_stats":{"total_commits":202,"total_committers":19,"mean_commits":"10.631578947368421","dds":0.698019801980198,"last_synced_commit":"5d546ea7548b397c8c4f41874f4b10c362d22df9"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/checkout","download_url":"https://codeload.github.com/checkout/checkout-sdk-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-04-08T14:40:19.102Z","updated_at":"2025-05-16T01:04:54.942Z","avatar_url":"https://github.com/checkout.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Checkout.com PHP SDK\n\n[![build-status](https://github.com/checkout/checkout-sdk-php/workflows/build-master/badge.svg)](https://github.com/checkout/checkout-sdk-php/actions/workflows/build-master.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=checkout_checkout-sdk-php\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=checkout_checkout-sdk-php)\n\n[![build-status](https://github.com/checkout/checkout-sdk-php/workflows/build-release/badge.svg)](https://github.com/checkout/checkout-sdk-php/actions/workflows/build-release.yml)\n[![GitHub release](https://img.shields.io/github/release/checkout/checkout-sdk-php.svg)](https://GitHub.com/checkout/checkout-sdk-php/releases/)\n[![Latest Stable Version](https://poser.pugx.org/checkout/checkout-sdk-php/v)](https://packagist.org/packages/checkout/checkout-sdk-php)\n\n[![GitHub license](https://img.shields.io/github/license/checkout/checkout-sdk-php.svg)](https://github.com/checkout/checkout-sdk-php/blob/master/LICENSE.md)\n\n\n## Getting started\n\n\u003e **Version 3.0.0 is here!**\n\u003e  \u003cbr/\u003e\u003cbr/\u003e\n\u003e We improved the initialization of SDK making it easier to understand the available options. \u003cbr/\u003e\n\u003e Now `NAS` accounts are the default instance for the SDK and `ABC` structure was moved to a `previous` prefixes. \u003cbr/\u003e\n\u003e If you have been using this SDK before, you may find the following important changes:\n\u003e * Marketplace module was moved to Accounts module, same for classes and references.\n\u003e * In most cases, IDE can help you determine from where to import, but if you’re still having issues don't hesitate to open a [ticket](https://github.com/checkout/checkout-sdk-php/issues/new/choose).\n\n\n### :rocket: Please check in [GitHub releases](https://github.com/checkout/checkout-sdk-php/releases) for all the versions available.\n\n### :book: Checkout our official documentation.\n\n* [Official Docs (Default)](https://docs.checkout.com/)\n* [Official Docs (Previous)](https://docs.checkout.com/previous)\n\n### :books: Check out our official API documentation guide, where you can also find more usage examples.\n\n* [API Reference (Default)](https://api-reference.checkout.com/)\n* [API Reference (Previous)](https://api-reference.checkout.com/previous)\n\n#### Composer\n\n```json\n{\n  \"require\": {\n    \"php\": \"\u003e=5.6\",\n    \"checkout/checkout-sdk-php\": \"version\"\n  }\n}\n```\n\n## How to use the SDK\n\nThis SDK can be used with two different pair of API keys provided by Checkout. However, using different API keys imply using specific API features. Please find in the table below the types of keys that can be used within this SDK.\n\n| Account System | Public Key (example)                    | Secret Key (example)                    |\n|----------------|-----------------------------------------|-----------------------------------------|\n| Default        | pk_zyxwabcde123pqrstu876vwxyt           | sk_abcdef98765mnopqr4321ghijk           |\n| Previous       | pk_f3456789-ab12-cd34-ef56-7890ghijklmn | sk_hijklmn0-1234-5678-abcd-efgh98765432 |\n\nNote: sandbox keys have a `sbox_` or `test_` identifier, for Default and Previous accounts respectively.\n\n**PLEASE NEVER SHARE OR PUBLISH YOUR CHECKOUT CREDENTIALS.**\n\nIf you don't have your own API keys, you can sign up for a test account [here](https://www.checkout.com/get-test-account).\n\n\n### Default\n\nDefault keys client instantiation can be done as follows:\n\n```php\n$checkoutApi = CheckoutSdk::builder()-\u003estaticKeys()\n                    -\u003epublicKey(\"public_key\") // optional, only required for operations related with tokens\n                    -\u003esecretKey(\"secret_key\")\n                    -\u003eenvironment(Environment::sandbox()) // or production()\n                    -\u003eenvironmentSubdomain(\"subdomain\") // optional, Merchant-specific DNS name\n                    -\u003elogger($logger) //optional, for a custom Logger\n                    -\u003ehttpClientBuilder($client) // optional, for a custom HTTP client\n                    -\u003ebuild();\n\n$paymentsClient = $checkoutApi-\u003egetPaymentsClient();\n$paymentsClient-\u003erefundPayment(\"payment_id\");\n```\n\n### Default OAuth\n\nThe SDK supports client credentials OAuth, when initialized as follows:\n\n```php\n$checkoutApi = CheckoutSdk::builder()-\u003eoAuth()\n                    -\u003eclientCredentials(\"client_id\", \"client_secret\")\n                    -\u003escopes([OAuthScope::$Gateway, OAuthScope::$Vault]) // array of scopes\n                    -\u003eenvironment(Environment::sandbox()) // or production()\n                    -\u003eenvironmentSubdomain(\"subdomain\") // optional, Merchant-specific DNS name\n                    -\u003elogger($logger) //optional, for a custom Logger\n                    -\u003ehttpClientBuilder($client) // optional, for a custom HTTP client\n                    -\u003ebuild();\n\n$paymentsClient = $checkoutApi-\u003egetPaymentsClient();\n$paymentsClient-\u003erefundPayment(\"payment_id\");\n```\n\n\n### Previous\n\nIf your pair of keys matches the Previous type, this is how the SDK should be used:\n\n```php\n$checkoutApi = CheckoutSdk::builder()\n                    -\u003eprevious()\n                    -\u003estaticKeys()\n                    -\u003eenvironment(Environment::sandbox()) // or production()\n                    -\u003eenvironmentSubdomain(\"subdomain\") // optional, Merchant-specific DNS name\n                    -\u003epublicKey(\"public_key\") // optional, only required for operations related with tokens\n                    -\u003esecretKey(\"secret_key\")\n                    -\u003elogger($logger) //optional, for a custom Logger\n                    -\u003ehttpClientBuilder($client) // optional, for a custom HTTP client\n                    -\u003ebuild();\n\n$paymentsClient = $checkoutApi-\u003egetPaymentsClient();\n$paymentsClient-\u003erefundPayment(\"payment_id\");\n```\n\n### PHP Settings\n\nFor operations that require file upload (Disputes or Marketplace) the configuration `extension=fileinfo` must be enabled in the `php.ini`.\n\n## Exception handling\n\nAll the API responses that do not fall in the 2** status codes, the SDK will throw a `CheckoutApiException`.\n\nThe exception encapsulates `http_metadata` and `$error_details`, if available.\n\n## Building from source\n\nOnce you check out the code from GitHub, the project can be built using composer:\n\n```\ncomposer update\n```\n\nThe execution of integration tests require the following environment variables set in your system:\n\n* For default account systems (NAS): `CHECKOUT_DEFAULT_PUBLIC_KEY` \u0026 `CHECKOUT_DEFAULT_SECRET_KEY`\n* For default account systems (OAuth): `CHECKOUT_DEFAULT_OAUTH_CLIENT_ID` \u0026 `CHECKOUT_DEFAULT_OAUTH_CLIENT_SECRET`\n* For Previous account systems (ABC): `CHECKOUT_PREVIOUS_PUBLIC_KEY` \u0026 `CHECKOUT_PREVIOUS_SECRET_KEY`\n\n## Code of Conduct\n\nPlease refer to [Code of Conduct](CODE_OF_CONDUCT.md)\n\n## Licensing\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckout%2Fcheckout-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheckout%2Fcheckout-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckout%2Fcheckout-sdk-php/lists"}