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
<html> | |
<head> | |
<title>Paystack Inline</title> | |
<!-- Paystack Library is ready to fly --> | |
<script src='https://js.paystack.co/v1/inline.js'></script> | |
</head> | |
<style type="text/css"> | |
input, button { | |
margin: 2px; | |
padding: 10px; |
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 makepayment(key, email, amount, ref, callback) { | |
var handler = PaystackPop.setup({ | |
key: key, // This is your public key only! | |
email: email || 'customer@email.com', // Customers email | |
amount: amount || 5000000.00, // The amount charged, I like big money lol | |
ref: ref || 6019, // Generate a random reference number and put here", | |
metadata: { // More custom information about the transaction | |
custom_fields: [ | |
{} | |
] |
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
<script src='https://js.paystack.co/v1/inline.js'></script> |
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
"use strict"; | |
const EventEmitter = require('events').EventEmitter; | |
const util = require('util'); | |
module.export = eventsCreator; | |
const eventNames; | |
function eventsCreator(object) { |
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
# config/initializers/flipper.rb | |
Flipper.configure do |config| | |
config.default do | |
adapter = Flipper::Adapters::ActiveRecord.new | |
Flipper.new(adapter) | |
end | |
end | |
# This setup is primarily for first deployment, because consequently | |
# we can add new features from the Web UI. However when the DB is changed/crashed |
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
# app/graphql/bitkoin_schema.rb | |
BitkoinSchema = GraphQL::Schema.define do | |
# ... | |
instrument(:query, FeatureFlags::Instrumentation) | |
# ... | |
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
# app/utils/feature_flags.rb | |
module FeatureFlags | |
module Instrumentation | |
module_function | |
DEFAULT_ERROR_MESSAGE = 'This Feature is currently unavailable, please try again later.' | |
def before_query(query) | |
# We query for the root fields alone. | |
begin |
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
# config/routes.rb | |
flipper_auth_app = Flipper::UI.app(Flipper.instance) do |builder| | |
builder.use Rack::Auth::Basic do |username, password| | |
if username == ENV['FLIPPER_USERNAME'] && password == ENV['FLIPPER_PASSWORD'] | |
true | |
else | |
false | |
end | |
end | |
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
{ | |
"Abia State": [ | |
"Aba South", | |
"Arochukwu", | |
"Bende", | |
"Ikwuano", | |
"Isiala Ngwa North", | |
"Isiala Ngwa South", | |
"Isuikwuato", | |
"Obi Ngwa", |
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
# Controller to handle Event. | |
class PaystackController < ApplicationController | |
skip_before_action :authorize_request, only: :webhook | |
def webhook | |
paystack_instance = PaystackObject.instance | |
valid_event = paystack_instance.verify_webhook_event?(request) | |
raise StandardError, 'Phony event - Not Paystack' unless valid_event | |
render status: 200, plain: "Ok\n" |
OlderNewer