How can I use Bigbluebutton on laravel for create meeting, join meeting - bigbluebutton

Using composer require bigbluebutton/bigbluebutton-api-php in my laravel project, used bigbluebutton, also set for BBB_SERVER_BASE_URL, BBB_SECURITY_SALT, but not able to create meetings.
$meetingParams = new CreateMeetingParameters($request->meetingId,
$request->meetingName);
$meetingParams->setDuration(40);
$meetingParams->setModeratorPassword('supersecretpwd');
$meetingParams = new CreateMeetingParameters($request->meetingId, $request->meetingName);
$meetingParams->setDuration(40);
$meetingParams->setModeratorPassword('supersecretpwd');
I need proper code to create meetings in laravel, using bigbluebutton.

use this package for laravel bigbluebutton
\Bigbluebutton::create([
'meetingID' => 'tamku',
'meetingName' => 'test meeting',
'attendeePW' => 'attendee',
'moderatorPW' => 'moderator'
]);

Related

How to check is kafka server is Running in PHP / Lumen / Laravel?

I need help on kafka. We are connecting to kafka once post created successfully in lumen api. After that sending push to kafka. I'm using below code to sending this.
$conf = new \RdKafka\Conf();
$conf->set('metadata.broker.list', $this->_getHost() . ':' . $this->_getPort());
$producer = new \RdKafka\Producer($conf);
// $producer = $this->connect();
$topic = $producer->newTopic($kafkaTopic);
$topic->produce(RD_KAFKA_PARTITION_UA, 0, json_encode(['body' => json_encode($kafkaMessage), 'properties' => [],
'headers' => [],
]));
$result = $producer->flush(10000);
However, After creating post when calling the kafka and sometimes it's getting error that kafka server is stop.
So, need methodology / stratagy that how can we check that kafka is running or not before creating post.

Ruby date format for PayPal Button Manager API

