Developer Portal

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:

Split
Given a block and a unit amount, decrements the balance on that block and returns a new block with a balance of that amount. If amount is not provided, the full balance of the block is split and the original block is discarded (useful for safely accepting a block from another party).
Combine
Moves an amount from the provided combine_block to the provided block. If amount is not provided, combines the entire balance of combine_block and discards it.
Info
Given a block, returns block information including its balance and a valid iBlock.

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).

html

<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.

javascript

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.

Your IBlock string: [Enter a Haypenny block string above to get an iBlock]

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&param2=val2...
		
Parameters:

Language-specific APIs

Haypenny maintains APIs for the most popular development environments. These modules also contain example code and quick-start information as well:

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.