|
1 | | -# Monext CommerceTools Plugin |
| 1 | +# connect-payment-integration-monext |
2 | 2 |
|
| 3 | +--- |
| 4 | + |
| 5 | +## Table of Content |
3 | 6 | ---- |
4 | 7 |
|
5 | | -## Welcome to Monext's Official GitHub Repository |
| 8 | +- [Overview](#overview) |
| 9 | +- [Template Features](#template-features) |
| 10 | +- [Prerequisite](#prerequisite) |
| 11 | +- [Getting started](#getting-started) |
| 12 | + - [Development of Enabler](./enabler/README.md) |
| 13 | + - [Development of Processor](./processor/README.md) |
| 14 | +- [Deployment Configuration](#deployment-configuration) |
| 15 | +- [Additional resources for developers](#additional-resources-for-developers) |
| 16 | +- [License](#license) |
| 17 | +- [Contact and support](#contact-and-support) |
| 18 | + |
| 19 | +## Overview |
| 20 | + |
| 21 | +This repository provides a [connect](https://docs.commercetools.com/connect) template for payment integration connector. This boilerplate code acts as a starting point for integration with external payment service provider. |
| 22 | + |
| 23 | +## Template Features |
| 24 | + |
| 25 | +- Typescript language supported. |
| 26 | +- Uses Fastify as web server framework. |
| 27 | +- Uses [commercetools SDK](https://docs.commercetools.com/sdk/js-sdk-getting-started) for the commercetools-specific communication. |
| 28 | +- Uses [connect payment SDK](https://github.com/commercetools/connect-payments-sdk) to manage request context, sessions and JWT authentication. |
| 29 | +- Includes local development utilities in npm commands to build, start, test, lint & prettify code. |
| 30 | + |
| 31 | +## Prerequisite |
| 32 | + |
| 33 | +#### 1. commercetools composable commerce API client |
| 34 | + |
| 35 | +Users are expected to create API client responsible for payment management in composable commerce project. Details of the API client are taken as input as environment variables/ configuration for connect such as `CTP_PROJECT_KEY` , `CTP_CLIENT_ID`, `CTP_CLIENT_SECRET`. For details, please read [Deployment Configuration](./README.md#deployment-configuration). |
| 36 | +In addition, please make sure the API client should have enough scope to be able to manage payment. For details, please refer to [Running Application](./processor/README.md#running-application). |
| 37 | + |
| 38 | +#### 2. various URLs from commercetools composable commerce |
| 39 | + |
| 40 | +Various URLs from commercetools platform are required to be configured so that the connect application can handle session and authentication process for endpoints. |
| 41 | +Their values are taken as input as environment variables/configuration for connect with variable names `CTP_API_URL`, `CTP_AUTH_URL` and `CTP_SESSION_URL`. |
| 42 | + |
| 43 | +#### 3. Monext account credentials and configurations |
| 44 | + |
| 45 | +An API key provided by Monext is necessary to be configured so that the requests from the connect application can be authenticated by Monext platform within the integration. It's value is taken as input as environment variables/configuration for connect with variable name `MONEXT_API_KEY`. |
| 46 | + |
| 47 | +Additionally, some other configuration options provided by Monext and defined by the marchant are required. Their values are taken as input as environment variables/configuration for connect with variable names `MONEXT_ENVIRONMENT`, `MONEXT_POINT_OF_SALE_REF`, `MONEXT_CAPTURE_TYPE`. |
| 48 | + |
| 49 | +## Getting started |
| 50 | + |
| 51 | +The connector contains two modules: |
| 52 | + |
| 53 | +- Enabler: Acts as a wrapper implementation in which frontend components from PSPs embedded. It provides a JS component that renders a checkout button. The connector library can be loaded directly on frontend than the PSP one. Currently is not compatible with commercetools checkout. |
| 54 | + |
| 55 | + Regarding the development of enabler module, please refer to the following documentations: |
| 56 | + |
| 57 | + - [Development of Enabler](./enabler/README.md) |
| 58 | + |
| 59 | +- Processor : Acts as backend services which is middleware to 3rd party PSPs to be responsible for managing transactions with PSPs and updating payment entity in composable commerce. `connect-payment-sdk` will be offered to be used in connector to manage request context, sessions and other tools necessary to transact. |
| 60 | + |
| 61 | + Regarding the development of processor module, please refer to the following documentations: |
| 62 | + |
| 63 | + - [Development of Processor](./processor/README.md) |
| 64 | + |
| 65 | +## Deployment Configuration |
| 66 | + |
| 67 | +In order to deploy your customized connector application on commercetools Connect, it needs to be published. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts) |
| 68 | +In addition, in order to support connect, the tax integration connector template has a folder structure as listed below: |
| 69 | + |
| 70 | +``` |
| 71 | +├── enabler |
| 72 | +│ ├── src |
| 73 | +│ ├── test |
| 74 | +│ └── package.json |
| 75 | +├── processor |
| 76 | +│ ├── src |
| 77 | +│ ├── test |
| 78 | +│ └── package.json |
| 79 | +└── connect.yaml |
| 80 | +``` |
| 81 | + |
| 82 | +Connect deployment configuration is specified in `connect.yaml` which is required information needed for publishing of the application. Following is the deployment configuration used by full ingestion and incremental updater modules: |
| 83 | + |
| 84 | +``` |
| 85 | +deployAs: |
| 86 | + - name: processor |
| 87 | + applicationType: service |
| 88 | + endpoint: / |
| 89 | + configuration: |
| 90 | + standardConfiguration: |
| 91 | + - key: CTP_PROJECT_KEY |
| 92 | + description: Commercetools project key |
| 93 | + required: true |
| 94 | + - key: CTP_CLIENT_ID |
| 95 | + description: Commercetools client ID |
| 96 | + required: true |
| 97 | + - key: CTP_AUTH_URL |
| 98 | + description: Commercetools Auth URL |
| 99 | + required: true |
| 100 | + - key: CTP_API_URL |
| 101 | + description: Commercetools API URL |
| 102 | + required: true |
| 103 | + - key: CTP_SESSION_URL |
| 104 | + description: Session API URL |
| 105 | + required: true |
| 106 | + - key: CTP_JWKS_URL |
| 107 | + description: JWKs url |
| 108 | + required: true |
| 109 | + - key: CTP_JWT_ISSUER |
| 110 | + description: JWT Issuer for jwt validation |
| 111 | + required: true |
| 112 | + - key: MONEXT_ENVIRONMENT |
| 113 | + description: Monext environment |
| 114 | + required: true |
| 115 | + - key: MONEXT_POINT_OF_SALE_REF |
| 116 | + description: Monext point of sale reference |
| 117 | + required: true |
| 118 | + - key: MONEXT_CAPTURE_TYPE |
| 119 | + description: Monext capture type |
| 120 | + required: true |
| 121 | + - key: RETURN_URL |
| 122 | + description: Merchant return URL |
| 123 | + required: true |
| 124 | + securedConfiguration: |
| 125 | + - key: MONEXT_API_KEY |
| 126 | + description: Monext API Key |
| 127 | + required: true |
| 128 | + - key: CTP_CLIENT_SECRET |
| 129 | + description: Commercetools client secret |
| 130 | + required: true |
| 131 | + - name: enabler |
| 132 | + applicationType: assets |
| 133 | +``` |
| 134 | + |
| 135 | +Here you can see the details about the variables in configuration: |
| 136 | + |
| 137 | +- `CTP_PROJECT_KEY`: The key of commercetools composable commerce project. |
| 138 | +- `CTP_CLIENT_ID`: The client ID of your commercetools composable commerce user account. It is used in commercetools client to communicate with commercetools composable commerce via SDK. Expected scopes are: `manage_payments` `manage_orders` `view_sessions` `view_api_clients` `manage_checkout_payment_intents` `introspect_oauth_tokens` `manage_customers`. |
| 139 | +- `CTP_CLIENT_SECRET`: The client secret of commercetools composable commerce user account. It is used in commercetools client to communicate with commercetools composable commerce via SDK. |
| 140 | +- `CTP_AUTH_URL`: The URL for authentication in commercetools platform. It is used to generate OAuth 2.0 token which is required in every API call to commercetools composable commerce. The default value is `https://auth.europe-west1.gcp.commercetools.com`. For details, please refer to documentation [here](https://docs.commercetools.com/tutorials/api-tutorial#authentication). |
| 141 | +- `CTP_API_URL`: The URL for commercetools composable commerce API. Default value is `https://api.europe-west1.gcp.commercetools.com`. |
| 142 | +- `CTP_SESSION_URL`: The URL for session creation in commercetools platform. Connectors relies on the session created to be able to share information between enabler and processor. The default value is `https://session.europe-west1.gcp.commercetools.com`. |
| 143 | +- `CTP_JWKS_URL`: The URL which provides JSON Web Key Set. Default value is `https://mc-api.europe-west1.gcp.commercetools.com/.well-known/jwks.json`. |
| 144 | +- `CTP_JWT_ISSUER`: The issuer inside JSON Web Token which is required in JWT validation process. Default value is `https://mc-api.europe-west1.gcp.commercetools.com` |
| 145 | +- `RETURN_URL`: Merchant return URL for redirecting the user back to the merchant website after the payment is completed. Use it as a fallback if no merchantReturnUrl is provided in the session. |
| 146 | +- `MONEXT_POINT_OF_SALE_REF`: Point of sale refs are in JSON format if there is multiple associated stores. If there is only one REF for all stores or for all commercetools project, use the REF as string. |
| 147 | + |
| 148 | +``` |
| 149 | +// string - single REF for all stores or for all commercetools project. |
| 150 | +MONEXT_POINT_OF_SALE_REF: ref1; |
| 151 | +// string JSON valid - if multiple refs for multiple stores |
| 152 | +#MONEXT_POINT_OF_SALE_REF: { |
| 153 | + "storeKey1": "ref1", |
| 154 | + "storeKey2": "ref2" |
| 155 | +} |
| 156 | +``` |
| 157 | + |
| 158 | +- `MONEXT_CAPTURE_TYPE`: Can be AUTOMATIC or MANUAL. Capture types are in JSON format if there is multiple associated stores. If there is only one Capture type for all stores or for all commercetools project, use the Capture type as string. |
| 159 | + |
| 160 | +``` |
| 161 | +// string - single capture type for all stores or for all commercetools project |
| 162 | +MONEXT_CAPTURE_TYPE: "AUTOMATIC"; |
| 163 | +// string JSON valid - if multiple Capture types for multiple stores |
| 164 | +#MONEXT_CAPTURE_TYPE: { |
| 165 | + "storeKey1": "AUTOMATIC", |
| 166 | + "storeKey2": "MANUAL" |
| 167 | +} |
| 168 | +``` |
| 169 | + |
| 170 | +- `MONEXT_ENVIRONMENT`: HOMOLOGATION or PRODUCTION. Monext environment are in JSON format if there is multiple associated stores. If there is only one environment for all stores or for all commercetools project, use the environment as string. When using operations/status endpoint, the call for Monext API status endpoint uses: the single environment value or the environment defined in the first key of the JSON file or HOMOLOGATION by default. |
| 171 | + |
| 172 | +``` |
| 173 | +// string - single environment for all stores or for all commercetools project |
| 174 | +MONEXT_ENVIRONMENT: "HOMOLOGATION"; |
| 175 | +// string JSON valid - if multiple environments for multiple stores |
| 176 | +#MONEXT_ENVIRONMENT: { |
| 177 | + "storeKey1": "HOMOLOGATION", |
| 178 | + "storeKey2": "PRODUCTION" |
| 179 | +} |
| 180 | +``` |
| 181 | + |
| 182 | +## Additional resources for developers |
| 183 | + |
| 184 | +To learn more about how the API used by the plugin and how to modify or use Commercetools with it to fit your needs: |
| 185 | + |
| 186 | +- [Monext API documentation](https://api-docs.retail.monext.com/reference/getting-started-with-your-api) |
| 187 | +- [Commercetools Composable Commerce Documentation](https://docs.commercetools.com/docs/composable-commerce) |
| 188 | + |
| 189 | +## License |
| 190 | + |
| 191 | +This plugin's source code is completely free and released under the terms of the MIT license. |
6 | 192 |
|
7 | | -We are excited to announce that our GitHub repository has been rebranded from Payline to Monext. This change reflects the broader range of payment solutions and services we now offer under the Monext name. |
| 193 | +## Contact and support |
8 | 194 |
|
9 | | -Monext continues to provide innovative and secure payment solutions for businesses of all sizes. Through this repository, you'll find our latest tools, plugins, and API documentation, enabling seamless integration with our platforms. |
| 195 | +If you want to contact us, the best way is through [this page on our website](https://www.monext.fr/gardons-le-contact) and send us your question(s). |
10 | 196 |
|
11 | | -Feel free to explore, contribute, and stay updated on our latest developments. Thank you for being part of the journey! |
| 197 | +We guarantee that we answer as soon as we can! |
12 | 198 |
|
13 | | -Follow : https://github.com/Monext/monext-commercetools |
| 199 | +If you need support you can also directly check our FAQ section and contact us [on the support page](https://support.payline.com/hc/fr). |
0 commit comments