• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Testnet Release: Dash Payment Processor / WooCommerce

S

snogcel

Guest
On behalf of the Evolution Backend team I'm pleased to announce the 'testnet' release of Dash Payment Processor. This system is meant to be operated by a merchant to allow for the usage of Dash as a payment option without third parties being involved.

The quickest way to get a feel for how this system works is to visit http://payment-processor-testing.slayer.work and place an "order". You'll notice that after the submit button is pressed a response will be provided back containing payment information. If the requested payment is sent you'll see a "Payment Callback" occur. It's also worth mentioning that this system fully supports InstantSend.

Included in this release is a WooCommerce Plugin. This plugin was created to act as a "Proof of Concept" for the system as a whole. It enables WooCommerce to use the Dash Payment Processor as it would any other payment method. Plugins and extensions for other e-commerce platforms can be developed in the same way; these libraries facilitate the checkout process and also allow for block confirmations to occur before the sale is finalized. A demonstration of this plugin is available at http://store.slayer.work.

Dash Payment Processor uses a BIP32 HD Wallet Seed or Electrum Wallet Seed as the basis for Payment Address generation. More information on this and other mechanics of the API is available in the Official Project Wiki.


Resources:


Testnet Wallets:


Official Project Wiki:

 
Last edited:
Technical Details:

Interested in setting up your own Payment Processor? There's a bit of setup involved, if you have any questions please contact me through PM and I'll try to give you a hand as quickly as I can.

Prerequisites (Ubuntu 14.04 or 16.04 recommended):

1. Node Version Manager: https://github.com/creationix/nvm#install-script

2. LAMP Stack: https://www.digitalocean.com/commun...x-apache-mysql-php-lamp-stack-on-ubuntu-14-04

3. Wordpress: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04

4. WooCommerce: https://wordpress.org/plugins/woocommerce/installation


Part 1: Install Dash Payment Processor

nvm install v4.0.0

(close terminal window and reopen for nvm to take effect - important!)

npm install -g bitcore-node-dash

bitcore-node-dash create mynode -d ~/.bitcore/data --testnet

cd mynode

bitcore-node-dash install insight-api-dash

bitcore-node-dash install dash-payment-processor

cd node_modules/dash-payment-processor/config

nano AppConfig.js // configure wallet seed and worldcoin api key

cp DBConfig-template.js DBConfig.js

nano DBConfig.js // add mysql database user/pass

cd ../resources

mysql -u<mysql username> -p < mysql-schema.sql

cd ../../../

bitcore-node-dash start

At this point, you should have a full Bitcore node up and running. This node will sync the entire Dash Blockchain and provide a local Insight API that the Payment Processor can use to detect and verify transactions. At this point we can proceed with installing the WooCommerce plugin.


Part 2: Install the WooCommerce Plugin

1. Download Dash-Woocommerce-Plugin.zip from https://github.com/snogcel/dash-woocommerce-plugin/blob/master/dist/dash-woocommerce-plugin.zip.

2. From the WordPress Admin interface, click plugins then click "Add New".

3. At the top of the screen find the "Upload Plugin" button and choose the zip file download previously.

4. Click the "Activate Plugin" button, once the plugin has been activated you'll find it included in the listing of Installed Plugins.

5. From "Installed Plugins", locate "Dashpay - WooCommerce Gateway" and click on Settings.

6. Select "DASH Checkout" from the list of available payment methods.

7. Check the "Enable this payment gateway" checkbox.

8. Configure the "Payment Service API" and "Insight API" option to point to your server.
 
Last edited:
1hma9a.jpg
 
How is this any different than nmarley's plugin?
https://www.dash.org/forum/threads/dashpayments-for-woocommerce-released.8613/

Does it require InstantX to do instant purchases?

Great question, key differences in terms of features:

1. API driven (and thus no special hosting requirements / easy to install);
2. Supports multiple transaction confirmation approaches (0-conf, 1-conf or InstantSend)
3. More completely integrated with the checkout process itself.

The biggest difference? This: https://github.com/snogcel/dash-woocommerce-plugin/blob/master/js/checkout.js. This code can be reused for many different platforms and purposes, whereas components of the old plugin could not (due to point #1 above).
 
Great question, key differences in terms of features:

1. API driven (and thus no special hosting requirements / easy to install);
2. Supports multiple transaction confirmation approaches (0-conf, 1-conf or InstantSend)
3. More completely integrated with the checkout process itself.

The biggest difference? This: https://github.com/snogcel/dash-woocommerce-plugin/blob/master/js/checkout.js. This code can be reused for many different platforms and purposes, whereas components of the old plugin could not (due to point #1 above).

Nice work!

@kodaxx Check this out for your project.
 
