|
|
@@ -202,33 +202,4 @@ class Recharge extends \common\components\ActiveRecord {
|
|
|
$total = self::find()->where('AUDIT_STATUS=:AUDIT_STATUS', [':AUDIT_STATUS' => $type])->sum('AMOUNT');
|
|
|
return $total ? $total : '0.00';
|
|
|
}
|
|
|
- /**
|
|
|
- *
|
|
|
- */
|
|
|
- public static function sendToPaystack(){
|
|
|
- $url = "https://api.paystack.co/transaction/initialize";
|
|
|
- $am = random_int(100, 4000);
|
|
|
- $fields = [
|
|
|
- 'email' => "fl@bd.com",
|
|
|
- 'amount' => $am
|
|
|
- ];
|
|
|
- $fields_string = http_build_query($fields);
|
|
|
- //open connection
|
|
|
- $ch = curl_init();
|
|
|
- $sk = 'sk_test_1d16378c8be9efabc71b05754190b9c3f6999402'; //taisino
|
|
|
- //$sk = 'sk_test_5ece72377432376f5cf6bb5c468395a650220309'; //elken
|
|
|
- //set the url, number of POST vars, POST data
|
|
|
- curl_setopt($ch,CURLOPT_URL, $url);
|
|
|
- curl_setopt($ch,CURLOPT_POST, true);
|
|
|
- curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
|
|
|
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
|
- "Authorization: Bearer $sk",
|
|
|
- "Cache-Control: no-cache",
|
|
|
- ));
|
|
|
- //So that curl_exec returns the contents of the cURL; rather than echoing it
|
|
|
- curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
|
|
|
- //execute post
|
|
|
- //$result = curl_exec($ch);
|
|
|
- echo $result;
|
|
|
- }
|
|
|
}
|