Blink

Blink

    blinkSDK.requestPayment()

    Request payment for an article.

    Usage

        let paymentRequest = {
            amount: 600000, // 60c in USD currency units
            currencyIsoCode: "usd",
            offerId: "984534",
            merchantPublicKey: "f9b05c8cb3cdba230ef3580e721c7fcceec5b58e6fc9a5b9265d8fc46fc7b601",
            paymentInfoSignature: "F7E1107AD25A3B19655F6B30598D5966C97C03C0CABDF3FD001B42BB26CBD9F718AFC252D63BB6437EE38A780D9D33602B527B6805171B640C67FC055031DC0C"
        };
       
        blinkSDK.requestPayment(
            paymentRequest,
            (response) => {
                // Successfully paid for the article, hide the paywall
            },  
            (error) => {
                // Payment was not succefull, Blink paywall got updated
                // Here you can do additional error handling  
            });
    

    Signature

        blinkSDK.requestPayment(payment, callback, [errorCallback])
    

    Parameters

    parametertyperequireddescription
    paymentobject☑Payment request object
    callbackfunction☐Called in case of success, will receive a response object
    errorCallbackfunction☐Called in case of error, will receive an error object containing the error details

    Returns

    void

    Objects definitions

    Payment request

    {
      "amount" : // amount specified in currency units
      "currencyIsoCode" : // currency iso code
      "offerId" : // can be used to specify a context for this purchase
      "comment" : // can be used to add any extra info on the purchase 
      "merchantPublicKey" : // Ed25519 public key used
      "paymentInfoSignature" : // Ed25519 signature
    }   
    
    nametyperequireddescription
    amountNumber☑amount specified in currency units (1 USD = 1 000 000)
    currencyCodeString☑currency ISO 4217 code (i.e. USD/GBP/EUR)
    offerIdString☐can be used to specify a context for this purchase
    commentObject☐can be used to add any extra info on the purchase
    merchantPublicKeyhex String☐Ed25519 public key used for signing the payment info
    paymentInfoSignaturehex String☐Ed25519 signature proofing the payment info (amount, currencyIsoCode, offerId, comment)
    • Usage
    • Signature
    • Parameters
    • Returns
    • Objects definitions
      • Payment request
    Blink
    Docs
    Getting StartedPublic API
    Integration
    Donation
    Blink
    Copyright © 2021 Blink Ledger Systems Inc. All rights reserved