Skip to content

Instantly share code, notes, and snippets.

View erdimeola's full-sized avatar

Erdi Yerebasmaz erdimeola

View GitHub Profile
@erdimeola
erdimeola / bulutfon_sms.py
Last active September 28, 2016 07:28
Bulutfon SMS Gönderme
import requests, json
class BulutfonClient(object):
def __init__(self, key, sms_title):
self.key = key
self.sms_title = sms_title
self.SMS_ENDPOINT = "https://api.bulutfon.com/messages"
def send_transactional_sms(self, to_number, text):
data = {
@erdimeola
erdimeola / est3d.py
Last active September 1, 2023 18:25
Python - EST 3D Secure Integration
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.shortcuts import redirect
from django.http import HttpResponse
import requests, hashlib, base64, time
EST_MERCHANT_ID = "400000200"
EST_3D_KEY = "TRPS0200"
EST_RETURN_URL = "http://test.domain.com/basarili"
EST_FAIL_URL = "http://test.domain.com/basarisiz"
@erdimeola
erdimeola / gist:8280457
Created January 6, 2014 09:46
Django Unit Test Request Object Instance
from django.utils import unittest
from django.test.client import RequestFactory
class SimpleTest(unittest.TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.factory = RequestFactory()
def test_details(self):
# Create an instance of a GET request.
@erdimeola
erdimeola / unit_test_http_header.py
Created January 6, 2014 09:45
Django unit test set http headers
class MyTest(TestCase):
def setUp(self):
self.request_headers = { 'HTTP_HOST': 'subdomain.domain.com' }
def test_header(self):
client = Client()
client.get('path', **self.request_headers)