@@ -4,201 +4,6 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ ) and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
6
6
7
- ## v1.2.1
8
-
9
- Added
10
-
11
- - New custom field for transaction: ` sctm_transaction_refund_for_mollie_payment ` which would store the Mollie Payment ID that need to be refunded
12
-
13
- Fixes
14
-
15
- [ Create Refund] ( ./docs/CreateRefund.md )
16
- - Handling the Refund Creation for the case that the Payment has more than one Success Charge transaction
17
- - Changing the way to determine the Create Refund action:
18
- - Before
19
- ``` Typescript
20
- // processor/src/utils/paymentAction.utils.ts
21
-
22
- if (groups .successCharge .length === 1 && groups .initialRefund .length ) {
23
- return ConnectorActions .CreateRefund ;
24
- }
25
- ```
26
-
27
- - After
28
- ` ` ` Typescript
29
- // processor/src/utils/paymentAction.utils.ts
30
-
31
- if (groups.successCharge.length >= 1 && groups.initialRefund.length) {
32
- return ConnectorActions.CreateRefund;
33
- }
34
- ` ` `
35
-
36
- - We are supporting to create the refund for the payment which has more than one Success Charge transactions
37
- - By default , we will create the Refund for the latest Success Charge transaction . For example :
38
- ` ` ` Typescript
39
- // CommerceTools Payment
40
- {
41
- id: 'payment-id',
42
- transactions: [
43
- {
44
- type: 'Charge',
45
- state: 'Success',
46
- interactionId: 'tr_123456' // Mollie Payment ID
47
- },
48
- {
49
- type: 'Charge',
50
- state: 'Success',
51
- interactionId: 'tr_999999' // Mollie Payment ID
52
- },
53
- {
54
- type: 'Refund',
55
- state: 'Initial', // Creating a Refund for the Mollie Payment tr_999999
56
- },
57
- ]
58
- }
59
- ` ` `
60
-
61
- - 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 :
62
-
63
- ` ` ` Typescript
64
- // CommerceTools Payment
65
- {
66
- id: 'payment-id',
67
- transactions: [
68
- {
69
- type: 'Charge',
70
- state: 'Success',
71
- interactionId: 'tr_123456' // Mollie Payment ID
72
- },
73
- {
74
- type: 'Charge',
75
- state: 'Success',
76
- interactionId: 'tr_999999' // Mollie Payment ID
77
- },
78
- {
79
- type: 'Refund',
80
- state: 'Initial',
81
- custom: {
82
- type: {
83
- ...
84
- },
85
- fields: {
86
- sctm_transaction_refund_for_mollie_payment: 'tr_123456' // Creating a Refund for the Mollie Payment tr_123456
87
- }
88
- }
89
- },
90
- ]
91
- }
92
- ` ` `
93
-
94
- [Cancel Refund ](./ docs / CancelPaymentRefund .md )
95
- - Following the changes for creating refund , we also updated the handler for Refund Cancellation to match with the above changes
96
- - Changing the way to determine the Cancel Refund action :
97
- - Before
98
- ` ` ` Typescript
99
- // processor/src/utils/paymentAction.utils.ts
100
-
101
- if (
102
- groups.successCharge.length === 1 &&
103
- groups.pendingRefund.length === 1 &&
104
- groups.initialCancelAuthorization.length === 1
105
- ) {
106
- return ConnectorActions.CancelRefund;
107
- }
108
- ` ` `
109
-
110
- - After
111
- ` ` ` Typescript
112
- // processor/src/utils/paymentAction.utils.ts
113
-
114
- if (
115
- groups.successCharge.length >= 1 &&
116
- groups.pendingRefund.length >= 1 &&
117
- groups.initialCancelAuthorization.length === 1
118
- ) {
119
- return ConnectorActions.CancelRefund;
120
- }
121
- ` ` `
122
-
123
- - 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 :
124
- ` ` ` Typescript
125
- // CommerceTools Payment
126
- {
127
- id: 'payment-id',
128
- transactions: [
129
- {
130
- type: 'Charge',
131
- state: 'Success',
132
- interactionId: 'tr_123456' // Mollie Payment ID
133
- },
134
- {
135
- type: 'Charge',
136
- state: 'Success',
137
- interactionId: 'tr_999999' // Mollie Payment ID
138
- },
139
- {
140
- id: 'refund-transaction-1',
141
- type: 'Refund',
142
- state: 'Pending',
143
- interactionId: 're_123456', // Mollie Refund ID
144
- },
145
- {
146
- id: 'refund-transaction-2',
147
- type: 'Refund',
148
- state: 'Pending',
149
- interactionId: 're_999999', // Mollie Refund ID
150
- },
151
- {
152
- type: 'CancelAuthorization',
153
- state: 'Initial'
154
- // interactionId is not set
155
- }
156
- ]
157
- }
158
-
159
- // In this case, this will be considered as a Cancellation request for the Pending Refund with id: refund-transaction-2
160
- ` ` `
161
- __ * 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 .__
162
-
163
- - 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 :
164
- ` ` ` Typescript
165
- // CommerceTools Payment
166
- {
167
- id: 'payment-id',
168
- transactions: [
169
- {
170
- type: 'Charge',
171
- state: 'Success',
172
- interactionId: 'tr_123456' // Mollie Payment ID
173
- },
174
- {
175
- type: 'Charge',
176
- state: 'Success',
177
- interactionId: 'tr_999999' // Mollie Payment ID
178
- },
179
- {
180
- id: 'refund-transaction-1',
181
- type: 'Refund',
182
- state: 'Pending',
183
- interactionId: 're_123456', // Mollie Refund ID
184
- },
185
- {
186
- id: 'refund-transaction-2',
187
- type: 'Refund',
188
- state: 'Pending',
189
- interactionId: 're_999999', // Mollie Refund ID
190
- },
191
- {
192
- type: 'CancelAuthorization',
193
- state: 'Initial',
194
- interactionId: 're_123456' // Mollie Refund ID that you want to cancel
195
- }
196
- ]
197
- }
198
-
199
- // In this case, this will be considered as a Cancellation request for the Pending Refund with id: refund-transaction-1
200
- ` ` `
201
-
202
7
## v1.2.0
203
8
204
9
Added
0 commit comments