Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(medusa-payment-stripe-processor): Start implementing the new stripe payment plugins #3257

Merged
merged 42 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b0fa63a
WIP
adrien2p Feb 14, 2023
8550734
continue to implement stripe base
adrien2p Feb 14, 2023
7bee57d
continue stripe impl
adrien2p Feb 15, 2023
93b6305
update eslint config
adrien2p Feb 15, 2023
ef7b5c6
Tests continuation
adrien2p Feb 15, 2023
605ad0a
cleanup
adrien2p Feb 15, 2023
ee4587b
Initiate payment unit tests
adrien2p Feb 15, 2023
1351769
unit test authorize and cancel payment
adrien2p Feb 15, 2023
d23dfa0
unit test capture payment
adrien2p Feb 15, 2023
efd246f
unit test delete payment
adrien2p Feb 15, 2023
3fe56b3
miscelaneous
adrien2p Feb 15, 2023
64878bc
finalise stripe base unit test
adrien2p Feb 20, 2023
7a8dc0c
cleanup jest config
adrien2p Feb 20, 2023
e80c444
stripe webhook
adrien2p Feb 20, 2023
5307b8a
fix type issues
adrien2p Feb 20, 2023
dd7d603
WIP
adrien2p Feb 21, 2023
91fbea6
Continue testing
adrien2p Feb 22, 2023
0bbc46a
fix util
adrien2p Feb 22, 2023
d6409fe
fix tests + remove default life time
adrien2p Feb 23, 2023
c25c25e
refactor
adrien2p Feb 23, 2023
c1c54c2
Merge branch 'develop' into feat/stripe-payment-processor
adrien2p Feb 23, 2023
b882792
update eslint
adrien2p Feb 23, 2023
48de57a
refactor plugin loader
adrien2p Feb 23, 2023
26b8e2b
cleanup
adrien2p Feb 23, 2023
73301da
eslint clean
adrien2p Feb 23, 2023
02cac3c
readme + cleanup
adrien2p Feb 23, 2023
b094efc
chore: feedback and cleanup
adrien2p Feb 27, 2023
bc4a45d
remove default identifier
adrien2p Feb 27, 2023
1857399
remove build files
adrien2p Feb 27, 2023
48bfafe
Create eleven-cycles-mate.md
adrien2p Feb 27, 2023
08daa40
Merge branch 'develop' into feat/stripe-payment-processor
adrien2p Feb 27, 2023
409e899
cealnup 1/2
adrien2p Feb 27, 2023
47d38ef
Merge branch 'feat/stripe-payment-processor' of github.com:medusajs/m…
adrien2p Feb 27, 2023
24574a9
cleanup web hook and add tests
adrien2p Feb 28, 2023
73145d4
remove unnecessary deps and cleanup completion
adrien2p Feb 28, 2023
1d850f8
push web hook tests
adrien2p Feb 28, 2023
8386882
merge conflict management
adrien2p Feb 28, 2023
15778dd
fix idempotency service
adrien2p Feb 28, 2023
4fe3fd5
Use the event id in the idempotency key
adrien2p Feb 28, 2023
e04dd01
typos
adrien2p Feb 28, 2023
f5993c9
Merge branch 'develop' into feat/stripe-payment-processor
olivermrbl Feb 28, 2023
3534810
Merge branch 'develop' into feat/stripe-payment-processor
olivermrbl Feb 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jest*
packages/*
# List of packages to Lint
!packages/medusa
!packages/medusa-payment-stripe



Expand Down
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ module.exports = {
extends: ["plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./packages/medusa/tsconfig.json",
project: [
"./packages/medusa/tsconfig.json",
"./packages/medusa-payment-stripe/tsconfig.spec.json",
adrien2p marked this conversation as resolved.
Show resolved Hide resolved
]
},
rules: {
"valid-jsdoc": "off",
Expand Down
2 changes: 1 addition & 1 deletion packages/medusa-payment-paypal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "medusa-payment-paypal",
"version": "1.2.10",
"description": "Paypal Payment provider for Meduas Commerce",
"description": "Paypal Payment provider for Medusa Commerce",
"main": "index.js",
"repository": {
"type": "git",
Expand Down
14 changes: 0 additions & 14 deletions packages/medusa-payment-stripe/.babelrc

This file was deleted.

16 changes: 2 additions & 14 deletions packages/medusa-payment-stripe/.gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
/lib
dist
node_modules
.DS_store
.env*
/*.js
!index.js
yarn.lock

/dist

/api
/services
/models
/subscribers
/helpers
/__mocks__
yarn.lock
8 changes: 0 additions & 8 deletions packages/medusa-payment-stripe/.npmignore

This file was deleted.

10 changes: 9 additions & 1 deletion packages/medusa-payment-stripe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ Learn more about how you can use this plugin in the [documentaion](https://docs.
{
api_key: "STRIPE_API_KEY",
webhook_secret: "STRIPE_WEBHOOK_SECRET",
automatic_payment_methods: true

// automatic_payment_methods: true,

// This description will be used if the cart context does not provide one.
// payment_description: "custom description to apply",
}
```

## Automatic Payment Methods

If you wish to use [Stripe's automatic payment methods](https://stripe.com/docs/connect/automatic-payment-methods) set the `automatic_payment_methods` flag to true.

## Deprecation

The stripe plugin version `>=1.2.x` requires medusa `>=1.8.x`
1 change: 0 additions & 1 deletion packages/medusa-payment-stripe/index.js

This file was deleted.

13 changes: 13 additions & 0 deletions packages/medusa-payment-stripe/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
globals: {
"ts-jest": {
tsconfig: "tsconfig.spec.json",
isolatedModules: false,
},
},
transform: {
"^.+\\.[jt]s?$": "ts-jest",
},
testEnvironment: `node`,
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],
}
41 changes: 16 additions & 25 deletions packages/medusa-payment-stripe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,37 @@
"name": "medusa-payment-stripe",
"version": "1.1.53",
"description": "Stripe Payment provider for Meduas Commerce",
"main": "index.js",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "https://github.com/medusajs/medusa",
"directory": "packages/medusa-payment-stripe"
},
"author": "Sebastian Rindom",
"files": [
"dist"
],
"author": "Medusa",
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"@babel/node": "^7.7.4",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@babel/plugin-transform-classes": "^7.9.5",
"@babel/plugin-transform-instanceof": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.7.5",
"@babel/register": "^7.7.4",
"@babel/runtime": "^7.9.6",
"client-sessions": "^0.8.0",
"cross-env": "^5.2.1",
"jest": "^25.5.4",
"medusa-interfaces": "^1.3.6",
"medusa-test-utils": "^1.1.37"
},
"scripts": {
"prepare": "cross-env NODE_ENV=production yarn run build",
"test": "jest --passWithNoTests src",
"build": "babel src --out-dir . --ignore '**/__tests__','**/__mocks__'",
"watch": "babel -w src --out-dir . --ignore '**/__tests__','**/__mocks__'"
"build": "tsc",
"watch": "tsc --watch"
},
"devDependencies": {
"@medusajs/medusa": "^1.7.7",
"@types/stripe": "^8.0.417",
"cross-env": "^5.2.1",
"jest": "^25.5.4"
},
"peerDependencies": {
"medusa-interfaces": "1.3.6"
"@medusajs/medusa": "^1.7.7"
},
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"medusa-core-utils": "^1.1.39",
"stripe": "^8.50.0"
"medusa-core-utils": "^1.1.38",
"stripe": "^11.10.0"
},
"gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808",
"keywords": [
Expand Down
30 changes: 30 additions & 0 deletions packages/medusa-payment-stripe/src/__fixtures__/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const PaymentIntentDataByStatus = {
REQUIRES_PAYMENT_METHOD: {
id: "requires_payment_method",
status: "requires_payment_method",
},
REQUIRES_CONFIRMATION: {
id: "requires_confirmation",
status: "requires_confirmation",
},
PROCESSING: {
id: "processing",
status: "processing",
},
REQUIRES_ACTION: {
id: "requires_action",
status: "requires_action",
},
CANCELED: {
id: "canceled",
status: "canceled",
},
REQUIRES_CAPTURE: {
id: "requires_capture",
status: "requires_capture",
},
SUCCEEDED: {
id: "succeeded",
status: "succeeded",
},
}
Loading