Page History
...
Подробная информация о добавлении кнопки приведена в документации Google Pay API https://developers.google.com/pay/api/web/reference/object?hl=ru#ButtonOptions.
Пример функции addGooglePayButton, которая добавляет большую кнопку черного цвета:
Code Block | ||
---|---|---|
| ||
function addGooglePayButton() {
const paymentsClient = getGooglePaymentsClient();
const button =
paymentsClient.createButton({onClick: onGooglePaymentButtonClicked, buttonColor:'black', buttonType:'long'}); //создание кнопки
document.getElementById('container').appendChild(button); //добавление кнопки на страницу
document.getElementById('container').style.display = 'block';
} |