Creating the body of the request is a critical step in the merchant integration. The form fields from the payer-facing form together with your configuration fields are submitted to the Tyro eCommerce Payment GatewayWeb Services Integration URL using HTTPS POST/PUT/GET depending on the chosen protocol (REST-JSON/NVP) and the transaction operation.
The payer-facing form must only ever expose those fields that require input from the payer.
Sample HTML forms for basic operations such as authorize, capture, refund, and pay have been included in the example code. See Downloads.
Regardless of your language or protocol, it is important that your integration formats the transaction request data or body correctly. In many languages it is common to receive the data entered by a payer in a Form as an array. In most cases, it is then suitable to use an array to store the field names and values for each field you intend to pass to the Tyro eCommerce Payment Gateway and format it as demonstrated below.
The below code snippets complete two critical functions to result in a correctly formatted transaction request body:
Select Protocol and Language to view Code Snippet.
From: Sample Code Download