Skip to content

Commit

Permalink
Merge pull request #155 from swellstores/fix/reset-async-payment
Browse files Browse the repository at this point in the history
fix: send $reset_async_payment command for payment after authenticate
  • Loading branch information
awwit authored Jan 24, 2024
2 parents d018da4 + c4eb721 commit bb15436
Show file tree
Hide file tree
Showing 14 changed files with 15,523 additions and 19,658 deletions.
13 changes: 11 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime"]
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
[
"@babel/plugin-syntax-import-attributes",
{ "deprecatedAssertSyntax": true }
],
"@babel/plugin-transform-runtime"
]
}
46 changes: 46 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"root": true,
"parser": "@babel/eslint-parser",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"requireConfigFile": false,
"sourceType": "module",
"ecmaVersion": 2021
},
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"es2021": true
},
"rules": {
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
},
"overrides": [
{
"files": [
"*.test.js",
"test/**/*.{js,cjs}",
"mocks/**/*.js"
],
"plugins": ["jest"],
"extends": [
"plugin:react/recommended",
"plugin:jest/recommended"
],
"env": {
"node": true,
"jest/globals": true
},
"rules": {
"n/no-unpublished-require": "off"
}
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"files.watcherExclude": {
"**/dist/*": true
},
"search.exclude": {
"**/dist/*": true
}
}
8 changes: 8 additions & 0 deletions mocks/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const mockPayment = {
return {
id: 'paypal_order_id',
};

case 'stripe':
return { id: 'stripe' };

default:
throw new Error(`Unknown gateway: ${gateway}`);
}
Expand All @@ -62,6 +66,10 @@ const mockPayment = {
}
}),

resetAsyncPayment(id) {
return this.request('put', '/payments', id, { $reset_async_payment: true });
},

onSuccess: jest.fn(),
onCancel: jest.fn(),
onError: jest.fn(),
Expand Down
Loading

0 comments on commit bb15436

Please sign in to comment.