I can't get a date format that PayPal will accept via its PayPal Button manager API. "The start date specified is invalid." is the error.
Attempt 1: copy the string directly from the documentation:
"start_date": "2017-12-22T09:13:49Z"
I saw this https://github.com/paypal/PayPal-Ruby-SDK/issues/107 so tried
strftime('%Y-%m-%dT%H:%M:%SZ') and utc.iso8601
start_date = "1980-02-19T00:37:04Z"
start_date = (DateTime.now - 10.years).utc.iso8601
start_date = (DateTime.now - 10.years).utc
#bm_build_button_search = #api.build_bm_button_search({ "start_date" => start_date })
# Make API call & get response
#bm_button_search_response = #api.BMButtonSearch(#bm_build_button_search)
#Errors=[#<PayPal::SDK::ButtonManager::DataTypes::ErrorType:0x007fa58b12e110 #ShortMessage="Invalid Argument", #LongMessage="The start date specified is invalid.", #ErrorCode="11998
(byebug) #bm_build_button_search.start_date.class
PayPal::SDK::Core::API::DataTypes::SimpleTypes::DateTime
So it looks like PayPal is fine with this DateTime format but when I call
#api.BMButtonSearch(#bm_build_button_search)
I get the error #LongMessage="The start date specified is invalid."
I just verified following script using Ruby version 2.3.3 and its working fine. Following is the script i used in ruby console.
Step1: install Paypal SDK
$ gem install paypal-sdk-buttonmanager
Step2:
require 'paypal-sdk-buttonmanager'
#api = PayPal::SDK::ButtonManager::API.new(
:mode => "sandbox", # Set "live" for production
:app_id => "APP-80W284485P519543T",
:username => "jb-us-seller_api1.paypal.com",
:password => "WX4WTU3S8MY44S7F",
:signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-
RWy" )
Step3:
start_date = "1980-02-19T00:37:04Z"
#bm_build_button_search = #api.build_bm_button_search({ "start_date" => start_date })
#bm_button_search_response = #api.BMButtonSearch(#bm_build_button_search)
Response: I, [2017-05-06T05:43:14.803444 #6541] INFO -- : Action: BMButtonSearch
I, [2017-05-06T05:43:14.803551 #6541] INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2017-05-06T05:43:27.057413 #6541] INFO -- : Response[200]: OK, Duration: 12.254s
**Please verify using Ruby 2.3.3. Screenshot has been attached. thanks!**
reference: https://github.com/paypal/buttonmanager-sdk-ruby

How to add new email template and call/ use that template in prestashop 1.6

I created a module in which I am displaying all the dormant users by combining two tables - customer and order table and now I Want to perform bulk action (mail send action ) to the dormant users , But I want to make a email template in which this template can be edited and used for sending email to the dormant users from the BO.
How to send email using a template in prestashop ? .
I created a email template (created.html and .text file ) in email folder, Also edited classes/Langugae.php
// Added natives mails files
$mFiles = array(
'account.html', 'account.txt',
'backoffice_order.html', 'backoffice_order.txt',
'bankwire.html', 'bankwire.txt',
'cheque.html', 'cheque.txt',
'contact.html', 'contact.txt',
'contact_form.html', 'contact_form.txt',
'credit_slip.html', 'credit_slip.txt',
'download_product.html', 'download_product.txt',
'employee_password.html', 'employee_password.txt',
'forward_msg.html', 'forward_msg.txt',
'guest_to_customer.html', 'guest_to_customer.txt',
'in_transit.html', 'in_transit.txt',
'log_alert.html', 'log_alert.txt',
'newsletter.html', 'newsletter.txt',
'order_canceled.html', 'order_canceled.txt',
'order_conf.html', 'order_conf.txt',
'order_customer_comment.html', 'order_customer_comment.txt',
'order_merchant_comment.html', 'order_merchant_comment.txt',
'order_return_state.html', 'order_return_state.txt',
'outofstock.html', 'outofstock.txt',
'password.html', 'password.txt',
'password_query.html', 'password_query.txt',
'payment.html', 'payment.txt',
'payment_error.html', 'payment_error.txt',
'preparation.html', 'preparation.txt',
'refund.html', 'refund.txt',
'reply_msg.html', 'reply_msg.txt',
'shipped.html', 'shipped.txt',
'test.html', 'test.txt',
'voucher.html', 'voucher.txt',
'voucher_new.html', 'voucher_new.txt',
'order_changed.html', 'order_changed.txt',
'dormant_email.html', 'dormant_email.txt'
);
I added my email template - 'dormant_email.html', 'dormant_email.txt' in mails\en folder
ok I solved this by adding the template file by creating mail.en folder in module folder ( modulename/emails/en/)
and by below code
if (!Mail::Send(
$this->context->language->id,
'dormant_email',
Mail::l('Hello Long Time No See ! Please Visit and Get a Chance to Win'),
$templateVars,
$dormantUserEmailID,
null, null, null, null, null, dirname(__FILE__).'/mails/', true, $this->context->shop->id))
die('0') ;echo "<script type=\"text/javascript\">alert('Email Send');</script>"; return true;
die('1');echo "<script type=\"text/javascript\">alert('Email not Send');</script>"; return false;
I am able to send email and use the template and it is been listing when I click on the
Localization->transalations -->modify transalations
select email template translations and select English and click modify button and in the modules when u expand your module the email template can be seen and can be edited by edit tool .

Problem deploying Zend Framework website: doesn't find the classes

I'm trying to deploy a website made with the Zend Framework. The website is running fine on my local environment, I'm trying to deploy it on my VPS. But I'm running into some difficulties.
Now it says the following:
*Fatal error: Class 'Doctrine_Manager' not found in /is/htdocs/wpxxxxx/www/mensenenjij/application/Bootstrap.php on line 12*
It properly includes the Doctrine classes but it can't instantiate a new Doctrine_Manager. Anybody knows why?
Bootstrap.php:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initDoctrine()
{
require_once 'Doctrine/Doctrine.php';
$this->getApplication()
->getAutoloader()
->pushAutoloader(array('Doctrine', 'autoload'), 'Doctrine');
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(
Doctrine::ATTR_MODEL_LOADING,
Doctrine::MODEL_LOADING_CONSERVATIVE
);
$config = $this->getOption('doctrine');
$conn = Doctrine_Manager::connection($config['dsn'], 'doctrine');
return $conn;
}
}

500 error when calling webservice through rhosync/rhodes

I am trying to call a web service in rhosync application.rb, I see a 500 error response in rhosync console .. and 'server returned an error' in BB simulator .. :(
Some info about my setup -
I have created a rhodes app that connects to a rhosync app when user enters user name and password and clicks on "login". I am calling this webservice through "authenticate" method of application.rb of the rhosync application ..
def authenticate(username,password,session)
Rho::AsyncHttp.get(:url => 'http://mywebserviceURL',:callback => (url_for :action => :httpget_callback),:callback_param => "" )
end
UPDATE
Instead of http:async, I tried consuming a soap based webservice and it worked just fine .. here is code if anyone cones here in search of a sample.. in application.rb of rhosync app
require "soap/rpc/driver"
class Application < Rhosync::Base
class << self
def authenticate(username,password,session)
driver = SOAP::RPC::Driver.new('http://webserviceurl')
driver.add_method('authenticate', 'username', 'password')
ret=driver.authenticate(username,password)
if ret=="Success" then
true
else
false
end
end
end
Application.initializer(ROOT_PATH)
You can typically find the problem if you crank up your log. Edit rhoconfig.txt in your app
set these properties -
# Rhodes runtime properties
MinSeverity = 1
LogToOutput = 1
LogCategories = *
ExcludeLogCategories =
then try again and watch the terminal output. Feel free to post the log back and I'll take a look.
You also might want to echo out puts the mywebserviceURL if you're using that as a variable, I trust you just changed that for the post here. Can you access the webservice if you hit it with a browser?
require "soap/rpc/driver"
class Application < Rhosync::Base
class << self
def authenticate(username,password,session)
driver = SOAP::RPC::Driver.new('http://webserviceurl')
driver.add_method('authenticate', 'username', 'password')
ret=driver.authenticate(username,password)
if ret=="Success" then
true
else
false
end
end
end
Application.initializer(ROOT_PATH)
in this what is done in add_method and authenticate method and where it to be written.