GiftCard

An object with the methods to create and set up a Gift Cards payment.

Created by calling the payments.giftCard() method.

Methods

giftCard.js
JS
JavaScript

const payments = Square.payments(appId, locationId);

const giftCard = await payments.giftCard();

await giftCard.attach('#gift-card');

const form = document.querySelector('#gift-card-payment');

form.addEventListener('submit', async (event) => {

   event.preventDefault();

   const result = await giftCard.tokenize(); // the gift card nonce

});