Giter VIP home page Giter VIP logo

box-invoicer-js's Introduction

box-invoicer-js

This project is meant as a drop in add-on for calling "the box" invoicing APIs

Usage

<!-- Preload these libraries -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>


<!-- Anywhere in body -->

<!-- Sample code creates invoice for 1337 sats -->
<div id="lninvoicerapp">
    <div id="paymentwidget">
        <button id="createInvoice" onClick="lninvoicerapp.amount = 1337; lninvoicerapp.createInvoice();">Pay with ⚡️ lightning or bitcoin</button>
        <div id="statusdisplay"></div>
        <div v-if="text !== '' && settled === false && paymentexpired === false" class="output">
            Please pay the following invoice [<a href="#" onclick="lninvoicerapp.bitcoinqr();">Bitcoin Only</a> | <a href="#" onclick="lninvoicerapp.bolt11qr();">Lightning Only</a>]: <br />
            <img :src="newQRCode" alt="QRCode">
        </div> 
        <div v-else-if="text !== '' && settled === false && paymentexpired === true">
            Invoice has expired.
        </div>              
        <div v-else-if="text !== '' && settled === true">
            Thank you for your lightning ⚡️ or on-chain payment! ✅
        </div> 
    </div>
</div>


<!-- Can put this before or after -->
<!-- Edit the below to your path (or you can run off master)  -->
<script src="https://gitlab.com/nolim1t/box-invoicer-js/raw/master/qrious.min.js"></script>
<script src="https://gitlab.com/nolim1t/box-invoicer-js/raw/master/box-invoicer.js"></script>

box-invoicer-js's People

Contributors

nolim1t avatar

Watchers

 avatar  avatar  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.