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
import 'package:beyonic_flutter_library/beyonicservice.dart'; | |
import 'package:beyonic_flutter_library/models/payments.dart'; | |
beyonic_service = BeyonicService(apiKey: your_api_key); | |
// load list of payments | |
Future <List<Payment>> _payments = beyonic_service.load(Payment.all, offset: 0); | |
// load single payment | |
Future <Payment> _payment = beyonic_service.load(Payment.single); |
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
class MainActivity : AppCompatActivity() { | |
private lateinit var mResultTextView: TextView | |
private lateinit var mPhonenumberTextView: TextView | |
private var b: Boolean? = false | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) |
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
{% load qr_code %} | |
<h1>SpaceShips</h1> | |
<ul> | |
{% for spaceship in object_list %} | |
<li> | |
{{ spaceship.model }} | |
{% qr_from_text spaceship.pk size=8 version=12 %} | |
</li> | |
{% empty %} | |
<li>No spaceships yet.</li> |
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
class SpaceShipListView(ListView): | |
model = SpaceShip | |
class SpaceShipPayment(View): | |
def get(self, request, *args, **kwargs): | |
""" | |
Get the item_id and phone_number from request to create a new payment | |
:param request: | |
:param args: |
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
@receiver(post_save, sender=Payment) | |
def call_payment_api(sender, instance, created, **kwargs): | |
if created: | |
# Initiate a Beyonic Collection Request to request money from the user | |
import beyonic | |
beyonic.api_key = settings.BEYONIC_API_KEY | |
response = beyonic.CollectionRequest.create( | |
phonenumber=instance.phone_number, | |
amount=instance.item.price, | |
currency=instance.item.currency, |
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
class SpaceShip(models.Model): | |
# Sample merchant product | |
model = models.CharField(max_length=255, blank=False, null=False) | |
price = models.DecimalField(max_digits=99, decimal_places=2) | |
currency = models.CharField(max_length=55, default='KES', blank=False, null=False) | |
def __str__(self): | |
return self.model | |
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
import base64 | |
import datetime | |
import json | |
from django.conf import settings | |
import requests | |
import uuid | |
def make_request(url, data, request_date, msisdn, pin): |
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 | |
/** | |
* Scrapper for geocoding list with multiple location columns | |
* If a finer location fails, it settles for the next best thing | |
* | |
* @author http://twitter.com/nickhargreaves | |
*/ | |
//Db connection | |
$link = mysql_connect("", "", ""); |
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
{"checklists":[{"id":"1","name":"Category 1","items":[{"id":"1","text":"question1"},{"id":"2","text":"question2"},{"id":"3","text":"question3"}]},{"id":"2","name":"Category 2","items":[{"id":"4","text":"question4"},{"id":"5","text":"question5"}]}]} |
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 | |
$link = mysql_connect('localhost', '', ''); | |
mysql_select_db(''); | |
$create_table = "CREATE TABLE IF NOT EXISTS `json` ( | |
`id` int(11) NOT NULL, | |
`reporting-org_type` text NOT NULL, | |
`reporting-org_ref` text NOT NULL, | |
`reporting-org_text` text NOT NULL, | |
`iati-identifier` text NOT NULL, |
NewerOlder