plugins > medusa-payment-coinbase

medusa-payment-coinbase

Coinbase logo

X

Medusa logo

Documentation

If you are not familiar with Medusa, you can learn more on the project web site.

Note: This plugin will be migrated to Medusa v2, when v2 reaches production readiness.

What is it?

An onchain payment provider using Coinbase integration with Medusa.

How to Install

  1. Install the package with yarn add medusa-payment-coinbase or npm i medusa-payment-coinbase
  2. Set the following environment variables in your .env file:
    COINBASE_API_KEY=<YOUR_COINBASE_X-CC-Api-Key>
    COINBASE_CANCEL_URL=<REDIRECT_URL_AFTER_CANCEL>
    COINBASE_REDIRECT_URL=<REDIRECT_URL_AFTER_PAYMENT_COMPLETE>
    
  3. In medusa-config.js, add the following at the end of the plugins array:
    const plugins = [
      // ...
      {
        resolve: `medusa-payment-coinbase`,
        options: {
          api_key: process.env.COINBASE_API_KEY,
          cancel_url: process.env.COINBASE_CANCEL_URL,
          redirect_url: process.env.COINBASE_REDIRECT_URL,
        },
      },
    ]
    
  4. Start the project
    • After installation, you will see a new payment provider in regions named CoinBase.

Test the Plugin

After configuring and setting Coinbase as a payment provider, when you select Coinbase to complete your payment on the storefront, you will get the checkout URL by accessing session.data.hosted_url, where session is the payment_session_data of the selected payment provider.

Proposals, Bugs, Improvements

If you have an idea for what could be the next highest priority functionality, do not hesitate to raise an issue here: Github issues.

License

MIT

Pro Version

This community version only enables you to create a hosted payment URL for your cart and complete the payment. The Pro version of medusa-payment-coinbase expands on the features of the free version with more advanced capabilities such as:

The Pro version is available under a commercial license. Contact abdullah-afzal for more information.


© 2024 abdullah-afzal