Skip to content

Commit

Permalink
Previous commit had a syntax error(missing <if>), and once that was
Browse files Browse the repository at this point in the history
fixed, then the result processing also needed an additional update(to
place the previous $foundGatewayCimId back into the new $paymentMethod).
  • Loading branch information
eigood committed Mar 9, 2022
1 parent b2c883e commit b41a847
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions data/AuthorizeDotNetDemoData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ along with this software (see the LICENSE.md file). If not, see
transactionUrl="https://test.authorize.net/gateway/transact.dll"
login="" tranKey="" apiVersion="3.1" duplicateWindow="120"
testRequest="TRUE" emailCustomer="FALSE" emailMerchant="FALSE"/>
<!--
dbclarkIII
Dougbike1!
2Q5eyV8U
23KDBRjf82586h23
-->
<!-- to set this payment gateway on a product store add a record like:
<mantle.product.store.ProductStorePaymentGateway productStoreId="POPC_DEFAULT"
paymentInstrumentEnumId="PiCreditCard" paymentGatewayConfigId="AuthorizeDotNetAimDemo"/>
Expand Down
10 changes: 8 additions & 2 deletions service/AuthorizeDotNet/CimServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ along with this software (see the LICENSE.md file). If not, see
<set field="expireDateFormatted" value="${expireYear}-${expireMonth}"/>
<!-- correct masking if needed, use only 'X' -->
<set field="cardNumber" from="creditCard.cardNumber?.replaceAll(/\D/, 'X')"/>
<if condition="paymentMethod.gatewayCimId"><then>
<!-- current paymentMethod has a gatewayCimId -->
<set field="foundGatewayCimId" from="paymentMethod.gatewayCimId"/>
</then><else>
Expand Down Expand Up @@ -220,8 +221,13 @@ along with this software (see the LICENSE.md file). If not, see

<!-- set the gatewayCimId values for Party and PaymentMethod as needed -->
<if condition="paymentMethod.gatewayCimId"><then>
<!-- have a payment profile, called updateCustomerPaymentProfileRequest, no need to do anything -->
</then><else-if condition="party.gatewayCimId">
<!-- current paymentMethod has a profile, no need to do anything -->
</then><else-if condition="foundGatewayCimId">
<!-- Updating a previous profile, attach to the current paymentMethod -->
<set field="paymentMethod.gatewayCimId" from="foundGatewayCimId"/>
<set field="paymentMethod.paymentGatewayConfigId" from="paymentGatewayConfigId"/>
<entity-update value-field="paymentMethod"/>
</else-if><else-if condition="party.gatewayCimId">
<!-- no payment profile but we have a customer profile, called createCustomerPaymentProfileRequest -->
<set field="paymentMethod.gatewayCimId" from="responseNode.customerPaymentProfileId.text()"/>
<set field="paymentMethod.paymentGatewayConfigId" from="paymentGatewayConfigId"/>
Expand Down

0 comments on commit b41a847

Please sign in to comment.