From 768700819fb27d494d8ca071267c1d32c3d10f8c Mon Sep 17 00:00:00 2001 From: Dirk Ehrhardt Date: Wed, 21 Aug 2024 12:36:06 +0200 Subject: [PATCH] chore: add github release documentation --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2545a7..f8e984a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Welcome to the Node SDK for the PAYONE Commerce Platform! This repository contai - [Preparing the Release](#preparing-the-release) - [Changelog Generation with Conventional Changelog](#changelog-generation-with-conventional-changelog) - [Merging the Release Branch](#merging-the-release-branch) + - [GitHub Action for Release](#github-action-for-release) + - [Optional: Creating a GitHub Release](#optional-creating-a-github-release) - [License](#license) ## Features @@ -40,6 +42,8 @@ npm i pcp-server-nodejs-sdk yarn add pcp-server-nodejs-sdk ``` +**[back to top](#table-of-contents)** + ## Usage To use this SDK you need to construct a `CommunicatorConfiguration` which encapsulate everything needed to connect to the PAYONE Commerce Platform. @@ -71,6 +75,8 @@ const createCommerceCaseResponse: CreateCommerceCaseResponse = commerceCaseClien The models directly map to the API as described in [PAYONE Commerce Platform API Reference](https://docs.payone.com/pcp/commerce-platform-api). +**[back to top](#table-of-contents)** + ### Error Handling When making a request any client may throw a `ApiException`. There two subtypes of this exception: @@ -78,14 +84,20 @@ When making a request any client may throw a `ApiException`. There two subtypes - `ApiErrorReponseException`: This exception is thrown when the API returns an well-formed error response. The given errors are deserialized into `APIError` objects which are availble 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. - `ApiResponseRetrievalException`: This exception is a catch-all exception for any error that cannot be turned into a helpful error response. This includes malformed responses or unknown responses. +**[back to top](#table-of-contents)** + ### 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. +**[back to top](#table-of-contents)** + ### Apple Pay When a client is successfully made a payment via ApplePay it receives a [ApplePayPayment](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypayment). This structure is accessible as the `ApplePayPayment` class. You can use the `ApplePayTransformer` to map an `ApplePayPayment` to a `MobilePaymentMethodSpecificInput` which can be used for payment executions or order requests. The transformer has a static method `transformApplePayPaymentToMobilePaymentMethodSpecificInput()` which takes an `ApplePayPayment` and returns a `MobilePaymentMethodSpecificInput`. The transformer does not check if the response is complete, if anything is missing the field will be set to `undefined`. +**[back to top](#table-of-contents)** + ### Run the example app ```sh @@ -145,13 +157,40 @@ The changelog gets generated automatically when the npm version gets bumped via #### Merging the Release Branch -- Create PR on develop branch -- Merge develop in main branch +- Create PR on `develop` branch +- Merge develop in `main` branch + +#### GitHub Action for Release + +After successfully merging all changes to the `main` branch, an admin can trigger a GitHub Action to finalize and publish the release. This action ensures that the release process is automated, consistent, and deploys the new release from the `main` branch. + +**Triggering the GitHub Action**: + +- Only admins can trigger the release action. +- Ensure that all changes are committed to the `main` branch. +- Navigate to the Actions tab on your GitHub repository and manually trigger the release action for the `main` branch. + +#### Optional: Creating a GitHub Release + +Once the release has been published to npm, developers can start using the latest version of the SDK. However, if you want to make the release more visible and include detailed release notes, you can optionally create a GitHub release. + +1. **Navigate to the Releases Page**: Go to the "Releases" section of your repository on GitHub. +2. **Draft a New Release**: Click "Draft a new release". +3. **Tag the Release**: Select the version tag that corresponds to the version you just published on npm (e.g., `v0.1.0`). +4. **Release Title**: Add a descriptive title for the release (e.g., `v0.1.0 - Initial Release`). +5. **Auto-Generated Release Notes**: GitHub can automatically generate release notes based on merged pull requests and commit history. You can review these notes, adjust the content, and highlight important changes. +6. **Publish the Release**: Once you're satisfied with the release notes, click "Publish release". + +Creating a GitHub release is optional, but it can provide additional context and visibility for your users. For detailed guidance, refer to the [GitHub documentation on managing releases](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository). + +**[back to top](#table-of-contents)** ## License This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details. +**[back to top](#table-of-contents)** + --- Thank you for using our SDK for Online Payments! If you have any questions or need further assistance, feel free to open an issue or contact us.