2 Commits

Author SHA1 Message Date
ameye 320cbb11ee Added Firebase JWT and secret generation 2022-06-01 07:45:19 -04:00
ameye 6949150647 fix 2022-05-31 19:47:51 -04:00
4 changed files with 49 additions and 2 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
chdir('..');
require 'vendor/autoload.php';
use Firebase\JWT\JWT;
$teamId = 'JR363FEY8R';
$keyId = 'W5WTWC9DTJ';
$sub = 'com.wrenchboard.users.client';
$aud = 'https://appleid.apple.com'; // it's a fixed URL value
$iat = strtotime('now');
$exp = strtotime('+60days');
$keyContent = file_get_contents('/home/oameye/AuthKey_W5WTWC9DTJ.p8');
echo JWT::encode([
'iss' => $teamId,
'iat' => $iat,
'exp' => $exp,
'aud' => $aud,
'sub' => $sub,
], $keyContent, 'ES256', $keyId);
// Write the snippet in a method, return the value from that method
// You
?>
+4
View File
@@ -277,6 +277,10 @@ define('PAY_MODE_BONUS', 9);
define('APPROVED_BALANCE', 5);
define('DISAPROVE_BALANCE', 3);
// define('WRENCHBOARD_COUPON_CREATE', 85010);
// define('WRENCHBOARD_COUPON_ACTIVATE',85015);
define('WRENCHBOARD_COUPON_REDEEM', 85020);
define('WRENCHBOARD_USER_SENDMONEY', 11051);
+13
View File
@@ -27,6 +27,19 @@ class Coupons extends Users_Controller {
$what = $this->input->get('what');
$value = $this->input->get('value');
echo "RD $what $value";
if ($what !='' && $value!=''){
$data = $this->getSessionArray();
$in=[];
$in['code_id'] = $what;
$in['code'] = $value; // just maing sure
$in['member_id'] = $_SESSION['member_id'];
$in['action'] = WRENCHBOARD_COUPON_REDEEM;
$this->load->model('backend_model');
$out = array();
$res = $this->backend_model->wrenchboard_api($in, $out);
}
}
}
+3 -2
View File
@@ -13,10 +13,11 @@
"require": {
"php": ">=5.3.7",
"facebook/graph-sdk" : "^5.7",
"firebase/php-jwt": "^5.5.1",
"firebase/php-jwt": "^6.2",
"phpseclib/phpseclib": "^3.0",
"hybridauth/hybridauth" : "~3.7.1",
"google/apiclient":"^2.12.1"
"google/apiclient":"^2.12.1",
"paragonie/sodium_compat": "^1.17"
},
"suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x"