Skip to content

Instantly share code, notes, and snippets.

Avatar

Alfred Rowe nukturnal

View GitHub Profile
@nukturnal
nukturnal / opr_charge.java
Created Nov 15, 2012
MPower Java OPR charge
View opr_charge.java
// 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 Nov 15, 2012
MPower.NET OPR charge
View opr_charge.cs
// 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 Oct 12, 2015
MPower .NET OPR Request
View opr_request.cs
// 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 Nov 15, 2012
MPower .NET initialise an onsite invoice
View init_onsite_invoice.cs
// 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 Nov 15, 2012
MPower .NET initialise a checkout invoice
View init_checkout_invoice.cs
// 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 Oct 12, 2015
MPower PHP initialise a checkout invoice
View init_checkout_invoice.php
<?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 Oct 12, 2015
MPower PHP initialise an onsite invoice
View init_onsite_invoice.php
<?php
// If you wish to accept payments directly on your service
$invoice = new MPower_Onsite_Invoice();
@nukturnal
nukturnal / opr_request.php
Created Nov 15, 2012
MPower PHP OPR Request
View opr_request.php
// 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 Oct 12, 2015
MPower PHP OPR charge
View opr_charge.php
<?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 Oct 12, 2015
MPower Ruby OPR charge
View opr_charge.rb
# 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