PaymentGateway Abstract Entity
The PaymentGateway abstract entity adds functionality to control
exchange of events with a payment gateway. The PaymentGateway entity
has three abstract functions and includes one data entity:
- The PaymentGateway.Data.Application entity for definition of
fields that is used to control communication with a payment gateway.
The PaymentGateway.Data.Application entity is ancestor to the
PaymentWebShop.Data. Shop entity, and the Shop entity replaces the PaymentGateway.Data.Application
entity for the abstract functions of PaymentGateway. This way
the Shop entity is used to store attributes of the payment gateway used by siblings of the abstract functions.
The PaymentGateway has the following abstract functions that
serves as ancestors to functions involved in exchange with a payment
gateway:
- The ReceiveFromExternalServer function is an ancestor for
event handlers that must be activated when events are received from a
payment gateway.
It is assumed that the event carries a ApplicationID and a
PaymentSessionID parameter field.
- The SendToExternalServer function is an ancestor for
event handlers that model events send to payment gateway. The
SendToExternalServer functions are never activated but are used to model
the HTML FORM generated by a _DocumentTemplateGenerator
function for an external payment gateway event.
The event carries an ApplicationID and a PaymentSessionID
parameter field.
- The PageGeneratorWithExternalEvent function is an
ancestor for page generators that include or comprise a
SendToExternalServer event handler function. There can only be
one SendToExternalServer event handler for the page
generator.
The WsyDetails variable must include a field derived from
PaymentWebShop.Abstract.PaymentGateway.Fields.ExternalServerURL.
This field is used as the dynamic URL field of the FORM ACTION
attribute for the SendToExternalServer event handler.
In the Shop table the two fields
PaymentClearingURL and PaymentCaptureURL inherits from
ExternalServerURL.
At run-time, a PageGeneratorWithExternalEvent function
loads the current Shop instance for the user
session, and replaces the matching FORM ACTION URL field.
E.g. the PaymentWebShop.Web.Ordering.Submit Payment function
inherits from PageGeneratorWithExternalEvent and defines the
Shop field PaymentClearingURL for WsyDetails.
Note! For each SendToExternalServer function there
will be one or more corresponding ReceiveFromExternalServer
functions. Whenever a document with a SendToExternalServer
function is generated, the digital signature of its Hidden fields are
stored in the Session table in the field LastExternalSignature.
This digital signature is used for verification of the first incoming ReceiveFromExternalServer
event. Therefore the fields of the Hidden variable of these functions must match
in order and content.
PaymentGateway Inheritance
The PaymentGateway entity inherits from the WSYUTIL/ExternalServerControl pattern.