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
<?xml version="1.0" encoding="UTF-8"?> | |
<responseMobilePaymentProcessEntrypoints xmlns="http://pay01.zong.com/zongpay" xsi:schemaLocation="http://pay01.zong.com/zongpay/zongpay.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<countryCode>US</countryCode> | |
<localCurrency>USD</localCurrency> | |
<exchangeRate>1.0000</exchangeRate> | |
<providers> | |
<provider id="31008" name="Boost"/> | |
<provider id="31011" name="Boost Unlimited"/> | |
<provider id="310120" name="Sprint"/> | |
<provider id="31012001" name="Virgin"/> |
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
#!/usr/bin/python | |
import re | |
import sys | |
import base64 | |
import urllib | |
from M2Crypto import BIO, RSA, EVP | |
pem = """-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCt8WGFD2HH1sHbdtrZ0MspHueVDb2vjk2G11qLoxZiTehfRTmlKivFMkdC/4PMtF73Z4kjHDr+7lU9b4DmkcNyZ03DsrRtudY9cGWh0cYCCsODjScjSCKpfTPUj/3Rxe6hcqhfIWw3XuduaALBnT31NR499Qodp859RnBpuwSieQIDAQAB-----END PUBLIC KEY-----""" | |
bio = BIO.MemoryBuffer(pem) | |
rsa = RSA.load_pub_key_bio(bio) |
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
# @my_url = 'http://localhost:3000/zong/callback?consumerCurrency=USD&consumerPrice=9.9900&itemRef=9.9900_USD&method=MOBILE&msisdn=%2B15555550218&outPayment=6.1800+USD&signature=rYLptV7HOnSn82qEV6uYc01ZwO4iGMN3Phag2c5z85Gdp%2FnGJV4S51uRSnEjTm3%2BEP7mcAsP0wG06vro6XP2OR0yPL5ohxWTqpKKu8Q2uEOe5sIxU7zoaOowbILTVfaFP66yLRiKz%2Fnlqs3wRCY3HeqtuZQfm%2FNfdDruRo9cEnM%3D&signatureVersion=1&simulated=true&status=COMPLETED&transactionRef=1_2011_06191550' | |
def callback_test | |
require 'openssl' | |
require 'base64' | |
@parameters = params | |
@signature = params[:signature] | |
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
def callback_test | |
require 'openssl' | |
require 'base64' | |
# Pull the original signature | |
@signature = params[:signature] | |
# Capture all of our parameters | |
@parameters = params |
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
def verify_pem(cert_file, data, signature) | |
public_key = OpenSSL::PKey::RSA.new(cert_file) | |
return public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(signature), data) | |
end | |
def verify_pem_public(cert_file, data, signature) | |
public_key = OpenSSL::PKey::RSA.new(cert_file).public_key | |
return public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(signature), data) | |
end |
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
def verify_zong_signature(params) | |
require 'openssl' | |
require 'base64' | |
require 'cgi' | |
# Pull the original signature | |
signature = params[:signature] | |
# ensure that all of the parameters remain encoded |
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
<% @data.each do |data| %> | |
<p><%= data.something %></p> | |
<p><%= data.something_else %></p> | |
<% end %> |
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
def dwarf | |
dwarf = Race.find(2) | |
gon.dwarf_con_min = (gon.constitution + dwarf.bon_con) - 10 | |
gon.dwarf_con_val = gon.constitution + dwarf.bon_con | |
gon.dwarf_dex_min = (gon.dexterity + dwarf.bon_dex) - 10 | |
gon.dwarf_dex_val = gon.dexterity + dwarf.bon_dex | |
gon.dwarf_div_min = (gon.divinity + dwarf.bon_div) - 10 | |
gon.dwarf_div_val = gon.divinity + dwarf.bon_div | |
gon.dwarf_int_min = (gon.intellect + dwarf.bon_int) - 10 | |
gon.dwarf_int_val = gon.intellect + dwarf.bon_int |
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
<style> | |
span.title { | |
display: block; | |
text-align: center; | |
margin-top: 10px; | |
margin-bottom: 20px; | |
} | |
</style> | |
<div data-role="page" id="sitetips" data-title="Dialog Tips"> |
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 'bcrypt-ruby' |