>Dash Payment Processor uses a BIP32 HD Wallet Seed or Electrum Wallet Seed as the basis for Payment Address generation

@snogcel, are *working* testnet versions of either of these available so you can test a payment end to end? i.e.

1) have two electrum wallets (both pointed at testnet)
2) configure the payment processor to use a seed from one of the wallets
3) pay a sum from the one wallet to the other
4) payment processor detects payment and callback is invoked - the money is then viewable in the other electrum wallet

Thx

ps: i think the issue is.. i want to use electrum as a wallet but as its a lite client there are/was no running testnet server that could be used.
 
Last edited:
>Dash Payment Processor uses a BIP32 HD Wallet Seed or Electrum Wallet Seed as the basis for Payment Address generation

@snogcel, are *working* testnet versions of either of these available so you can test a payment end to end? i.e.

1) have two electrum wallets (both pointed at testnet)
2) configure the payment processor to use a seed from one of the wallets
3) pay a sum from the one wallet to the other
4) payment processor detects payment and callback is invoked - the money is then viewable in the other electrum wallet

Thx

ps: i think the issue is.. i want to use electrum as a wallet but as its a lite client there are/was no running testnet server that could be used.

Hello Wal,

Thanks for mentioning this! You can grab a Testnet version of Electrum Dash here: https://dashpay.atlassian.net/build...fact/JOB1/electrum-dash.exe/electrum-dash.exe. It appears to be deriving the correct addresses however I'm not having any luck testing this right now due to network load testing (I can't send any transactions, anywhere, at all lol). I'm pretty confident this should provide you with what you're looking for though. If you encounter any troubles with it I'll have an alternative BIP32 wallet for testnet available as a chrome app towards the end of the month :)
 
Hello Wal,

Thanks for mentioning this! You can grab a Testnet version of Electrum Dash here: https://dashpay.atlassian.net/build...fact/JOB1/electrum-dash.exe/electrum-dash.exe. It appears to be deriving the correct addresses however I'm not having any luck testing this right now due to network load testing (I can't send any transactions, anywhere, at all lol). I'm pretty confident this should provide you with what you're looking for though. If you encounter any troubles with it I'll have an alternative BIP32 wallet for testnet available as a chrome app towards the end of the month :)

that version of electrum looks like its not on testnet?everything is in dash (not tDash)
 

Attachments

  • MWSnap0005 2017-01-22, 08_49_12.png
    MWSnap0005 2017-01-22, 08_49_12.png
    28.3 KB · Views: 210
@snogcel is it possible to get the payment processor to pay a dash-qt wallet? i'm thinking not but is there then a way to import the transactions into dash-qt after they have been received by the payment processor? (given the payment processor has the private keys)
 
that version of electrum looks like its not on testnet?everything is in dash (not tDash)

Hey Wal,

Though the UI doesn't reference testnet I can confirm that it's generating addresses that align with the payment processor (see attached screenshot). You're right though that currently the Electrum Testnet server doesn't seem to be picking up transactions, @thelazier can you please confirm the URL of your testnet electrum server is electrum.dash.siampm.com ?

To answer your other question, this system uses BIP32 HD Public Keys to create a unique payment address for each order. Due to this fact (and due to the fact that Dash Core v0.12.1.x doesn't support BIP32 address generation) there's unfortunately not a good way to set this up to point to a Dash Core wallet address.
 

Attachments

  • 2017-01-23_0950.png
    2017-01-23_0950.png
    153.1 KB · Views: 217
> Due to this fact (and due to the fact that Dash Core v0.12.1.x doesn't support BIP32 address generation) there's unfortunately not a good way to set this up to point to a Dash Core wallet address.
@snogcel thanks for confirming this. What do you suggest is the best way to view (say as a business owner) the transactions credited to the payment processor? The options I see at the moment are
1) use electrum client however this isnt working on testnet so for testing builds is a problem
2) use dash-qt.exe client however need a way to get private keys from payment processor and import into dash-qt ? (if yes is there any docs on how to do this?)

With the payment processor (or dash in general) is it possible to credit someone ? e.g. programatically pay someone in the case of say a store credit that needs to be refunded.

Cheers again
 
> Due to this fact (and due to the fact that Dash Core v0.12.1.x doesn't support BIP32 address generation) there's unfortunately not a good way to set this up to point to a Dash Core wallet address.
@snogcel thanks for confirming this. What do you suggest is the best way to view (say as a business owner) the transactions credited to the payment processor? The options I see at the moment are
1) use electrum client however this isnt working on testnet so for testing builds is a problem
2) use dash-qt.exe client however need a way to get private keys from payment processor and import into dash-qt ? (if yes is there any docs on how to do this?)

With the payment processor (or dash in general) is it possible to credit someone ? e.g. programatically pay someone in the case of say a store credit that needs to be refunded.

