Make a Payment for a Web Enrolment.
It is envisaged that this function would be called after the web application has processed a payment using a third party payment provider. After a payment has been processed by the payment gateway, AddWebPayment records the payment details for the enrolment in the VETtrak database.
A Web Enrolment ID (iWebe_ID) is passed as a parameter. This should be the ID returned by the function used to create the enrolment: AddClientWebEnrolment or AddEmployerWebEnrolment.
The parameters, sOrder and sRRN, represent the order number sent by the web application to the payment gateway, and the receipt number returned. Usually, sOrder would incorporate the the Web Enrolment ID in some way.
Successful execution of this function causes the WEBENROL.WEBE_AMOUNT_PAID field to be updated to the value specified by the cAmountPaid parameter. NOTE that cAmountPaid does not increment the initial value of this field, rather cAmountPaid overwrite the initial value of WEBENROL.WEBE_AMOUNT_PAID.
It is intended that, except when errors occur, this function would be called only once for each web enrolment. If circumstances dictate that more than one payment needs to be processed, be aware that the cAmountPaid parameter should reflect the aggregate amount of all payments for this web enrolment.
When this web enrolment is processed, an invoice will be created, and this payment recorded against it. If you wish to specify a purchase number for the invoice, or some other invoice options, call AddWebInvoice to do so. Note that calling this AddWebPayment function to record a payment will always cause an invoice to be created as well as the payment, regardless of whether or not AddWebInvoice is called.
A token is passed for authentication. If the authentication fails, or other errors occur, NO PAYMENT is recorded. The result of the authentication is represented by a TAuthenticate object.
A call to GetWebEnrolment could be used to check the value of database fields updated by AddWebPayment.
Requires a valid registration key entry for the Finance feature.
This function has security level "Protected", and can only be accessed by users that have explicitly been granted permission to the API.
[WebMethod(Description = "Records the specified payment data against the existing web enrolment ID")] public TAuthenticate AddWebPayment(string sToken, int iWebe_ID, string sOrder, string sRRN, decimal cAmountPaid);
Parameters |
Description |
string sToken |
String containing a token. |
int iWebe_ID |
Integer ID of Web Enrolment. |
string sOrder |
String - the Payment Order Number sent to Payment Provider. Maximum length 20 characters. |
string sRRN |
String - the Returned Receipt Number returned from Payment Provider, upon successful completion of the payment transaction. Maximum length 20 characters. |
decimal cAmountPaid |
Currency - the total Amount of all payments (in dollars) made for this Web Enrolment. Generally, if only one payment of processed for a web enrolment, cAmountPaid will be the amount of that payment. |
TAuthenticate : an Authenticate Object containing the result of the update.
Copyright (c) VETtrak 2022. All rights reserved.
|