#include <set_msg.h> /* * CredReq is defined using CapRevOrCredReq */ #define CredReq_ CapRevOrCredReq_ #define CredReq 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; CredReq safe_cast_CredReq(msg) set_msg msg; /* IN */
CredReq
contains the data from a SET CredReq 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. CredReq
message objects of type set_msg
can be cast to type CredReq
using the
safe_cast_CredReq()
routine.
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 CredReq
message contains only a single CapItem, SETREF will insert this
panToken
into CredReq
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 * 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 CredReq
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_CredReq()
returns a pointer to a CredReq
data structure. Objects of type
set_msg
that were not created with message type asn1set__Message__credReq
will cause
safe_cast_CredReq()
to fail. On failure, safe_cast_CredReq()
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.
credReq = safe_cast_CredReq(request); assert(credReq != 0); credReq->messageWrapper.messageHeader.swIdent._choice = asn1set__SWIdent__visibleString; credReq->messageWrapper.messageHeader.swIdent.u.visibleString = "MerchantCode v1.0"; /* ... */ credReq->capRevOrCredReqData.capRevOrCredRRTags. merTermIDs.merchantID.u.visibleString = MERCHANT_ID_STRING; credReq->capRevOrCredReqData.capRevOrCredRRTags. merTermIDs.merchantID._choice = asn1set__MerchantID__visibleString; /* ... */