WebSession servers and the Subscribe database.

- Your customer requests a page from your Web application (makes an HTTP call to your Web site), such as your Order page, which requires that they submit payment information.
-
Call
WebSession.initialize()in the Subscribe API to initialize aWebSessionobject on the Vindicia server. In theWebSessionobject, specify two key attributes:-
The IP address from which the customer requested the order form. For example:
billing_CODE_ONLY.php:$ws->setIpAddress($ip_address); -
The API call HOA should make when the customer submits the form. For example, calling
PaymentMethod.update()allows you to create a new payment method. For example:<div id="vin_PaymentMethod_creditCard_account"></div>Theinitializecall creates aWebSessionobject, which may include amethoddata member. You can use this data member to specify the SOAP call for which this WebSession is acting as proxy. Valid input includes:Account_UpdateAccount_UpdatePaymentMethodAutoBill_UpdatePaymentMethod_UpdatePaymentMethod_ValidateTransaction_AuthTransaction_AuthCapture(Theinitializecall takes several parameters to mitigate the risk of an unauthenticated call.)
-
The IP address from which the customer requested the order form. For example:
-
After the
initialize()call is made, theWebSessionobject returns a Vindicia ID (VID). This VID is used to track the HOA session, and serves as a means of control and authentication. Only one VID is generated per session, and it has a time limit for validity. Subscribe returns theWebSessionVIDto your application in response to theinitialize()call. Other form elements, hidden or to be provided by the customer, must be consistent with the data required to complete aPaymentMethod.update()call (or other API call, listed above). The form’s action URL points to the HOA address on the Vindicia server. -
Return the checkout form from the merchant server to the browser with this
VID.This will be a hidden field calledWebSessionId.Note: Steps 1 through 4 are parts of a single synchronous call and response chain initiated by the customer’s request for the order form. - As the page loads in the browser, iframes will load from Vindicia.com to protect sensitive payment fields (Hosted Fields).
-
The customer fills out your form, and clicks
SaveorSubmit. The entire form, including the hiddenVIDis posted directly to the Vindicia servers. Your server is bypassed completely with this form submission.. Note: The customer must complete the form within one hour (the default expiration time), or within your specified expiration time, after which Subscribe marks theWebSessionobject expired. -
Vindicia saves the form data to Subscribe in a temporary area. HOA loads the
WebSessionobject withvin_WebSession_VID, which accompanied the form, and stores the data submitted by the order form. Note that HOA does not make the API call to create thePaymentMethodobject at this point in the process. At this point you need only pass in the object attributes you have collected—the remainder can be passed in with theWebSession.finalizecall (Step 10). -
Subscribe returns the
redirectURLback to the browser. If you’re using a pure Ajax solution, theonSubmitCompleteEventis called. Otherwise the browser is redirected to this URL. This URL (theredirectURL) is either your confirmation page or your error page that you previously defined in your web session. -
The browser is either redirected to the merchant page or process for completing the order, or an Ajax call is made to indicate success to the merchant server. The redirect carries the
VIDfor theWebSessionback to the merchant site, allowing you to finalize this session -
Within the page or process resulting from confirmation or Ajax call on the merchant server, you execute a
WebSession.finalizeSOAP call to Vindicia. When you callfinalize, simply pass in the ID of the sparsewebSessionobject (the VID). Do not populate anyprivateFormValuesorpostvalues. In rare cases, you can pass inMethodParamValues—for example if you want to pass in a campaign code to an AutoBill.update call after collecting it in the payment form.WebSession.finalizereturns both the WebSession results and the result for the underlying API calls. (For more information, see Section 19: The WebSession Object in the Subscribe API Guide.) You can also pass other parameters for the Subscribe method that you did not pass initially. -
During the Subscribe
finalize, all temporary session data is converted to objects in the Vindicia database, which Subscribe begins processing immediately. For example, a new AutoBill might capture the funds on a first transaction. -
The
resultsreturned by thefinalize()call contain enough information to either present a Thank You page to the customer or satisfy your Ajax function call, or react to any errors in case more action is required from the customer. - Your merchant server page communicates results to the browser, either through an HTML or an Ajax response.

