Google calendar api not showing the organizer name and sending notification emails - laravel - laravel

I'm using a laravel package for the google calendar API integration. In that, I am able to create events with just attendees only. I've tried creating organizer but it's not coming up. The following is the code I've used. The organizer name here defaults to the email from which the API credentials are created also the email notifications are not coming.
The package I'm using is spatie/laravel-google-calendar
Can anyone tell me what I'm doing wrong here?
Event::create([
'name' => 'Latest Event dsfdsfsdfsdf',
'location' => '800 Howard St., San Francisco, CA 94103',
'description' => 'A chance to hear more about Google\'s developer products.',
'startDateTime' => Carbon\Carbon::now(),
'endDateTime' => Carbon\Carbon::now()->addHour(),
'sendNotifications' => true,
'sendUpdates' => 'all',
'organizer' => array('email' => 'test#gmail.com','displayName' => 'Darshan')
'attendees' => array(
array('email' => 'test#gmail.com','displayName' => 'Darshan', 'organizer' => true),
array('email' => 'darshan#test.com','displayName' => 'Ryan')
)
]);

The package doesn't support adding an organizer yet. You could either add the functionality to the package or you could use the Google ApiClient directly. The Google Sdk does have a setOrganizer method which should work similar to the setAttendees method that is called in the Event class.
Apparently the word "organizer" is bit of a misnomer and it actually refers to the calendar that the event is created on. Have a look at this question and it's comments.

Related

Error in using same card for subscription and one off payment

Scenario:
I want to create a subscription and also one time payment with the same card. I am using 3D secure card number 4000002500003155 so I got a popup to convert 3D autentication. Once I confirm, I submit payment method to server using Ajax, and I update the default payment method and subscription is creating successfully but one time charge with the same default payment method is throwing this exception:
"The payment attempt failed because additional action is required before it can be completed."
How can I use the same card to create subscription and one off payment with 3D secure card: 4000002500003155
Here is my frontend code:
stripe.confirmCardSetup(clientSecret, {
payment_method: {
card: cardElement,
billing_details:{ name: "{{$data->first_name}} {{$data->last_name}}"}
},}).then(function(result) {
if(result.error){
}else{
}}
Hoping for some help in this.
If you review the description for that test card, you'll see that it requires 3DS for one time payments unless set up and used as off-session.
If you make your one-time payment intent as off-session, after doing the card setup and attaching to a customer as you've done, then it should succeed.
\Stripe\PaymentIntent::create([
'amount' => 2000,
'currency' => 'usd',
'payment_method_types' => ['card'],
'customer' => 'cus_123',
'payment_method' => 'pm_456',
'off_session' => true,
'confirm' => true,
]);

How to post image on facebook timeline using graph api 4.0?

I am creating an API to post on my Facebook timeline using graph API 4.0. For this, i am first creating an album and then post image in that album.
here is the code
$facebook = new Facebook(array(
'appId' => 'APP_ID',
'secret' => 'APP_SECRET',
'cookie' => true,
));
$user = $facebook->getUser();
if ($user) {
//Create an album
$album_details = array(
'message'=> 'Album desc',
'name'=> 'Album name'
);
$create_album = $facebook->apiRequest('/me/albums/{user-access-token}', 'post', $album_details);
dd($create_album);
}
which returns an error
Raw Provider API response: {\"error\":{\"message\":\" This object does not exist or does not support this action\"
But when i gave page token instead of a user access token , it works fine. I am new to this. So, i have no idea how to solve this.
The Facebook API no longer permits publishing to personal profile feeds.
https://developers.facebook.com/docs/graph-api/reference/v4.0/user/feed#publish
As of April 24,2018, the publish_actions permission has been removed. Please see the Breaking Changes Changelog for more details. To provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.

How to override shipping address without checkbox in PayPal

I'm trying to implement PayPal Api in my application, everything works just fine except for one thing; How can I override the shipping address in PayPal Payment without checking the Make this my preferred shipping address checkbox.
I want it to be automatically check or my shipping address MUST be automatically applied as my shipping address. Please see the code and screenshot below:
$patchReplace = new Patch();
$patchReplace->setOp('add')
->setPath('/transactions/0/item_list/shipping_address')
->setValue([
"recipient_name" => "{$request->input('first_name')} {$request->input('last_name')}",
"line1" => $request->input('address'),
"line2" => $request->input('barangay'),
"city" => $request->input('city'),
"state" => $request->input('province'),
"phone" => $request->input('contact_number'),
"postal_code" => $request->input('zip'),
"country_code" => $request->input('country')
]);
$patchRequest = (new PatchRequest())->setPatches([$patchReplace]);

Magento Rest API Issue When Using PayPal Payment Advanced

I'm using Magento's Rest API to sell item from my Wordpress based site. I am having an issue when I try to use PayPal Payment Advanced to complete the transaction. Here is the code below:
$paymentArray = array(
"method" => "payflow_advanced",
'cc_cid' => $_POST['cccvv'],
'cc_owner' => $_POST['firstName'] . " ". $_POST['lastName'],
'cc_number' => $_POST['ccnumber'],
//'cc_type' => "MC",
'cc_exp_year' => $_POST['ccmonth'],
'cc_exp_month' => $_POST['ccyear'],
);
$resultPaymentMethod = $client->call($session, 'cart_payment.method', array($shoppingCartIncrementId, $paymentArray));
When I run the code, it comes back as "true" but the api never hits PayPal and authorizes the transaction.
Once you var_dump($resultPaymentMethod) and see what's it displaying the output..

How to store birthday through mailchimp API?

I'm using mailchimp 1.3 in a Codeigniter application through this library.
I have this piece of code:
$birthday = date('m/d', strtotime('1984-04-29');
echo $birthday;
$merge_vars = array(
'FNAME'=> $profile_info['name'],
'LNAME'=> $profile_info['lastname'],
'birthday' => $birthday,
'GROUPINGS' => array(array('name' => $this->group_name, 'groups' => $this->group1))
);
$this->mail_chimp->listSubscribe($this->list_id, $email, $merge_vars);
The subscription works and in the administration panel of mailchimp I can see the user name and lastname, but no birthday.
In the api documentation it says it should be formatted as MM/DD and echoing the
birthday I verified it was right.
Any suggestions?
Ok, I solved.
I had to add a field for the birthday in the list settings as explained here:
http://kb.mailchimp.com/article/how-do-i-create-and-send-automatic-birthday-campaigns

Resources