NAME
AuthRevReq - SET AuthRevReq message data structures and routines
SYNOPSIS
#include <set_msg.h>

typedef struct AuthRevReq_ {
    asn1set__MessageWrapper         messageWrapper;
    asn1set__AuthRevReqData         authRevReqData;
    asn1set__AuthRevReqBaggage      authRevReqBaggage;
    cert_identity                   merchantSignatureCID;
    cert_identity                   gatewayKeyExchangeCID;

    /* only Gateway uses pi_content */
    struct PI_                      pi_content;
} *AuthRevReq;

AuthRevReq safe_cast_AuthRevReq(msg)
    set_msg            msg;             /* IN */
DESCRIPTION
AuthRevReq contains the data from a SET AuthRevReq message in native C form. See the asn_types.h and asn1set.h header files for the declarations of the various types. See the SET specification for a description of individual fields.

AuthRevReq message objects of type set_msg can be cast to type AuthRevReq using the safe_cast_AuthRevReq() routine.

Merchant software should ignore pi_content.

FIELDS
See documentation on PI for information on the struct PI_ field.

If the PInitReq/PInitRes pair was not exchanged, then before calling make_set_msg(), merchant software must insert the following state into the cache_ctx:

*      STATE_GATEWAY_KEYID
*      STATE_MERCHANT_SIGID

A call to make_set_msg() results in the protocol layer filling in the following fields:
 *    messageWrapper.messageHeader.version
 *    messageWrapper.messageHeader.date
 *    messageWrapper.messageHeader.messageIDs
 *    messageWrapper.messageHeader.rrPID
 *    messageWrapper.messageHeader.swIdent
 *    messageWrapper.message._choice
 *    authRevReqData.authRevTags.authRevRRTags.rrpid
 *    authRevReqData.authReqData
 *    authRevReqData.authResPayload
 *    authRevReqBaggage.capToken
 *    authRevReqBaggage.pi
 *    merchantSignatureCID
 *    gatewayKeyExchangeCID
It is unwise for applications to change the contents of the fields filled in by the protocol layer.

After calling make_set_msg(), merchant software must fill in the following required fields:

 *    authRevReqData.authRevTags.authRevRRTags.merTermIDs.merchantID
 *    authRevReqData.authRevTags.authRevRRTags.currentDate
 *    authRevReqData.authNewAmt
Non-required fields can be left empty, at the discretion of the merchant application.
CACHING
Payment Gateway
      STATE_AUTHRETNUM               put
      STATE_AUTHREVREQ_RRPID         put
      STATE_CARDEXPIRY               put
      STATE_GATEWAY_KEYID            put
      STATE_GATEWAY_SIGID            put
      STATE_MERCHANT_KEYID           put
      STATE_PAN                      put
      STATE_RRTAGS                   put
      STATE_TRANSIDS                 put
Merchant
      STATE_AUTHREQDATA              get
      STATE_AUTHREQ_RRPID            get
      STATE_AUTHRESPAYLOAD           get
      STATE_AUTHRETNUM               get
      STATE_AUTHREVREQ_RRPID         put
      STATE_CAPTOKEN                 get
      STATE_GATEWAY_KEYID            get
      STATE_MERCHANT_SIGID           get
      STATE_PI                       get
RETURN VALUES
On success, safe_cast_AuthRevReq() returns a pointer to an AuthRevReq data structure. Objects of type set_msg that were not created with message type asn1set__Message__authRevReq will cause safe_cast_AuthRevReq() to fail. On failure, safe_cast_AuthRevReq() returns a 0 pointer.
SEE ALSO
set_msg, AuthRes, CapReq, CapRes, PInitReq, PInitRes, PReq, PRes
NOTES
There is a difference between non-required and optional. Non-required fields may be omitted according to the SET protocol. Optional fields may be omitted according to ASN.1 encoding rules. In some messages, a field may be optional according to ASN.1, but still required by the SET protocol. In these cases, the application must fill in these fields.

Optional fields that are filled in require an application of the SET_PRESENT() macro. See documentation on ASN.1/DER runtime types for additional information.

EXAMPLE
A more complete, explicated example is provided in the Implementor's Guide.
    status = create_set_msg(&request, app_ctx, heap);
    assert(status == NO_ERROR);

    msg_type = asn1set__Message__authRevReq;
    status = make_set_msg(request, app_ctx, msg_cache, msg_type);
    assert(status == NO_ERROR);

    authRevReq = safe_cast_AuthRevReq(request);
    assert(authRevReq != 0);
   
    authRevReq->messageWrapper.messageHeader.swIdent._choice = asn1set__SWIdent__visibleString;
    authRevReq->messageWrapper.messageHeader.swIdent.u.visibleString = "MerchantCode v1.0";

    /* ... */

    authRevReq->authRevReqData.authRevTags.authRevRRTags.merTermIDs.
            merchantID.u.visibleString = "MerchantID";
    authRevReq->authRevReqData.authRevTags.authRevRRTags.merTermIDs.
            merchantID._choice = asn1set__MerchantID__visibleString;

    authRevReq->authRevReqData.authRevTags.authRevRRTags.currentDate = time(0);

    /* ... */

    status = send_set_msg(request, app_ctx, msg_cache, outstream)
    assert(status == NO_ERROR);
    
BUGS
This document describes a beta implementation. The information contained in this document may be incomplete and is subject to change.

Copyright © 1996, 1997, Visa International Service Association and MasterCard International Incorporated
All Rights Reserved.