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
<?php | |
# Generate a sample the payload structure | |
$payload = array( | |
'store_id' => '10', | |
'cart_id' => '#234-14-222-KY', # May be an invoice number | |
'cart_items' => array( | |
array( | |
'id' => 'SKU-123-145', | |
'name' => 'Sony Playstation 2', | |
'qty' => 1, |
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
function ip_recieve(){ | |
header('Content-Type: application/json'); | |
# Save transaction | |
$data = $this->input->post(); | |
# Clean up a bit | |
$data['till_no'] = $data['business_number']; | |
$data['provider'] = 'KOPOKOPO'; |
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
# Redirect non-SSL traffic to SSL site | |
<VirtualHost *:80> | |
ServerName example.com | |
ServerAlias www.example.com | |
Redirect permanent / https://example.com/ | |
</VirtualHost> | |
# SSL Site | |
<VirtualHost *:443> | |
ServerAdmin [email protected] |
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
<?php | |
# Final storage for the products our script | |
# will send to BlackPay for billing | |
$cartItems = array(); # or [], who cares? | |
# Get an array of all items the customer has | |
# placed in the shopping basket | |
$basket = $this->getShoppingBasketContents('basket_uuid'); | |
# If the previous array has extra information, you can |
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
server { | |
listen 80 default_server; | |
root /var/www/laravel/public; | |
index index.php index.html index.htm; | |
server_name _; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location ~ \.php$ { | |
try_files $uri /index.php = 404; |
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
<?php | |
# Collect relevant data from your backend systems | |
$transaction = [ | |
'telephone' => '0700123456', | |
'action' => 'BUY', | |
'product_name' => 'Nike Shoes', | |
'price' => 5000, | |
'description' => 'Hello World!', | |
]; |
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
// Preview image | |
function readURL(input) { | |
if (input.files && input.files[0]) { | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
$('.propertyImagePreview').attr('src', e.target.result); | |
} | |
reader.readAsDataURL(input.files[0]); | |
} | |
} |
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
<?php | |
############################################################# | |
# 47 counties of Kenya # | |
############################################################# | |
$config['counties'] = [ | |
'BARINGO' => 'Baringo County', | |
'BOMET' => 'Bomet County', | |
'BUNGOMA' => 'Bungoma County', | |
'BUSIA' => 'Busia County', | |
'ELGEYO-MARAKWET' => 'Elgeyo-Marakwet County', |