Skip to content

Instantly share code, notes, and snippets.

View nukturnal's full-sized avatar

Alfred Rowe nukturnal

View GitHub Profile
@nukturnal
nukturnal / opr_charge.java
Created November 15, 2012 22:53
MPower Java OPR charge
// Onsite Payment Request Charge requires bother the OPR_Token & Customers Confirmation Token
if (invoice.charge("OPR_TOKEN", "CUSTOMER_CONFIRM_TOKEN")) {
System.out.println("Status" + invoice.getStatus());
System.out.println("Response Message" + invoice.getResponseText());
System.out.println("Receipt URL" + invoice.getReceiptUrl());
System.out.println("Customer Name" + invoice.getCustomerInfo("name"));
System.out.println("Customer Email" + invoice.getCustomerInfo("email"));
} else {
System.out.println("Status" + invoice.getStatus());
System.out.println("Response Message" + invoice.getResponseText());
@nukturnal
nukturnal / opr_charge.cs
Created November 15, 2012 22:19
MPower.NET OPR charge
// Onsite Payment Request Charge requires bother the OPR_Token & Customers Confirmation Token
if (invoice.Charge ("OPR_TOKEN", "CUSTOMER_CONFIRM_TOKEN")) {
Console.WriteLine(invoice.Status);
Console.WriteLine(invoice.ResponseText);
Console.WriteLine(invoice.GetReceiptUrl());
Console.WriteLine(invoice.GetCustomerInfo("name"));
Console.WriteLine(invoice.GetCustomerInfo("email"));
} else {
Console.WriteLine(invoice.Status);
Console.WriteLine(invoice.ResponseText);
@nukturnal
nukturnal / opr_request.cs
Last active October 12, 2015 20:18
MPower .NET OPR Request
// Onsite Payment Request requires the mpower customer account alias as the parameter
if (invoice.Create("MPOWER_CUSTOMER_USERNAME_OR_PHONENO")) {
Console.WriteLine (invoice.Token);
Console.WriteLine (invoice.Status);
Console.WriteLine (invoice.ResponseText);
} else {
Console.WriteLine (invoice.ResponseText);
Console.WriteLine (invoice.Status);
}
@nukturnal
nukturnal / init_onsite_invoice.cs
Created November 15, 2012 22:04
MPower .NET initialise an onsite invoice
// If you wish to accept payments directly on your service
// Please note that the constructor requires a instance of both
// MPowerSetup & MPowerStore Classes respectively
MPowerOnsiteInvoice invoice = new MPowerOnsiteInvoice (setup, store);
@nukturnal
nukturnal / init_checkout_invoice.cs
Created November 15, 2012 21:59
MPower .NET initialise a checkout invoice
// If you intend to use a simpler approach by redirecting to the MPower checkout page
// Please note that the constructor requires a instance of both
// MPowerSetup & MPowerStore Classes respectively
MPowerCheckoutInvoice invoice = new MPowerCheckoutInvoice (setup, store);
@nukturnal
nukturnal / init_checkout_invoice.php
Last active October 12, 2015 20:18
MPower PHP initialise a checkout invoice
<?php
// If you intend to use a simpler approach by redirecting to the MPower checkout page
$invoice = new MPower_Checkout_Invoice();
@nukturnal
nukturnal / init_onsite_invoice.php
Last active October 12, 2015 20:17
MPower PHP initialise an onsite invoice
<?php
// If you wish to accept payments directly on your service
$invoice = new MPower_Onsite_Invoice();
@nukturnal
nukturnal / opr_request.php
Created November 15, 2012 21:38
MPower PHP OPR Request
// Onsite Payment Request requires the mpower customer account alias as the parameter
if(invoice->create("MPOWER_CUSTOMER_USERNAME_OR_PHONENO")) {
echo $invoice->getStatus();
echo $invoice->response_text;
echo $invoice->token;
} else {
echo $invoice->getStatus();
echo $invoice->response_text;
}
@nukturnal
nukturnal / opr_charge.php
Last active October 12, 2015 20:17
MPower PHP OPR charge
<?php
// Onsite Payment Request Charge requires bother the OPR_Token & Customers Confirmation Token
if($invoice->charge("OPR_TOKEN","CUSTOMER_CONFIRM_TOKEN")) {
echo $invoice->getStatus();
echo $invoice->response_text;
echo $invoice->getReceiptUrl();
echo $invoice->getCustomerInfo("name");
echo $invoice->getCustomerInfo("email");
} else {
echo $invoice->getStatus();
@nukturnal
nukturnal / opr_charge.rb
Last active October 12, 2015 20:08
MPower Ruby OPR charge
# Onsite Payment Request Charge requires bother the OPR_Token & Customers Confirmation Token
if invoice.charge("OPR_TOKEN","CUSTOMER_CONFIRM_TOKEN")
puts invoice.status
puts invoice.response_text
puts invoice.receipt_url
puts invoice.get_customer_info("name")
puts invoice.get_customer_info("email")
else
puts invoice.status
puts invoice.response_text