3 Integration Steps for Processing a Redirected Account Entry
Processing a Redirected Account Entry transaction is done in three steps. The first step and the final step are executed from your server and are completed via PaywayWS requests. The middle step is handled by the Redirected Account Entry java script (HostedPay.js). The steps are described in the sections below. During a Redirected Account Entry transaction only the transaction token, transaction result code, and possible error message is available to the browser.
The block diagram below shows the steps for a Redirected Account Entry transaction. Note that the middle step is done by the java script.
WARNING: DO NOT EXECUTE STEPS 1 OR 3 FROM A JAVA SCRIPT. THESE INVOLVE DATA THAT SHOULD NOT BE PASSING THROUGH THE CLIENT BROWSER.
3.1 Queue Transaction
Note: See PaywayWS Credit Card Integration Guide.pdf in the section titled “Interactive Requests” for details on the queue transaction request.
Before loading a payment page to enable the user to enter card account information, you will send PaywayWS a request to queue a payment. This request returns a paywayTransactionToken that is sent to the browser and used to complete the payment. The transaction token is like a PaywayWS session token, except that it can be used only to interact with the queued transaction. This allows Payway to send to the browser the transaction token without concern for a Payway session being hijacked.
The queued payment includes the payment amount, source id, and payment type. Once this step is completed, your Payment Page can be presented. See the PaywayWS Credit Card Integration Guide and the sample application for more on sending the queue payment request.
3.2 Send Queued Transaction
When the user authorizes the payment on the payment page you present, the java script will send the account information and paywayRequestToken to PaywayWS for processing. The results are processed by the java script. Only the result code and any related error message are sent back to the browser. Detailed transaction results can be requested from your sever after the transaction is completed (the java script posts the result code to your server).
Note that the transaction token can be used only to send the queued transaction and read the results.
3.3 Redirected Account Results
Note: See PaywayWS Credit Card Integration Guide.pdf in the section titled “Interactive Requests” for details on the hostedPaymentResults request that returns details for a hosted payment.
In response to the request to send the queued transaction (sendQueuedTransactionPaywayWS request), PaywayWS returns the result code and any error message. This may be all you need to complete the transaction. The java script manages the sendQueuedTransaction request and posts the result code and paywayMessage back to your server. Optionally you can query the transaction details by sending a hostedTransactionResults request to PaywayWS.