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

typedef struct CapReq_ {
    asn1set__MessageWrapper      messageWrapper;
    asn1set__CapReqData          capReqData;
    asn1set__PANToken            panToken;

    cert_identity                merchantSignatureCID;
    cert_identity                gatewayKeyExchangeCID;

    /* only the Gateway uses */
    struct CapTokenSeq_         *capTokenSeq;

#define                          CapReq__panToken              0
    UCHAR                        _present[1];
} *CapReq;

CapReq safe_cast_CapReq(msg)
    set_msg            msg;             /* IN */
DESCRIPTION
CapReq contains the data from a SET CapReq 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.

CapReq message objects of type set_msg can be cast to type CapReq using the safe_cast_CapReq() routine.

FIELDS
See documentation on CapToken for information on the struct CapTokenSeq_ field.

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
 *    capReqData.capRRTags.rrpid
 *    capReqData.mthumbs
 *    capReqData.capItemSeq->capItem.transIDs
 *    capReqData.capItemSeq->capItem.authRRPID
 *    capReqData.capItemSeq->capItem.capPayload.authReqItem
 *    capReqData.capItemSeq->capItem.capPayload.authResPayload
 *    capTokenSeq

If a PANToken was received during authorization and this CapReq message contains only a single CapItem, SETREF will insert this panToken into CapReq and will set CapReq__panToken present.

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:

 *    capReqData.capRRTags.merTermIDs.merchantID
 *    capReqData.capRRTags.currentDate
 *    capReqData.capItemSeq->capItem.capPayload.capDate
 *    capReqData.capItemSeq->capItem.capPayload.capReqAmt
 *    merchantSignatureCID 
 *    gatewayKeyExchangeCID

Non-required fields may be left empty at the discretion of the merchant application, subject to any business constraints placed on the application.

OPTIONAL FIELDS

The _present element is used for specifying the presence or absence of optional elements. The macros SET_PRESENT(), IS_PRESENT(), SET_ABSENT(), and IS_ABSENT() are used to specify or query the status of optional elements. See documentation on ASN.1/DER runtime types for additional information.

When sending a message, the presence or absence must be set (using SET_PRESENT() or SET_ABSENT()) prior to calling send_set_msg(). It is usually unnecessary to invoke the SET_ABSENT() macro because absent is the default setting for blank messages.

When receiving a message, presence or absence can be determined (using the IS_PRESENT() or IS_ABSENT() macro) after calling decode_set_msg().

CapReq__panToken
Merchant software indicates to SETREF that the data contained in the panToken field should be included in the CapReq message by setting CapReq_panToken to present.

SETREF indicates to gateway software that the panToken field is present by setting CapReq__panToken to present.

CACHING
Payment Gateway
      STATE_CAPREQ_RRPID             put
      STATE_GATEWAY_SIGID            put
      STATE_MERCHANT_KEYID           put
      STATE_RRTAGS                   put
Merchant
      STATE_AUTHREQITEM              get
      STATE_AUTHREQ_RRPID            get
      STATE_AUTHRESPAYLOAD           get
      STATE_BATCHID                  put
      STATE_CAPREQ_RRPID             put
      STATE_CAPTOKEN                 get
      STATE_PANTOKEN                 get
      STATE_TRANSIDS                 get
RETURN VALUES
On success, safe_cast_CapReq() returns a pointer to a CapReq data structure. Objects of type set_msg that were not created with message type asn1set__Message__capReq will cause safe_cast_CapReq() to fail. On failure, safe_cast_CapReq() returns a 0 pointer.
SEE ALSO
set_msg, AuthReq, AuthRes, 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, it is incumbent on the application to 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.
    capReq = safe_cast_CapReq(request);
    assert(capReq != 0);
   
    capReq->messageWrapper.messageHeader.swIdent._choice = asn1set__SWIdent__visibleString;
    capReq->messageWrapper.messageHeader.swIdent.u.visibleString = "MerchantCode v1.0";

    /* ... */

    /* agentNum is an optional INTEGER */         
    capReq->capReqData.capRRTags.merTermIDs.agentNum = N_AGENT;
    SET_PRESENT(capReq->capReqData.capRRTags.merTermIDs,
                asn1set__MerTermIDs__agentNum);
                
    /* ... */

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.