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

Dump new version #114

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fe7585a
Merge pull request #84 from mollie/chore/remove-package-lock
NghiaDTr Oct 16, 2024
b777f81
Revert "Chore: Remove application/package-lock.json"
NghiaDTr Oct 16, 2024
254ceaa
Merge pull request #85 from mollie/revert-84-chore/remove-package-lock
NghiaDTr Oct 16, 2024
6576b55
MOL-550: Add contribution guidelines
NghiaDTr Oct 25, 2024
63a5ade
Merge pull request #91 from mollie/MOL-550
NghiaDTr Oct 25, 2024
b0f7f34
MOL-487/MOL-488: implement jwt authentication for
tdang1-shopmacher Oct 7, 2024
9bb41bb
MOL-487/MOL-488: switch to use OAuth middleware
tdang1-shopmacher Oct 8, 2024
30dba80
Fix audit
NghiaDTr Oct 25, 2024
afd2d9e
Fix ci
NghiaDTr Oct 25, 2024
97001c5
Get and set a default access token for extension URL
NghiaDTr Oct 27, 2024
6e3e959
Fix lint
NghiaDTr Oct 28, 2024
0e4a7c1
Merge pull request #93 from mollie/chore/without-ca-2
NghiaDTr Oct 28, 2024
ab77925
Chore: Fix SonarQube Quality Gate
NghiaDTr Nov 15, 2024
8055001
Merge pull request #95 from mollie/refactor
NghiaDTr Nov 15, 2024
a793ed3
[1.2.0] Custom application
tdang1-shopmacher Dec 3, 2024
e98417f
[1.2.0] Custom application (cont.)
tdang1-shopmacher Dec 3, 2024
5163122
[1.2.0] Custom application (cont.)
tdang1-shopmacher Dec 3, 2024
5411c8d
[1.2.0] Custom application (cont.) - update test cases
tdang1-shopmacher Dec 3, 2024
9ff4c55
[1.2.0] Custom application (cont.) - update custom type
tdang1-shopmacher Dec 3, 2024
f67f36a
[1.2.0] Custom application (cont.) - update actions
tdang1-shopmacher Dec 3, 2024
40400db
[1.2.0] Custom application (cont.) - update failed test cases
tdang1-shopmacher Dec 3, 2024
0b2f21e
Merge pull request #111 from mollie/release/v1.2.0
tdang1-shopmacher Dec 3, 2024
59afc73
Bugfix/MOL-587: Potential Bug: autoRefund triggered in CT but not tri…
NghiaDTr Dec 10, 2024
c5943c2
Update package version
NghiaDTr Dec 10, 2024
b331e90
Bugfix/MOL-587: Resolve develop
NghiaDTr Dec 10, 2024
7e0b22a
Fix test
NghiaDTr Dec 10, 2024
0c7c6b9
Fix based on reviews
NghiaDTr Dec 10, 2024
a6c34a9
Merge branch 'bugfix/MOL-587' of github.com:mollie/commercetools-conn…
NghiaDTr Dec 10, 2024
f6a14ba
Merge pull request #113 from mollie/bugfix/MOL-587-staging
NghiaDTr Dec 11, 2024
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
206 changes: 204 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,206 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## v1.2.0-alpha
## v1.2.1

Added

- Mollie custom application initialization
- New custom field for transaction: `sctm_transaction_refund_for_mollie_payment` which would store the Mollie Payment ID that need to be refunded

Fixes

[Create Refund](./docs/CreateRefund.md)
- Handling the Refund Creation for the case that the Payment has more than one Success Charge transaction
- Changing the way to determine the Create Refund action:
- Before
```Typescript
// processor/src/utils/paymentAction.utils.ts

if (groups.successCharge.length === 1 && groups.initialRefund.length) {
return ConnectorActions.CreateRefund;
}
```

- After
```Typescript
// processor/src/utils/paymentAction.utils.ts

if (groups.successCharge.length >= 1 && groups.initialRefund.length) {
return ConnectorActions.CreateRefund;
}
```

- We are supporting to create the refund for the payment which has more than one Success Charge transactions
- By default, we will create the Refund for the latest Success Charge transaction. For example:
```Typescript
// CommerceTools Payment
{
id: 'payment-id',
transactions: [
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_123456' // Mollie Payment ID
},
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_999999' // Mollie Payment ID
},
{
type: 'Refund',
state: 'Initial', // Creating a Refund for the Mollie Payment tr_999999
},
]
}
```

- However, you can also specify the Mollie Payment ID (which stored in the `interactionId` of the Success Charge transaction) that you want to create a refund for by adding the Mollie Payment ID to the custom field `sctm_transaction_refund_for_mollie_payment` of the Initial Refund transaction. For example:

