diff --git a/README.md b/README.md index 2f112f3..e277cc5 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,15 @@ # PAYONE Commerce Platform Server SDK PHP -**NOTE**: This SDK is still under development. Some things may be broken, features may change in non-compatible ways or will be removed completely. - +**NOTE**: This SDK is still under development. Some features may be broken, change in non-compatible ways, or be removed entirely. The PHP SDK helps you to communicate with the PAYONE commerce platform server API. Its primary features are: -* convenient PHP wrapper around the API calls and responses: - * marshals PHP request objects to HTTP requests - * unmarshalls HTTP responses to PHP response objects or PHP exceptions +* A convenient PHP wrapper around API calls and responses: + * marshals PHP request objects to HTTP requests + * unmarshals HTTP responses to PHP response objects or PHP exceptions * handling of all the details concerning authentication -* handling of required meta data +* handling of required metadata -For a general introduction to the API and the different checkout flows see the documentation: +For a general introduction to the API and various checkout flows, see the documentation: - General introduction to the [PAYONE Commerce Platform](https://docs.payone.com/pcp/payone-commerce-platform) - Overview of the [checkout flows](https://docs.payone.com/pcp/checkout-flows) - Available [payment methods](https://docs.payone.com/pcp/checkout-flows) @@ -46,7 +45,7 @@ For a general introduction to the API and the different checkout flows see the d ## Requirements -PHP 8.2 or above is required. +This SDK requires PHP 8.2 or later. ## Installation @@ -66,11 +65,11 @@ This SDK is currently not released on [packagist](https://packagist.org/). You c } ``` -This snippets specify the main branch which contains the latest release. You can specify a version by inserting a git tag `vX.Y.Z` instead of `main`. Make sure to prepend the git branch or tag with `dev-`. For a in depth explanation take a look at the [composer documentation](https://getcomposer.org/doc/05-repositories.md#vcs). +These snippets specify the main branch, which contains the latest release. You can specify a version by inserting a git tag `vX.Y.Z` instead of `main`. Make sure to prepend the git branch or tag with `dev-`. For an in depth explanation take a look at the [Composer documentation](https://getcomposer.org/doc/05-repositories.md#vcs). ## Usage -To use this SDK you need to construct a `CommunicatorConfiguration` which encapsulate everything needed to connect to the PAYONE Commerce Platform. +To use this SDK, you need to construct a `CommunicatorConfiguration` which encapsulates everything needed to connect to the PAYONE Commerce Platform. ```php createCommerceCase('YOUR_MERCHANT_ID', new CreateCommerceCaseRequest()); ``` -The models directly map to the API as described in [PAYONE Commerce Platform API Reference](https://docs.payone.com/pcp/commerce-platform-api). For an in depth example you can take a look at the [demo app](#demo-app). +The models are directly map to the API as described in the [PAYONE Commerce Platform API Reference](https://docs.payone.com/pcp/commerce-platform-api). For an in depth example you can take a look at the [demo app](#demo-app). ### Error Handling -When making a request any client may throw a `PayoneCommercePlatform\Sdk\Errors\ApiException`. There two subtypes of this exception: +When making a request, any client instance may throw a `PayoneCommercePlatform\Sdk\Errors\ApiException`. There are two subtypes of this exception: -- `PayoneCommercePlatform\Sdk\Errors\ApiErrorResponseException`: This exception is thrown when the API returns an well-formed error response. The given errors as `PayoneCommercePlatform\Sdk\Models\APIError` instances via the `getErrors()` method on the exception. They usually contain useful information about what is wrong in your request or the state of the resource. +- `PayoneCommercePlatform\Sdk\Errors\ApiErrorResponseException`: This exception is thrown when the API returns an well-formed error response. These errors are provided as an array of `PayoneCommercePlatform\Sdk\Models\APIError` instances via the `getErrors()` method on the exception. They usually contain useful information about what is wrong in your request or the state of the resource. - `PayoneCommercePlatform\Sdk\Errors\ApiResponseRetrievalException`: This exception is a catch-all exception for any error that cannot be turned into a helpful error response. This includes network errors, malformed responses or other errors that are not directly related to the API. ### Client Side -For most [payment methods](https://docs.payone.com/pcp/commerce-platform-payment-methods) some information from the client is needed, e.g. payment information given by Apple when a payment via ApplePay suceeds. PAYONE provides client side SDKs which helps you interact the third party payment providers. You can find the SDKs under the [Payone GitHub organization](https://github.com/PAYONE-GmbH). Either way ensure to never store or even send credit card information to your server. The PAYONE Commerce Platform never needs access to the credit card information. The client side is responsible for safely retrieving a credit card token. This token must be used with this SDK. +For most [payment methods](https://docs.payone.com/pcp/commerce-platform-payment-methods), some information from the client is needed, e.g. payment information given by Apple when a payment via ApplePay suceeds. PAYONE provides client side SDKs which helps you interact the third party payment providers. You can find these SDKs under the [Payone GitHub organization](https://github.com/PAYONE-GmbH). Either way ensure to never store or even send credit card information to your server. The PAYONE Commerce Platform never needs access to the credit card information. The client side is responsible for safely retrieving a credit card token. This token must be used with this SDK. -This SDKs makes no assumption about how the networking between the client and your PHP server is done. If need to serialize a model to JSON or deserialize a client side request from a JSON string to a model you can use the static `serializeJson()` and `deserializeJson()` methods on the `BaseApiClient` class: +This SDK makes no assumptions about how networking between the client and your PHP server is handled. If need to serialize a model to JSON or deserialize a client side request from a JSON string to a model you can use the static `serializeJson()` and `deserializeJson()` methods on the `BaseApiClient` class: ```php