4.0.1 • Published 2 months ago

intasend-inlinejs-sdk v4.0.1

Weekly downloads
63
License
MIT
Repository
github
Last release
2 months ago

IntaSend Inline Payment SDK

WebSdk plugin for IntaSend Payments Button. IntaSend enables you to easily add payments to your website with a few lines of code.

Follow the instruction below to install and get started.

Visit our sandbox/developers test for your publishable API. More information is available on the IntaSend Documentation.

Install locally

yarn add intasend-inlinejs-sdk

CDN option

Setup inline mode

Define the container where you want the payment component to appear

<div id="checkoutElement" style="padding: 40;width: 400px; height: 100vh; background: #cacaca; overflow-y: auto;"></div>

Instantiate the checkout element. Include this before closing your body tag

<script type="text/javascript" src="https://unpkg.com/intasend-inlinejs-sdk@4.0.0/build/intasend-inline.js"></script>
<script>
    function openInlineCheckout() {
            const intasendObj = window.IntaSend({
                publicAPIKey: "ISPubKey_test_91ffc81a-8ac4-419e-8008-7091caa8d73f",
                redirectURL: "http://intasend.com",
                live: false,
                mode: "inline",
                inlineContainer: "checkoutElement"
            })
            .on("COMPLETE", () => alert("COMPLETE"))
            .on("FAILED", () => alert("FAILED"))
            .on("IN-PROGRESS", () => console.log("INPROGRESS ..."))

            intasendObj.run({
                amount: 10,
                currency: "USD",
                api_ref: "123",
                email: "felix-inline@intasend.com"
            })
    }
    openInlineCheckout()
</script>

Setup popup mode website

<button class="intaSendPayButton" data-api_ref="payment-link" data-phone-number="254xxxxxxxx"
    data-email="example@intasend.com" data-amount="100">
    Pay Now
</button>

Include this before closing your body tag

<script src="https://unpkg.com/intasend-inlinejs-sdk@4.0.0/build/intasend-inline.js"></script>
<script>
    let isObj = new window.IntaSend({
        publicAPIKey: "<YOUR-API-KEY>",
        redirectURL: "<YOUR-REDIRECT-URL>",
        live: true //or false for sandbox environment
    })
    .on("COMPLETE", (response) => { console.log("COMPLETE:", response) })
    .on("FAILED", (response) => { console.log("FAILED", response) })
    .on("IN-PROGRESS", () => { console.log("INPROGRESS ...") })
</script>
4.0.1

2 months ago

4.0.0

7 months ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

3.0.0-beta-2

3 years ago

3.0.0-betax

3 years ago

3.0.0-beta

3 years ago

3.0.0-alpha

3 years ago

3.0.0-alpha2

3 years ago

2.0.8

3 years ago

2.0.8-d

3 years ago

2.0.8-c

3 years ago

2.0.8-b

3 years ago

2.0.8-a

3 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

1.0.2

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.10.6

4 years ago

1.0.0

4 years ago