Skip to content

Commit

Permalink
feat(payments-plugin): Added readme and dev server script
Browse files Browse the repository at this point in the history
  • Loading branch information
kkerti committed Nov 26, 2024
1 parent c859cd1 commit 097e150
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions packages/payments-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,26 @@ STRIPE_PUBLISHABLE_KEY=pk_test_xxxx
3. Watch the logs for the link or go to `http://localhost:3050/checkout` to test the checkout.

After checkout completion you can see your payment in https://dashboard.stripe.com/test/payments/

### Braintree local development

For testing out changes to the Braintree plugin locally, with a real Braintree account, follow the steps below. These steps
will create an order, set Braintree as payment method, and create a clientToken, which will be used with a drop-in UI on the test checkout page.

1. Get the test keys from your Braintree dashboard, under menu settings, API section: https://sandbox.braintreegateway.com
2. Create a `.env` file in the `packages/payments-plugin` directory with the following content:
3. Optionally, if you want to add multi currency support, on Braintree dashboard, under menu settings, Business section, get Merchant Account ID keys.

```sh
BRAINTREE_PRIVATE_KEY=asdf...
BRAINTREE_PUBLIC_KEY=ghjk...
BRAINTREE_MERCHANT_ID=12ly...
BRAINTREE_ENVIRONMENT=sandbox
BRAINTREE_MERCHANT_ACCOUNT_ID_EUR=account_for_eur #optional, can be used a different naming scheme as well
BRAINTREE_MERCHANT_ACCOUNT_ID_USD=account_for_usd #optional, can be used a different naming scheme as well
```

1. `cd packages/payments-plugin`
2. `npm run dev-server:braintree`
3. Watch the logs for the link or go to `http://localhost:3050/checkout` to test the checkout.
4. If you have added `BRAINTREE_MERCHANT_ACCOUNT_ID_XXX`, those have to be added to BraintreePlugin options in `e2e/braintree-dev-server.ts`
5 changes: 3 additions & 2 deletions packages/payments-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"lint": "eslint --fix .",
"ci": "npm run build",
"dev-server:mollie": "npm run build && DB=sqlite node -r ts-node/register e2e/mollie-dev-server.ts",
"dev-server:stripe": "npm run build && DB=sqlite node -r ts-node/register e2e/stripe-dev-server.ts"
"dev-server:stripe": "npm run build && DB=sqlite node -r ts-node/register e2e/stripe-dev-server.ts",
"dev-server:braintree": "npm run build && DB=sqlite node -r ts-node/register e2e/braintree-dev-server.ts"
},
"homepage": "https://www.vendure.io/",
"funding": "https://github.com/sponsors/michaelbromley",
Expand Down Expand Up @@ -56,4 +57,4 @@
"stripe": "^13.3.0",
"typescript": "5.1.6"
}
}
}

0 comments on commit 097e150

Please sign in to comment.