iFrame testing

API docs for version 1 of the Spreedly iFrame Javascript API

🚧

Legacy iFrame (version 1.140 and older) and non-secure tokenization will be deprecated on October 31, 2026, with end of life on December 31, 2028. See the iFrame payment form guide for what's changing and how to stay supported.

Many development teams utilize automated testing to test their browser-based workflows. The following functions should aid in that endeavor.

setValue

Set the value the iFrame fields to a known test value. Any values that are not on the allowed list will be silently rejected.

Spreedly.on("ready", function() {
  Spreedly.setValue("number", "4111111111111111");
  Spreedly.setValue("cvv", "123");
});

Signature

setValue(field, value)

Arguments

NameDescription
fieldThe iFrame field to set the value. Can be one of number or cvv.
valueThe value to set the field to. The number field will only accept test card numbers. The cvv field will only accept 12, 123, or 1234

Scheduled releases

Spreedly offers staggered, scheduled iFrame release channels for users that wish to test changes before accepting them. This can be declared in the script tag before initializing iFrame.

<head>
    <script> src="https://core.spreedly.com/iframe/iframe-[desired channel].min.js" </script>
</head>

The recommended release channels are:

  • v1 is the most current version and is continuously updated with no set release schedule.
  • candidate is updated on the 1st Tuesday of every month to matchiframe-v1
  • stable is updated on the 3rd Tuesday of every month to match the latest version of iframe-candidate

iFrame Changelog RSS feed is available here: https://core.spreedly.com/iframe/feed.xml.

If you encounter issues while using these release channels, please contact support for assistance.


Did this page help you?