GithubHelp home page GithubHelp logo

braintree-commercetools-connector's Introduction

commercetools logo
braintree logo

This is a connect application to integrate Braintree into Commercetools. It follows the folder structure to ensure certification & deployment from commercetools connect team as stated here.

PayPal Braintree commercetools connector is available in the commercetools marketplace.

The payments demo and integration to the commercetools frontend can be seen at https://poc-mediaopt.frontend.site/ and github.

Prerequisites

To use the connector you need to have the following:

  • commercetools Composable Commerce account and API client credentials, namely:
    • region (CTP_REGION) - region, in which your commercetools project is hosted
    • project key (CTP_PROJECT_KEY) - the key of your commercetools project
    • client ID (CTP_CLIENT_ID) - the ID of your commercetools API client
    • client secret (CTP_CLIENT_SECRET) - the secret of your commercetools API client
    • scope (CTP_SCOPE) - the scope of your commercetools API client
  • Braintree merchant account and Braintee gateway credentials, namely:
    • merchant ID (BRAINTREE_MERCHANT_ID)
    • public key (BRAINTREE_PUBLIC_KEY)
    • private key (BRAINTREE_PRIVATE_KEY)
    • environment (BRAINTREE_ENVIRONMENT) - the environment of your Braintree API client (production or sandbox)

Please keep in mind, that the parameter merchant account id (BRAINTREE_MERCHANT_ACCOUNT) differs from merchant ID and is optional.

Instructions

  • cd braintree-extension
  • run yarn to install the dependencies
  • insert commercetools credentials to .env file
  • run ./bin/ngrok.sh to start ngrok and insert the dynamic url in the .env file
  • run yarn connector:post-deploy to register the extension with the public ngrok url
  • run ỳarn start:dev to build the application

Technology Stack

The connector is written in TypeScript and yarn is used as the package manager.

Contributing

Feel free to contribute to the project by opening an issue.

Additional information

In the docs folder you can find:

  • description of each application included (README.md)
  • architecture of the connector (Architecture.pdf)
  • documented PayPal Braintree Commercetools API Postman collection (Braintree.md, Braintree.postman_collection.json)

braintree-commercetools-connector's People

Contributors

mbe1987 avatar liudmylamasliuk avatar majidabbasimediaopt avatar

Stargazers

 avatar

Watchers

Andre Moelle avatar

braintree-commercetools-connector's Issues

Decimal issue in map.util.ts > mapBraintreeMoneyToCommercetoolsMoney

mapBraintreeMoneyToCommercetoolsMoney accepts a string amount and number of fraction digits.
It gives the expected output for most of the numbers, but doesn't work correctly for some other numbers.
Example input -
amount = 65.32
fractionDigits = 2
Expected output = 6532
Actual output = 6531.999999999999

I don't have any other number as of now for which I am not getting expected output but it may happen that when expected output is XXXX, the function returns XXXX.00000000001. Hence the new logic should support both the cases i.e. rounding up & down as applicable in that case.

Also, if possible, it will be good to have a unit test just testing this function and mapCommercetoolsMoneyToBraintreeMoney function with an array of combinations of amount and fractionDigits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.