Skip to content

Instantly share code, notes, and snippets.

View adejorosam's full-sized avatar
🏠
Working from home

Samson Adejoro adejorosam

🏠
Working from home
View GitHub Profile
async computeRollingAverage(
accountId: string,
refDate: string,
): Promise<any> {
const totalPort = [];
const data = [];
let mom = 0;
let momC = 0;
// Loop through the past 7 months
This file has been truncated, but you can view the full file.
<?php
use CardinalstoneRestServer\models\MutualFundModel as mutualFundModel;
use CardinalstoneRestServer\models\ForeignEquityModel as ForeignEquityModel;
use CardinalstoneRestServer\models\CustomerModel as customerModel;
use Carbon\Carbon;
use CardinalstoneRestServer\middleware\Authentication as auth;
use CardinalstoneRestServer\middleware\Authorization;
use CardinalstoneRestServer\middleware\AdminAuthorization;
use CardinalstoneRestServer\middleware\CheckMultifactorAuthentication;
protected function getFormFields(): array {
return [
'epc-form' => [
'status' => [
"Pending Surveys" => ['value' => "pending", 'color' => $this->getStatusColor()['pending']],
"On Hold" => ['value' => 'on-hold', 'color' => $this->getStatusColor()['on-hold']],
"Payment Completed" => ['value' => 'payment-completed', 'color' => $this->getStatusColor()['payment-completed']],
"Survey Booked" => ['value' => 'survey-booked', 'color' => $this->getStatusColor()['survey-booked']],
'Pending Lodgement' => ['value' => "pending-lodgement", 'color' => $this->getStatusColor()['pending-lodgement']],
"Paid" => ['value' => "paid", 'color' => $this->getStatusColor()['paid']],
protected function getFormFields(): array {
return [
'epc-form' => [
'status' => [
"Pending Surveys" => ['value' => "pending", 'color' => $this->getStatusColor()['pending']],
"On Hold" => ['value' => 'on-hold', 'color' => $this->getStatusColor()['on-hold']],
"Payment Completed" => ['value' => 'payment-completed', 'color' => $this->getStatusColor()['payment-completed']],
"Survey Booked" => ['value' => 'survey-booked', 'color' => $this->getStatusColor()['survey-booked']],
'Pending Lodgement' => ['value' => "pending-lodgement", 'color' => $this->getStatusColor()['pending-lodgement']],
"Paid" => ['value' => "paid", 'color' => $this->getStatusColor()['paid']],
<!DOCTYPE html>
<?php
use Carbon\Carbon;
use CardinalstoneRestServer\services\mail\Mailer;
?>
<TABLE class=full-width-container style="HEIGHT: 100%; FONT-FAMILY: Calibri(Body); WIDTH: 100%; PADDING-BOTTOM: 30px; PADDING-TOP: 30px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px" height="100%" cellSpacing=0 cellPadding=0 width="100%" bgColor=#eeeeee border=0>
<TBODY>
<TR>
<TD vAlign=top align=center>
<TABLE class=container style="WIDTH: 720px" cellSpacing=0 cellPadding=0 width=720 bgColor=#ffffff border=0>
$app->post('/api/paystackWebhook', function ($request, $response) {
//check originating IP Address
if($_SERVER['REMOTE_ADDR'] != "52.31.139.75" && $_SERVER['REMOTE_ADDR'] != "52.49.173.169" && $_SERVER['REMOTE_ADDR'] != "52.214.14.220")
{
//check if cal is from cardinalstone server
if($_SERVER['REMOTE_ADDR'] != "167.99.109.180")
{
public function processWebhook($payload) //create new fund
{
$transactionDetails = container('PaystackGatewayModel')->retrieveTransactionDetails($payload['reference']);
if($transactionDetails->amount != $payload['amount'])
{
$message1 = $payload['reference'];
$message2 = $payload['amount'];
$message3 = $payload['ipaddress'];
$message4 = $payload['email'];
<!-- / Full width container -->
<!DOCTYPE html>
<?php
use Carbon\Carbon;
use CardinalstoneRestServer\services\mail\Mailer;
?>
<htmL>
<head>
</head>
<body>
@adejorosam
adejorosam / gist:43f6377597806478c31abd582e904de7
Created March 5, 2024 17:45
equity_usd_funds_email_template.php
<!DOCTYPE html>
<?php
use Carbon\Carbon;
use CardinalstoneRestServer\services\mail\Mailer;
?>
<TABLE class=full-width-container style="HEIGHT: 100%; FONT-FAMILY: Calibri(Body); WIDTH: 100%; PADDING-BOTTOM: 30px; PADDING-TOP: 30px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px" height="100%" cellSpacing=0 cellPadding=0 width="100%" bgColor=#eeeeee border=0>
<TBODY>
<TR>
<TD vAlign=top align=center>
<TABLE class=container style="WIDTH: 720px" cellSpacing=0 cellPadding=0 width=720 bgColor=#ffffff border=0>
<TABLE class=full-width-container style="HEIGHT: 100%; FONT-FAMILY: Calibri(Body); WIDTH: 100%; PADDING-BOTTOM: 30px; PADDING-TOP: 30px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px" height="100%" cellSpacing=0 cellPadding=0 width="100%" bgColor=#eeeeee border=0>
<TBODY>
<TR>
<TD vAlign=top align=center>
<TABLE class=container style="WIDTH: 720px" cellSpacing=0 cellPadding=0 width=720 bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD vAlign=top cellPadding=50 cellPadding=50 border=10 ><!-- / Header -->
<TABLE class="container header" style="BACKGROUND: #1a2155; width: 100%" cellSpacing=20 cellPadding=20 border=0>
<TBODY>