Skip to content

Instantly share code, notes, and snippets.

@fgonzal
Created June 19, 2020 03:16
Show Gist options
  • Select an option

  • Save fgonzal/8f99c2e8833d4d0117a2bbf6f946949d to your computer and use it in GitHub Desktop.

Select an option

Save fgonzal/8f99c2e8833d4d0117a2bbf6f946949d to your computer and use it in GitHub Desktop.

Values can be passed from one test the following using variables.

As an example, let's say we have a purchase and a reversal, and you want to use the purchase approval code in the reversal message.

Your purchase test would look something like this:

   <test file="auth" continue="no" 
         name="Card ok, account 00.858 auth for $40.00 GOOD">
    <init>DATE=new Date();
     CURRENCY="858"; AMOUNT="4000";
     PAN="6009330000000011"; MTI="2100"; EXP="4901"; PCODE="000000"; RC="0000"
    </init>
    <post>
     ORIGINAL_AUTHCODE = response.getString(38);
    </post>
   </test>

Please, note the post block. There, the value received in field 38 is stored in the ORIGINAL_AUTHCODE variable.

Then, in the XML of your reversal request, you would do something like this:

   <field id="38" value="!ORIGINAL_AUTHCODE" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment