Skip to content

Commit b41a847

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 b41a847

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

data/AuthorizeDotNetDemoData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ along with this software (see the LICENSE.md file). If not, see
3737
transactionUrl="https://test.authorize.net/gateway/transact.dll"
3838
login="" tranKey="" apiVersion="3.1" duplicateWindow="120"
3939
testRequest="TRUE" emailCustomer="FALSE" emailMerchant="FALSE"/>
40+
<!--
41+
dbclarkIII
42+
Dougbike1!
4043
44+
2Q5eyV8U
45+
23KDBRjf82586h23
46+
47+
-->
4148
<!-- to set this payment gateway on a product store add a record like:
4249
<mantle.product.store.ProductStorePaymentGateway productStoreId="POPC_DEFAULT"
4350
paymentInstrumentEnumId="PiCreditCard" paymentGatewayConfigId="AuthorizeDotNetAimDemo"/>

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)