Tyro.js

Tyro.js is a public Javascript library provided by Tyro. It provides a simple interface to enable integration with the Pay API from your frontend code.

Including Tyro.js

  • Include the Tyro.js script on the checkout page of your HTTPS website.
  • For PCI Compliance, Tyro.js should always be loaded directly from https://pay.connect.tyro.com/v1/tyro.js rather than included in a bundle or hosted yourself.

Implementation

Copy
Copied
<!-- HTML sample code -->
<script src="https://pay.connect.tyro.com/v1/tyro.js"></script>

Instantiate Tyro.js

  • After adding the Tyro.js script tag in the header, we need to instantiate it.
  • Use Tyro(config) to create an instance of the Tyro.js object. The Tyro.js object is the entrypoint to the rest of the methods of Tyro.js.

Config Parameters

liveMode
required
boolean

Toggles between the live and sandbox environment. Defaults to false.

Implementation

Copy
Copied
// Javascript sample code
const tyro = Tyro({
  liveMode: false
});
Copyright © Tyro Payments 2019-2024. All right reserved.