Code Monkey home page Code Monkey logo

bill-payments-popup-js-sdk's Introduction

Qiwi Checkout Popup

Установка и подключение

<script src='https://oplata.qiwi.com/popup/v1.js'></script>

Методы

В библиотеке доступны 2 функции: QiwiCheckout.openInvoice и QiwiCheckout.openPreorder.

В случае успешной оплаты Promise resolve-ится с параметрами с которыми был создан счет, иначе reject-ится с причиной из-за которой оплата была прервана.

В случае ошибки при оплате: {reason: "PAYMENT_FAILED"}

В случае закрытия попапа: {reason: "POPUP_CLOSED"}

Через 2 секунды после совершения оплаты или ошибки форма оплаты закрывается.

QiwiCheckout.openInvoice({
    payUrl: 'https://oplata.qiwi.com/form?invoiceUid=06df838c-0f86-4be3-aced-a950c244b5b1'
})
    .then(data => {
        //  data === {
        //    payUrl: 'https://oplata.qiwi.com/form?invoiceUid=06df838c-0f86-4be3-aced-a950c244b5b1'
        //  }
    })
    .catch(error => {
        //  error === {
        //      reason: "PAYMENT_FAILED"
        //  }
    })

Для отслеживания оплаты счета рекомендуется использовать server2server уведомления (Документация)

Открытие инвойса

Открытие счета используется вместе с выставлением счета по API (Документация)

Метод QiwiCheckout.openInvoice открывает платежную форму. В параметрах нужно указать:

Параметр Описание Тип Обязательное
payUrl URL инвойса String +
params = {
    payUrl: 'https://oplata.qiwi.com/form?invoiceUid=06df838c-0f86-4be3-aced-a950c244b5b1'
}

QiwiCheckout.openInvoice(params)
    .then(data => {
        // ...
    })
    .catch(error => {
        // ...
    })

Открытие my.qiwi.com

Метод QiwiCheckout.openPreorder открывает my.qiwi.com. В параметрах нужно указать:

Параметр Описание Тип Обязательное
widgetAlias Алиас виджета String +

bill-payments-popup-js-sdk's People

Contributors

artiemq avatar khromushkin avatar mmmikhail avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.