Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

ultra-simple-dash-merchant (PHP)

Discussion in 'Projects' started by jimbursch, Apr 12, 2017.

  1. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    • Like Like x 3
  2. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    • Like Like x 1
  3. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    Because I hate javascript I will be stripping out all the javascript, and because I don't think anyone else will be using this (this is really just an exercise for me) I will be taking out the language localization.

    I will replace the Mt. Gox API with a combination of the official Dash Explorer API (https://explorer.dash.org) and the CoinMarketCap API for price ticker (https://coinmarketcap.com/api/).
     
    • Like Like x 1
  4. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
  5. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    Now I've decided to shitcan ultra-simple-bitcoin-merchant altogether and do a very-simple-dash-invoicing system instead. Should take me about a week to have a working prototype.
     
    • Winner Winner x 1
  6. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    Here's a description of how it will work:

    To create a very simple Dash invoice:

    - mannually enter a Dash address that has never received funds
    - optionally enter:
    -- issuer(merchant) name
    -- customer name/id
    -- invoice id (from issuer's accounting system)
    -- product name/id
    -- amount

    When submitted, a url is generated that passes all variables to invoice page (get), including a hash of the invoice to check authenticity.

    When a customer views the invoice, the invoice hash is checked for authenticity and the Dash address is queried for received funds. The Dash address is displayed with a QR code and instructions for payment, along with the optional invoice data.

    If the Dash address has received funds equal to or greater than the amount of the invoice, the invoice is marked paid.

    To check the status of payment, simply reload the invoice page.
     
  7. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    • Like Like x 1
  8. GrandMasterDash

    GrandMasterDash Well-known Member
    Masternode Owner/Operator

    Joined:
    Jul 12, 2015
    Messages:
    2,667
    Likes Received:
    952
    Trophy Points:
    183
    "Amount" should probably say ""Amount (DASH)".

    Also, if it were me, I would also prefix the QR string with "dash:" because, in theory, that should trigger a wallet action, in the same way "bitcoin:1xxxxx" triggers a bitcoin wallet.
     
  9. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    Done!

    Would love to get more feedback -- feel free to take a whack at it and get back to me:

    Simple Dash Invoice
    http://jimbursch.com/simple-dash-invoice/index.php
     
  10. kodaxx

    kodaxx Member

    Joined:
    Nov 26, 2016
    Messages:
    74
    Likes Received:
    83
    Trophy Points:
    58
    Does this support InstantSend?
     
  11. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    No -- this is a simple invoicing app. There is no interaction with a wallet. It enables you to create an invoice tied to a Dash address and monitors that address for payment received.
     
  12. GrandMasterDash

    GrandMasterDash Well-known Member
    Masternode Owner/Operator

    Joined:
    Jul 12, 2015
    Messages:
    2,667
    Likes Received:
    952
    Trophy Points:
    183
    If someone used Instant Send, your app would still have to wait for a confirmation, right?
     
  13. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    498
    Trophy Points:
    133
    That's a good question and I'm not sure about the answer. The app queries 'getreceivedbyaddress', which I would assume requires at least 1 confirmation, but I could be wrong.
     
  14. GrandMasterDash

    GrandMasterDash Well-known Member
    Masternode Owner/Operator

    Joined:
    Jul 12, 2015
    Messages:
    2,667
    Likes Received:
    952
    Trophy Points:
    183
    Yeah, I suspect you have to wait for a confirmation. I just took a quick glance at the code and can see you're using CryptoID.info. Might of been different if it was talking directly to a node.
     
  15. joemoraca

    joemoraca Member

    Joined:
    Mar 3, 2017
    Messages:
    161
    Likes Received:
    60
    Trophy Points:
    88
    good learning project - it worked fine for me.