This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Globally setting return URL, the piece of code below | |
// should be included with the checkout shop setup code | |
MPowerStore store = new MPowerStore { | |
ReturnUrl = "http://www.myawesomeshop.com/confirm.aspx" | |
}; | |
// Setting the return URL on an invoice instance. | |
// This will overwrite any global settings for return URL | |
invoice.SetReturnUrl("http://www.myawesomeshop.com/confirm.aspx"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Globally setting cancel URL, the piece of code below | |
// should be included with the checkout shop setup code | |
MPowerStore store = new MPowerStore { | |
CancelUrl = "http://www.myawesomeshop.com/" | |
}; | |
// Setting the cancel URL on an invoice instance. | |
// This will overwrite any global settings for cancel URL | |
invoice.SetCancelUrl("http://www.myawesomeshop.com/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Invoice token is returned as a URL query string "token" | |
// You are free to also explicitly check the status of an invoice | |
string InvoiceToken = "sjklsdll21-ms0w"; | |
MPowerCheckoutInvoice invoice = new MPowerCheckoutInvoice (setup, store); | |
if (invoice.Confirm(InvoiceToken)) { | |
// Retrieving Invoice Status | |
// Status can be either completed, pending, canceled, fail | |
Console.WriteLine (invoice.Status); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install mpower |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "mpower" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MPower::Checkout::Store.name = "My Awesome Online Store" | |
MPower::Checkout::Store.tagline = "My awesome store's awesome tagline" | |
MPower::Checkout::Store.postal_address = "Post office Box AN 10604" | |
MPower::Checkout::Store.phone_number = "0302507099" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MPower::Setup.master_key = "sdd6f2c90-f075-01d2f-5b69-00155d866600" | |
MPower::Setup.public_key = "test_public_zzF34wvX9DE-OSDNhUqKoaTI4wc" | |
MPower::Setup.private_key = "test_private_oDLVfm1e3yh0IsetdhdJvcl0ygA" | |
MPower::Setup.mode = "test" | |
MPower::Setup.token = "ca03737cf942cfg44f36" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adding items to your invoice is very basic, the parameters expected | |
# are name_of_item, quantity, unit_price, total_price and optional item description. | |
invoice.add_item("13' Apple Retina 500 HDD",1,10.99,10.99); | |
invoice.add_item("Case Logic laptop Bag",2,100.50,201,"Optional description"); | |
invoice.add_item("Philips electric shaver",2,50.50,101.00); | |
# You can optionally set a generation invoice description text which can | |
# be used in cases where your invoice does not need an items list or in cases | |
#where you need to include some extra descriptive information to your invoice | |
invoice.description = "Optional Invoice description here"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The parameters for setting add tax are title_of_the_tax, tax_amount | |
invoice.add_tax("VAT (15%)",30); | |
invoice.add_tax("NHIL (5%)",10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
invoice.total_amount = 100.50 |