Introduction


Welcome to Pie.NG. Get started by creating a Pie.NG account if you don't have one already. After creating your account, you can get get your API keys from the settings section of your dashboard when you login. Test keys have a prefix of pk_ and sk_ while live keys have the prefix pklv_ and sklv_. Switching between live and test modes data is as simple as clicking the or on the top bar of your dashboard.

CMS

Coming Soon

Web Frameworks

Coming Soon

Mobile

React Native
More Coming

Payment Parameters


The following parameters are expected by Pie.NG when attempting to receive payment from an application. Parames marked with * are required and must be passed

Public Key*

Pie.NG expects a publicKey to be passed to it when attempting to receive payment. You can obtain your publicKey from the settings tab on your dashboard

Customer*

cutomer should be a unique identifier for your customer formated like an email. Popular formats are <username>@your.domain.tld or <customerId>@your.domain.tld or any form of unique identification for the customer

Amount*

amount refers to how much you wish to charge your customers in NGN.

Wallet

wallet is the wallet id or wallet name of the wallet you want credited with amount. When not specified, your default wallet will be used instead

Narration

A description of the service the user is paying for is often okay for narration. A narrations are a good for audits for you and your customers

Transaction Reference

You can pass your transaction reference with the reference parameter. References are very useful if you intend to keep your own accounting system. Your passed reference does not replace Pie.NG's transaction reference

Commission

If you wish to collect a seperate commission or split your total payment into two, use commission to pass a second amount that will be combined with amount and charged at once. Some people use commission to specify service charge.

Commission Wallet

If you wish to collect a seperate commission or split your total payment into two, use commission to pass a second amount that will be combined with amount and charged at once. Some people use commission to specify service charge.

Inline


Integrating Pie.NG into new and existing tasks is as simple as booting a computer. Once your API keys are ready, integration can simply be done by including the Pie.NG Payment.js into your website and you are half done. A sample integration can be seen below

<script type="text/javascript" src="https://pie.ng/js"></script>
<form method="post" action="/your-server-side-code" id="targetForm">
  <input type="hidden" id="amount" value="500" />
  <input type="hidden" id="publicKey" value="pklv_GDX0J8puxiQk7kxH" />
  <input type="hidden" id="customer" value="demo@pie.ng" />
  <input type="hidden" id="publicKey" value="pklv_GDX0J8puxiQk7kxH" />
  <input type="hidden" id="narration" value="Payment Example" />
  <input type="hidden" id="reference" value="001" />
  <button className="pie-payment-btn" type="submit">PAY</button>
</form>
.pie-payment-btn {
  background: #0facf3;
  border-color: #0facf3;
  color: #fff;
  ont-weight: 600;
  font-size: 11px;
  padding: 7px 26px;
  line-height: inherit;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  border-radius: 2px;
  outline: none;
  -webkit-transition: 0.15s linear;
  transition: 0.15s linear;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  -webkit-user-select: none;
  user-select: none;
  border: 1px solid transparent;
  white-space: nowrap;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  text-decoration: none;
}
var $form = document.querySelector("#targetForm");
var callPieNG = function(e) {
  e.preventDefault()
  Pie.setup({
		amount: document.querySelector('#amount').value,//in kobo
		customer: document.querySelector('#customer').value,
		publicKey: document.querySelector('#publicKey').value,
		commission: document.querySelector('#commission').value,
		narration: document.querySelector('#narration').value,
		reference: document.querySelector('#reference').value,
		inclusive: false,
		commissionWallet: document.querySelector('#commissionWallet').value,
		loader: function() {
			console.log("display progress for your user here");
    },
    unloader: function(){
      console.log("hide progress for your user");
    },
    callback: function(response) {
      // Function to be called when payment is completed or fails
    },
    form: $form,
  }).openIframe();
}

if($form.addEventListener) {
  $form.addEventListener('submit', callPieNG, false) // Modern browsers
} else if($form.attachEvent) {
  $form.attachEvent('onsubmit', callPieNG) // Old IE
}