scandipwa / stripe-payments

Open Software License 3.0
0 stars 2 forks source link

Stripe extension for ScandiPWA

Heads up! This extension installation will only make you halfway to success. Supplementing it with a Stripe extension back-end is a must

Learn more about installing Scandipwa extensions in our official docs 🚀

Note 1: In order to get this payment method, you need to install additional extensions.

Stripe is implemented via stripe react-stripe-elements component. In the checkout it looks like this for simple card payments:

image

To install:

Note 2: it is recommended to install from Magento Marketplace - bellow is the manual instruction

  1. Go to https://stripe.com/docs/plugins/magento/install
  2. Download the archive containing the FE part of the extension from the marketplace or GitHub
  3. Create a packages directory inside of your theme's root (cd packages/scandipwa && mkdir packages)
  4. Put the archive's contents inside of the packages/<package name> directory. Make sure that you have a packages/<package name>/package.json file present alongside all the other extension's contents, that means that you have unpacked the extension correctly. Note: <package name> can also include publisher, @scandipwa/stripe-payments is a valid package name.
  5. Add the following scripts to the scripts section of your theme's package.json file. This is necessary for your package to be symlinked into the node_modules directory of your theme after manipulations with dependencies
    {
    "scripts": {
        "postinstall": "scandipwa-scripts link",
        "postupdate": "scandipwa-scripts link"
    }
    }
  6. Add the extension to the dependencies of your theme, as follows:
    {
    "dependencies": {
        "@scandipwa/stripe-payments": "file:packages/stripe-payments"
    }
    }
  7. Enable the extension:
    {
    "scandipwa": {
    "extensions": {
      "stripe-payments": true
    }
    }
    }
  8. Run the npm i or yarn command in the theme root directory amongst with the postinstall command that you have added in Step 5. Facing the installation difficulties? Please ensure you have read all our FAQs

To configure:

  1. Go to https://dashboard.stripe.com/ - signup
  2. Go to Developer > Api Keys, copy credentials
  3. Go to Store > Configuration > Sales > Payment Methods > Stripe and enter credentials from above

Technical details:

Extends the Magento store config to include the publishable Stripe API keys and the current mode. These can be configured in the Magento Admin panel, in Stores > Settings: Configuration > Sales: Payment Methods > Stripe > Basic Settings

Example query:

query {
  storeConfig {
    stripe_mode
    stripe_live_pk
    stripe_test_pk
  } 
}