{"id":19622143,"url":"https://github.com/commercetools/connect-payment-integration-paypal","last_synced_at":"2026-06-08T22:32:14.933Z","repository":{"id":227301881,"uuid":"757430313","full_name":"commercetools/connect-payment-integration-paypal","owner":"commercetools","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-30T11:07:21.000Z","size":4505,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-31T03:57:34.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/commercetools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-14T13:35:02.000Z","updated_at":"2026-01-30T11:07:16.000Z","dependencies_parsed_at":"2024-03-18T01:50:14.659Z","dependency_job_id":"b3845c68-35b2-4d43-8c66-84c46abf283a","html_url":"https://github.com/commercetools/connect-payment-integration-paypal","commit_stats":null,"previous_names":["commercetools/connect-payment-integration-paypal"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/commercetools/connect-payment-integration-paypal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-payment-integration-paypal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-payment-integration-paypal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-payment-integration-paypal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-payment-integration-paypal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/connect-payment-integration-paypal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-payment-integration-paypal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34083848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-11T11:26:11.591Z","updated_at":"2026-06-08T22:32:14.918Z","avatar_url":"https://github.com/commercetools.png","language":"TypeScript","funding_links":["https://developer.paypal.com/api/rest/"],"categories":[],"sub_categories":[],"readme":"# connect-payment-integration-paypal\nThis repository provides a [connect](https://docs.commercetools.com/connect) for integration to PayPal payment service provider (PSP).\n\n## Features\n- Typescript language supported.\n- Uses Fastify as web server framework.\n- Uses [commercetools SDK](https://docs.commercetools.com/sdk/js-sdk-getting-started) for the commercetools-specific communication.\n- Uses [connect payment SDK](https://github.com/commercetools/connect-payments-sdk) to manage request context, sessions and JWT authentication.\n- Includes local development utilities in npm commands to build, start, test, lint \u0026 prettify code.\n\n## Overview\nThe PayPal integration connector contains two modules:  \n- Enabler: Acts as a wrapper implementation in which frontend components from PayPal embedded. It gives control to checkout product on when and how to load the connector frontend based on business configuration. In cases connector is used directly and not through Checkout product, the connector library can be loaded directly on frontend than the PSP one.\n- Processor: Acts as backend services which is middleware to integrate with PayPal platform. It is mainly responsible for managing transactions with PayPal 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.\n\n```mermaid\n%%{ init : { \"theme\" : \"\", \"flowchart\" : { \"defaultRenderer\": \"dagre-wrapper\", \"curve\" : \"linear\" }}}%%\n\nflowchart TD\n    node1(( ))\n    node2(( ))\n    user(\"User\")--\u003echeckout(\"Commercetools Checkout\")\n    subgraph connector\n        enabler\n        processor\n    end\n    subgraph coco[\"Commercetools Composable Commerce\"]\n        cart\n        order\n        payment\n        \n    end\n    checkout----node1\n    \n    node1--\"1. Cart management\"--\u003ecart(\"cart\")\n    node1--\"2. Order management\"--\u003eorder(\"order\")\n    checkout(\"Commercetools Checkout\")----node2\n    node2--\"3. Get static assets\"--\u003eenabler(\"enabler\")\n    node2--\"4. Request payment \\noperations\"--\u003eprocessor(\"processor\")\n    processor--\"5. Request payment \\noperations\"--\u003epsp(\"PayPal payment service provider\")\n    psp(\"PayPal payment service provider\")--\"6. Return response\"--\u003eprocessor\n    processor--\"7. Payment management\"--\u003epayment(\"payment\")\n```\n\n1. commercetools Checkout in front-end side sends requests to composable commerce for cart creation.\n2. commercetools Checkout retrieves SDK as static assets from enabler in connector.\n3. After downloading the SDK, commercetools Checkout sends request via the SDK to endpoints exposed by processor for various payment operations.\n4. The processor transforms the received request and send them to PayPal platform.\n5. PayPal processes the payment operations and return the response to processor.\n6. The processor handles the payment persistence to composable commerce, and return the result to front-end.\n7. commercetools Checkout handles the order management in composable commerce once it receives the result from the processor. \n\n## Prerequisite\n#### 1. commercetools composable commerce API client\nUsers 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).\nIn 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)\n\n#### 2. various URLs from commercetools composable commerce\nVarious URLs from commercetools platform are required to be configured so that the connect application can handle session and authentication process for endpoints.\nTheir values are taken as input as environment variables/ configuration for connect with variable names `CTP_API_URL`, `CTP_AUTH_URL` and `CTP_SESSION_URL`.\n\n#### 3. Paypal account credentials\nVarious account data provided by Paypal are necessary to be configured so that the requests from the connect application can be authenticated by Paypal platform within the integration.\nTheir values are taken as input as environment variables/ configuration for connect with variable names `PAYPAL_ENVIRONMENT`, `PAYPAL_CLIENT_ID`, `PAYPAL_WEBHOOK_ID`, `PAYPAL_CLIENT_SECRET`.\n\n## Getting started\nThe template contains two modules :  \n- Enabler: Acts as a wrapper implementation in which frontend components from PSPs embedded. It gives control to checkout product on when and how to load the connector frontend based on business configuration. In cases connector is used directly and not through Checkout product, the connector library can be loaded directly on frontend than the PSP one.\n- 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.\n\nRegarding the development of processor module, please refer to the following documentations:\n- [Development of Processor](./processor/README.md)\n\n#### 1. Register as connector in commercetools Connect\nFollow guidelines [here](https://docs.commercetools.com/connect/getting-started) to register the connector for public/private use.\n\n## Deployment Configuration\nIn 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)\nIn addition, in order to support connect, the tax integration connector template has a folder structure as listed below\n```\n├── enabler\n│   ├── src\n│   ├── test\n│   └── package.json\n├── processor\n│   ├── src\n│   ├── test\n│   └── package.json\n└── connect.yaml\n```\n\nConnect deployment configuration is specified in `connect.yaml` which is required information needed for publishing of the application. Following is the deployment configuration used by enabler and processor modules\n```\ndeployAs:\n  - name: enabler\n    applicationType: assets\n  - name: processor\n    applicationType: service\n    endpoint: /\n    configuration:\n      standardConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: Commercetools project key\n          required: true\n        - key: CTP_CLIENT_ID\n          description: Commercetools client ID\n          required: true\n        - key: CTP_AUTH_URL\n          description: commercetools Auth URL\n          required: true\n          default: https://auth.europe-west1.gcp.commercetools.com\n        - key: CTP_API_URL\n          description: commercetools API URL\n          required: true\n          default: https://api.europe-west1.gcp.commercetools.com\n        - key: CTP_SESSION_URL\n          description: Session API URL\n          required: true\n          default: https://session.europe-west1.gcp.commercetools.com\n        - key: CTP_JWKS_URL\n          description: JWKs url\n          required: true\n          default: https://mc-api.europe-west1.gcp.commercetools.com/.well-known/jwks.json\n        - key: CTP_JWT_ISSUER\n          description: JWT Issuer for jwt validation\n          required: true\n          default: https://mc-api.europe-west1.gcp.commercetools.com\n        - key: PAYPAL_CLIENT_ID\n          description: Paypal client ID\n          required: true\n        - key: PAYPAL_WEBHOOK_ID\n          description: Paypal webhook ID\n          required: true\n        - key: PAYPAL_ENVIRONMENT\n          description: Payment environment (live/test)\n          required: true\n      securedConfiguration:\n        - key: CTP_CLIENT_SECRET\n          description: Commercetools client secret\n          required: true\n        - key: PAYPAL_CLIENT_SECRET\n          description: Paypal client secret\n          required: true\n```\n\nHere you can see the details about various variables in configuration\n- CTP_PROJECT_KEY: The key of commercetools composable commerce project.\n- 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`.\n- 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.\n- 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).\n- CTP_API_URL: The URL for commercetools composable commerce API. Default value is `https://api.europe-west1.gcp.commercetools.com`.\n- 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`.\n- CTP_JWKS_URL: The URL which provides JSON Web Key Set.\n- 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`\n- PAYPAL_ENVIRONMENT: The indicator of Paypal environment.  Default value is `TEST`. It can be configured either as `LIVE` or `TEST`.\n- PAYPAL_CLIENT_ID: The unique identifier of a PayPal account.\n- PAYPAL_CLIENT_SECRET: It is used to authenticate a PayPal client ID. Both ID and secret are required to obtain access token for PayPal API calls. For details, please refer to [Get started with PayPal REST APIs](https://developer.paypal.com/api/rest/)\n- PAYPAL_WEBHOOK_ID: It represents unique identifier of a notification event from PayPal platform.\n\n## Development\nIn order to get started developing this connector certain configuration are necessary, most of which involve updating environment variables in both services (enabler, processor).\n\n#### Configuration steps\n\n#### 1. Environment Variable Setup\n\nNavigate to each service directory and duplicate the .env.template file, renaming the copy to .env. Populate the newly created .env file with the appropriate values.\n\n```bash\ncp .env.template .env\n```\n\n#### 2. Spin Up Components via Docker Compose\nWith the help of docker compose, you are able to spin up all necessary components required for developing the connector by running the following command from the root directory;\n\n```bash\ndocker compose up\n```\n\nThis command would start 3 required services, necessary for development\n1. JWT Server\n2. Enabler\n3. Processor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-payment-integration-paypal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fconnect-payment-integration-paypal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-payment-integration-paypal/lists"}