Google ADX Seller Rest API: get report by custom currency - google-api

I'm using Google ADX API to get revenues report by date range.
By default I'm getting the revenues in ILS but I what to get the currency in USD or EUR and I don't want to use currency conversions like https://www.google.com/finance/converter
According to the formal documentation api (https://developers.google.com/ad-exchange/seller-rest/reference/v1.1/reports/generate) I didn't find any way for this issue..
Thats what i'm doing in my php code:
$params = array(
'metric' => array('EARNINGS'),
'dimension' => array('DATE', 'AD_TAG_NAME', 'AD_TAG_CODE','CUSTOM_CHANNEL_NAME', 'CUSTOM_CHANNEL_ID'),
'sort' => '+DATE'
//'currency' => 'usd' - try to add custom currency but unsuccess
);
$service = new Google_Service_AdExchangeSeller($client);
$service->accounts_reports->generate($accountId, $dateFrom, $dateTo, $params);
print_r($report['header']); //print: [currency] => ILS
Does anyone know how to do it?
Thanks

Related

getOfferById method provided by an API does not work (invalid Id or Error cannot find parameter) [Laravel]

I am a junior developer working on this project.
I'm using an API who provide offers and I'm trying to display them.
They provide several methods as "getOffers" "search" "getOfferById".
I managed to display all the offers with the getOffers, but I can't use the getOfferById. I might be using it the wrong way.
They also provide us with a sandbox to play with the methods so when I put the id on the sandbox it works fine. Here is an exemple from the doc:
$offer = $soapClient->getOfferById($offerId, array('key' => 'length.unit', 'value' => 'm'));
and here is what I've tried so far :
$offerId = 2020012100009;
$offer = $soapClient->getOfferById($offerId, array('key' => 'length.unit', 'value' => 'm'));
dd($offer->length);
I get "Error can not find parameter" for this.
$offer = $soapClient->getOfferById($offerId);
and I get "Invalid Id" for this.
There is no such id in the database, are you sure that the id you providing is valid?
I resolved my problem. I had to apply it like that.
$offer = $soapClient->getOfferById(array(
'id' => $offerId
));

Google calendar api not showing the organizer name and sending notification emails - 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.

Inventory stock is not updating for a particular product using Soap Api

I am using Magento version 1.12.0.2.
I am not able to update stock quantity using soap API. It is working fine for other products except one. I tried to update manually from admin and it worked fine but when trying to update from soap API, its not updating.
Please find the script below:
$proxy = new SoapClient('https://sueryder.wcltest.com/index.php/api/v2_soap/?wsdl');
$sessionId = $proxy->login('demo', 'demotest');
$result = $proxy->catalogInventoryStockItemUpdate($sessionId, 3711, array(
'qty' => '31',
'is_in_stock' => 1
));
var_dump($result);
Use soap client- https://sueryder.wcltest.com/index.php/api/v2_soap/?wsdl=1 insteed of https://sueryder.wcltest.com/index.php/api/v2_soap/?wsdl.

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