Start accepting Haypenny in minutes!
Haypenny is a digital currency like no other because it's as close to physical cash as you can get in the digital realm. It requires no wallet (just like cash), and you possess the value contained in the currency purely by virtue of your possessing the block string exclusively.
At the heart of the Haypenny model is the unique "block-split-combine" paradigm, which starts with the very simple concept of a block: a secret string ("block string") which is connected to a balance.
API Concepts
For developers, the Haypenny model is easy to learn, and is exposed through three REST APIs with the following parameters:
Add a Haypenny Button to Your Page
Adding a Haypenny payment button (say for a donation) can be done with two lines of code, and no sign up of any kind--just buy a Haypenny block if you don't already have one (any balance will do, including just a penny).
<script src="https://haypenny.com/haypenny-1.1.3.js"></script>
<button class="haypenny_payment_button"
data-iblock="hkyCL1FBTYsH9j4XYJ7iKPJkuryQtRLEpeX8X6sOxj6D" data-amount="150"
data-payee="MyCompany, Inc." data-item="Donation To Something"
>Give Us</button>
Those two lines of HTML code are all you need to start taking donations on your web page.
You can also quickly implement a paywall or enable some other action with this simple script that is called after a successful Haypenny payment.
Haypenny.paymentCallback = function(amount, paymentName){
// amount is in pennies, i.e. 150 = $1.50
alert("Hey, I got a payment of " + amount + " pennies!");
// paymentName is optional, and will be included if you add
// a value to "data-name" on your button tag:
if(paymentName){
console.log("The name we gave this button is:" + paymentName);
}
};
In order to get an iBlock from your block, you call the Tx.Info call for your Haypenny block string. We'll make that call for you here if you like, just enter your Haypenny block string below.
Using the code above will produce a button that looks like this on your page:
Redirect Page
The Redirect Page is great for emails because it allows you to include a Haypenny block or pBlock string before sending the user's browser to its final destination, ensuring they have some Haypenny in their browser before they reach their destination. Here is the URL and format.
https://haypenny.com/redir.html?param=val¶m2=val2...
-
urlRequired. The URL to redirect the browser to when the operation is successful and complete.
-
blockThe block string to drop in this browser's memory. Specify this or pblock.
-
pblockThe pBlock string to convert to a block, and then drop in this browser's memory.
-
emailOptional. An email to send the pBlock receipt.
-
trackurlOptional. A URL to call in the background in order to trigger (for instance) a tracking URL.
Language-specific APIs
Haypenny maintains APIs for the most popular development environments. These modules also contain example code and quick-start information as well:
- JavaScript: hblock-1.0.2.js (see also: client-only JavaScript examples).
- Java: HBlock.java
- PHP: hblock.lib.php (see also: PHP Paywall Example)
- C: hblock.h
You can also view all of Haypenny's APIs in a web UI using the Haypenny API Tester.
Read the Whitepaper
The Haypenny Platform Whitepaper provides formal description the of Haypenny system in a single document. The Haypenny platform was built from the start to handle all of the world's daily transactions and has been benchmarked at over one million transactions per second while securely storing every transaction in a decentralized data store.
The Sandbox
Development can be performed on the Haypenny sandbox site, which can be safely used for testing (although doing your testing on the live site is fine too since there are no transaction fees and you can work with very small amounts).
Sign Up To Redeem Haypenny
For content providers using Haypenny to accept payments, redemption of Haypenny to USD is done using ACH. For Haypenny redemptions, you must create a developer account.