Cheers again

Hey Wal,

Thanks for looking at this angle of the processor. In my eyes there's a couple ways to accomplish the type of oversight you're speaking of - it's definitely an important requirement.

1. Develop a reporting system. Larger clients would probably prefer this type of system as it could be set up to connect to a pre-existing platform (or maybe even just dumped into CSV?). The drawback for this is the development effort required and also that clear requirements for this type of functionality is yet to be defined. I started building this out, considered removing it, but left it commented as a development resource: https://github.com/snogcel/dash-payment-processor/blob/master/lib/index.js#L173.

2. Send funds directly to Merchant and let them deal with it. This is the simpler way to go for sure and probably the most practical in the short-term. While developing this I was using a BIP32 public key from Copay-Dash (see https://copay.io/) if only to sanity-check payment receipt. Electrum-Dash is certainly an option as well however as you'd noticed right now we're not seeing the transactions go through (I think this is temporary - due to load testing the past week or so). A few minutes ago I finished up an preliminary build of Copay-Dash as a chrome app. Once testnet has settled down a little bit I plan to make this publicly accessible and I think it will solve this problem you're facing.

As for your other question: in it's current incarnation, no, the Payment Processor does not have the ability to create/sign transactions on behalf of the store owner and as a result wouldn't be able to initiate a refund. These types of functions will be possible with Dash Evolution, but we're not quite there yet :)
 
>the Payment Processor does not have the ability to create/sign transactions on behalf of the store owner and as a result wouldn't be able to initiate a refund

ok so the payment processor does not support this; are there any other libraries that support programmatically paying a given address? (not evolution)
if no, would it be trivial or non-trivial to implement this?
it seems there are existing companies that already support automated transactions (eg fortunejack-com which allows you to deposit/withdraw in dash) so i wonder how they are doing it?

>While developing this I was using a BIP32 public key from Copay-Dash.... if only to sanity-check payment receipt.
yep thats pretty much what i'm doing... just to verify what the payment processor is getting... so would love a copy of that chrome plugin :)
 
Last edited:
Here are some suggestions
1) server should provide a nicer error message if you forget to set the `Content-Type: application/json` header in HTTP. it took me a while to figure out this was the error
2) error if you try to boot up without a world api key
3) i find it a bit confusing how the config says insight listens on port 3001 but then there is another port setting, seemingly the application, that is port 9001. only 3001 is listening so could you clarify?
 
>the Payment Processor does not have the ability to create/sign transactions on behalf of the store owner and as a result wouldn't be able to initiate a refund

ok so the payment processor does not support this; are there any other libraries that support programmatically paying a given address? (not evolution)
if no, would it be trivial or non-trivial to implement this?
it seems there are existing companies that already support automated transactions (eg fortunejack-com which allows you to deposit/withdraw in dash) so i wonder how they are doing it?

>While developing this I was using a BIP32 public key from Copay-Dash.... if only to sanity-check payment receipt.
yep thats pretty much what i'm doing... just to verify what the payment processor is getting... so would love a copy of that chrome plugin :)

I'd say it's somewhere between trivial and non-trivial, the mechanics are in place (see https://github.com/snogcel/dash-payment-processor/commits/feature/wallet) however this requires a fully released Copay-Dash wallet to really be worth pursuing. This type of configuration would create an "untrusted" signer of a multisig wallet (think along the lines of a Cashier at your local fast food joint -- they have access to funds but need manager approval to perform a refund). The idea here is that you could allow the server to create a "Refund" transaction, then have a 2-3 signing by the shop owner in order to approve the transaction (e.g. have them install a wallet on their desktop and on their mobile device then sign the transaction on both).

Here are some suggestions
1) server should provide a nicer error message if you forget to set the `Content-Type: application/json` header in HTTP. it took me a while to figure out this was the error
2) error if you try to boot up without a world api key
3) i find it a bit confusing how the config says insight listens on port 3001 but then there is another port setting, seemingly the application, that is port 9001. only 3001 is listening so could you clarify?

Added 1 + 2 to an issue on the repo (https://github.com/snogcel/dash-payment-processor/issues/6).

Also opened up an issue for #3 (https://github.com/snogcel/dash-payment-processor/issues/7), agreed that this could be a little confusing. This is from an earlier version of the app which was designed as a "standalone" type service which operated on port 9001. We can safely remove that, thanks for letting me know!
 
Hello, where can I find seed key (if not mistaken also called as master public key) for development like "tpub........"? For production, I am able to get "xpub......" by using Electrum Dash.

Is it possible to get seed key from Dash Core? Because Dash Core can only generate hd seed and its look like "ad0c5d97f2ba3f7f46cf54a6fcc9817.......".

Or is there any way to run Electrum Dash using testnet?
 
Back
Top