#include <set_msg.h> /* * CapRevReq is defined using CapRevOrCredReq */ #define CapRevReq_ CapRevOrCredReq_ #define CapRevReq CapRevOrCredReq /* * * CapRevOrCredReq is used by CapRevReq, CredReq, and CredRevReq * */ typedef struct CapRevOrCredReq_ { asn1set__MessageWrapper messageWrapper; asn1set__CapRevOrCredReqData capRevOrCredReqData; asn1set__PANToken panToken; cert_identity merchantSignatureCID; cert_identity gatewayKeyExchangeCID; /* only the Gateway uses */ struct CapTokenSeq_ *capTokenSeq; #define CapRevOrCredReq__panToken 0 UCHAR _present[1]; } *CapRevOrCredReq; CapRevReq safe_cast_CapRevReq(msg) set_msg msg; /* IN */
CapRevReq
contains the data from a SET CapRevReq 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. CapRevReq
message objects of type set_msg
can be cast to type CapRevReq
using the
safe_cast_CapRevReq()
routine.
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 * capRevOrCredReqData.capRevOrCredRRTags.rrpid * capRevOrCredReqData.mthumbs * capRevOrCredReqData.capRevOrCredReqItemSeq->capRevOrCredReqItem.transIDs * capRevOrCredReqData.capRevOrCredReqItemSeq->capRevOrCredReqItem.authRRPID * capRevOrCredReqData.capRevOrCredReqItemSeq->capRevOrCredReqItem.capPayload.capReqAmt * capRevOrCredReqData.capRevOrCredReqItemSeq->capRevOrCredReqItem.capPayload.capDate * capRevOrCredReqData.capRevOrCredReqItemSeq->capRevOrCredReqItem.capPayload.authReqItem * capRevOrCredReqData.capRevOrCredReqItemSeq->capRevOrCredReqItem.capPayload.authResPayload * capTokenSeq * panToken (optional)
If a PANToken was received during authorization and this CapRevReq
message contains only a single CapItem, SETREF will insert this
panToken
into CapRevReq
and will
set CapRevOrCredReq__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:
* capRevOrCredReqData.capRevOrCredRRTags.merTermIDs.merchantID * capRevOrCredReqData.capRevOrCredRRTags.currentDate * capRevOrCredReqData.capRevOrCredReqItemSeq->capRevOrCredReqItem.capRevOrCredReqAmt (optional) * 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()
.
CapRevOrCredReq__panToken
panToken
field
should be included in the CapRevReq
message by setting CapRevOrCredReq__panToken
to present. SETREF indicates to gateway software that the panToken
field is present by setting
CapRevOrCredReq__panToken
to present.
STATE_CAPAMT put STATE_CAPREVREQ_RRPID; put STATE_CREDREQ_RRPID put STATE_CREDREVREQ_RRPID put STATE_GATEWAY_SIGID put STATE_MERCHANT_KEYID put STATE_RRTAGS put
STATE_AUTHREQITEM get STATE_AUTHREQ_RRPID get STATE_AUTHRESPAYLOAD get STATE_CAPAMT get STATE_CAPDATE get STATE_CAPREQ_RRPID get STATE_CAPREVREQ_RRPID put STATE_CAPTOKEN get STATE_CREDREQ_RRPID put STATE_CREDREVREQ_RRPID put STATE_PANTOKEN get STATE_TRANSIDS get
safe_cast_CapRevReq()
returns a pointer to a CapRevReq
data structure. Objects of type
set_msg
that were not created with message type asn1set__Message__capRevReq
will cause
safe_cast_CapRevReq()
to fail. On failure, safe_cast_CapRevReq()
returns a 0 pointer. 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.
capRevReq = safe_cast_CapRevReq(request); assert(capRevReq != 0); capRevReq->messageWrapper.messageHeader.swIdent._choice = asn1set__SWIdent__visibleString; capRevReq->messageWrapper.messageHeader.swIdent.u.visibleString = "MerchantCode v1.0"; /* ... */ capRevReq->capRevOrCredReqData.capRevOrCredRRTags. merTermIDs.merchantID.u.visibleString = MERCHANT_ID_STRING; capRevReq->capRevOrCredReqData.capRevOrCredRRTags. merTermIDs.merchantID._choice = asn1set__MerchantID__visibleString; /* ... */