```Typescript
// CommerceTools Payment
{
id: 'payment-id',
transactions: [
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_123456' // Mollie Payment ID
},
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_999999' // Mollie Payment ID
},
{
type: 'Refund',
state: 'Initial',
custom: {
type: {
...
},
fields: {
sctm_transaction_refund_for_mollie_payment: 'tr_123456' // Creating a Refund for the Mollie Payment tr_123456
}
}
},
]
}
```

[Cancel Refund](./docs/CancelPaymentRefund.md)
- Following the changes for creating refund, we also updated the handler for Refund Cancellation to match with the above changes
- Changing the way to determine the Cancel Refund action:
- Before
```Typescript
// processor/src/utils/paymentAction.utils.ts

if (
groups.successCharge.length === 1 &&
groups.pendingRefund.length === 1 &&
groups.initialCancelAuthorization.length === 1
) {
return ConnectorActions.CancelRefund;
}
```

- After
```Typescript
// processor/src/utils/paymentAction.utils.ts

if (
groups.successCharge.length >= 1 &&
groups.pendingRefund.length >= 1 &&
groups.initialCancelAuthorization.length === 1
) {
return ConnectorActions.CancelRefund;
}
```

- To support the old versions, we will create the cancellation for the latest Pending Refund transaction (which is a pending refund for the latest Success Charge transaction in that payment). For example:
```Typescript
// CommerceTools Payment
{
id: 'payment-id',
transactions: [
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_123456' // Mollie Payment ID
},
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_999999' // Mollie Payment ID
},
{
id: 'refund-transaction-1',
type: 'Refund',
state: 'Pending',
interactionId: 're_123456', // Mollie Refund ID
},
{
id: 'refund-transaction-2',
type: 'Refund',
state: 'Pending',
interactionId: 're_999999', // Mollie Refund ID
},
{
type: 'CancelAuthorization',
state: 'Initial'
// interactionId is not set
}
]
}

// In this case, this will be considered as a Cancellation request for the Pending Refund with id: refund-transaction-2
```
__*Note:* The above solution is just for supporting the old versions and will be remove in the near future (in next versions). From this version, please follow the below solution.__

- However, to do it in a correct way, from this version, you should specify the Mollie Refund ID (which stored in the `interactionId` of the Pending Refund transaction) that you want to cancel by putting it in the `interactionId` of the Initial CancelAuthorization. For example:
```Typescript
// CommerceTools Payment
{
id: 'payment-id',
transactions: [
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_123456' // Mollie Payment ID
},
{
type: 'Charge',
state: 'Success',
interactionId: 'tr_999999' // Mollie Payment ID
},
{
id: 'refund-transaction-1',
type: 'Refund',
state: 'Pending',
interactionId: 're_123456', // Mollie Refund ID
},
{
id: 'refund-transaction-2',
type: 'Refund',
state: 'Pending',
interactionId: 're_999999', // Mollie Refund ID
},
{
type: 'CancelAuthorization',
state: 'Initial',
interactionId: 're_123456' // Mollie Refund ID that you want to cancel
}
]
}

// In this case, this will be considered as a Cancellation request for the Pending Refund with id: refund-transaction-1
```

## v1.2.0

Added

- Mollie custom application

Updated

Expand Down Expand Up @@ -59,6 +254,13 @@ Added
- DockerImage for self hosting on AWS
- Installation endpoint for required configurations

## v1.0.4

Added

- Add configuration to enable authorization mode
- OAuth middleware for securing connector endpoint

## v1.0.3

Added
Expand Down
2 changes: 1 addition & 1 deletion application/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ENABLE_NEW_JSX_TRANSFORM="true"
FAST_REFRESH="true"
FAST_REFRESH="true"
4 changes: 2 additions & 2 deletions application/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENABLE_NEW_JSX_TRANSFORM="true"
FAST_REFRESH="true"

ENTRY_POINT_URI_PATH="mollie"
PROJECT_KEY="shopm-adv-dev"
PROJECT_KEY="your-project-key"
CLOUD_IDENTIFIER="gcp-eu"
CUSTOM_APPLICATION_ID="app-id"
APPLICATION_URL="http://localhost:3001"
APPLICATION_URL="http://localhost:3001"
2 changes: 1 addition & 1 deletion application/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dist
# Cypress
cypress/.env
cypress/screenshots/**
cypress/videos/**
cypress/videos/**
2 changes: 1 addition & 1 deletion application/cypress/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ CYPRESS_LOGIN_PASSWORD=<your-password>
CYPRESS_PROJECT_KEY=<your-project-key>
CYPRESS_PACKAGE_NAME="application"
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/"
CYPRESS_LOCALE="en-GB"
CYPRESS_LOCALE="en-GB"
Loading
Loading