Skip to content

Commit 8e05b65

Browse files
committed
Previous commit had a syntax error(missing <if>), and once that was
fixed, then the result processing also needed an additional update(to place the previous $foundGatewayCimId back into the new $paymentMethod).
1 parent b2c883e commit 8e05b65

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

service/AuthorizeDotNet/CimServices.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ along with this software (see the LICENSE.md file). If not, see
8989
<set field="expireDateFormatted" value="${expireYear}-${expireMonth}"/>
9090
<!-- correct masking if needed, use only 'X' -->
9191
<set field="cardNumber" from="creditCard.cardNumber?.replaceAll(/\D/, 'X')"/>
92+
<if condition="paymentMethod.gatewayCimId"><then>
9293
<!-- current paymentMethod has a gatewayCimId -->
9394
<set field="foundGatewayCimId" from="paymentMethod.gatewayCimId"/>
9495
</then><else>
@@ -220,8 +221,13 @@ along with this software (see the LICENSE.md file). If not, see
220221

221222
<!-- set the gatewayCimId values for Party and PaymentMethod as needed -->
222223
<if condition="paymentMethod.gatewayCimId"><then>
223-
<!-- have a payment profile, called updateCustomerPaymentProfileRequest, no need to do anything -->
224-
</then><else-if condition="party.gatewayCimId">
224+
<!-- current paymentMethod has a profile, no need to do anything -->
225+
</then><else-if condition="foundGatewayCimId">
226+
<!-- Updating a previous profile, attach to the current paymentMethod -->
227+
<set field="paymentMethod.gatewayCimId" from="foundGatewayCimId"/>
228+
<set field="paymentMethod.paymentGatewayConfigId" from="paymentGatewayConfigId"/>
229+
<entity-update value-field="paymentMethod"/>
230+
</else-if><else-if condition="party.gatewayCimId">
225231
<!-- no payment profile but we have a customer profile, called createCustomerPaymentProfileRequest -->
226232
<set field="paymentMethod.gatewayCimId" from="responseNode.customerPaymentProfileId.text()"/>
227233
<set field="paymentMethod.paymentGatewayConfigId" from="paymentGatewayConfigId"/>

0 commit comments

Comments
 (0)