Does getPriceAmountMicros() include local taxes for skus of type subscription? - android-billing

I've been using the Android billing client for a while now and always display the prices using getPriceAmountInMicros() from the SkuDetails object returned from the billing client.
Often we get complains from some of the customers that the price we display is not the same price they're paying. I've always assumed this is due to local taxes and that the Google play Store doesn't return the prices with local taxes included.
However, going to the documentation of getPriceAmountInMicros() things start to get a bit fuzzy. In particular this section:
This value represents the localized, rounded price for a particular currency.
What is a "localized price"? Is this including taxes? I cannot find any explicit place where it says this includes taxes or that it doesn't. By contrast the documentation for getPrice() explicitly states that the price does not include taxes.
Looking into a completely different resource, yet connected to a sku, one can see the same method - getPriceAmountInMicros(). In this method, it's explicitly stated that the price does not include taxes. It would seem odd to me that they would choose to name the method in a SkyDetails object the same, but have different semantics. Nevertheless, I want to be sure and would highly appreciate your help!

Thanks for pointing this out.
Because the QPS of computing taxes during skuDetails queries would be high, our servers defer tax computation to the purchase flow. So unless you need getPriceAmountMicros() for, say, refunds; you should simply use getPrice().

Related

When to use QUOTE on Shippo

When creating certain objects on Shippo, there's this object_purpose attribute that allows you to select either QUOTE or PURCHASE. I can see that PURCHASE is for labels that are meant to be bought and used in the end, but when should I use QUOTE only?
It's fine to use PURCHASE for all your objects. Just remember, that a complete from / to address is required.
You should use QUOTE when you don't intend to actually buy a label - such as getting rates to show to a buyer or just doing a shipping estimate. The benefit of using QUOTE is that rates can be retrieved using less information (such as only passing the zip codes), since the the full street address is not required.

perfect fit for a Postgres function or not (and how)?

I'm working on this kind of data structure :
Now, say I have to search for products that are < 90 EUR, it should only returns the product "item2". On the other hand, if I search for products that are == 100 EUR, I should only returns the product "item1".
I have 60 000 products and 16 currencies, so I just can't convert all products in all currencies on a daily basis (as the currency rates updates daily) only to be able to perform this search.
I have 2 questions :
is this use case a good fit for a Postgres function ? Is there any other good and sustainable solution if not ?
if a postgres function is the solution. Given that I'm using Ruby on Rails (4.2) and the search requests (on products sizes, colors etc...) are chained using ActiveRecord : is the call to the DB function still chainable and usable in AR ?
Thanks for your help
Using a function for this is a terrible idea, because performance will suffer greatly: the exchange rates will change over time, rendering your indexes useless.
Further, it's a terrible idea to store a single price per item. Thing psychological prices and tax considerations: if something is €99.99 including VAT in the Eurozone, it'll probably make sense to sell it for $99.99 plus sales tax in the US. No amount of exchange rate manipulation using functions or other will change that. (Compare the prices of Apple in the US, in France, in the UK, etc.).
For each item, associate a price in Euros, one in Dollars, etc. -- each with a currency_id, and have the exchange rates reside in a separate table. Or create some kind of price-list table in which you associate prices based on currency (e.g. €99 = $99) to a price_id, and associate the products (it's actually the SKU, btw) to their corresponding price_id.
You can fill this data in semi-automatically using an exchange rate table, and periodically update them using one as well. But really: do reserve the ability to manually set prices, make sure you mark prices as including or excluding tax. And when it comes to taxes, don't forget that tax rates are different from a place to the next and from a product to the next.
For the record, I ended up creating a new column "price_eur" in the "products" table where I convert each price to EUR whatever is the original currency. Doing so I can perform a consistent search based on this price_eur column.
I just wanted to know if there was an alternative solution but looks like there is no other simple way...

OpenCart: Flat Option Cost + Per Item Cost for Products

In Opencart, I have a product which you select colors of.
Basically the pricing should be: Each additional printing color costs a flat rate of $50 + $0.25 for each.
So if a person were ordering 1000 items, with 2 colors, the cost would need to be BASECOST + $100($50x2) + $250(1000x$.25)
Right now I'm only able to set up the cost for each product. Since people are going to be both ordering large and huge quantities, there's no easy way to build it into the each price.
I could have sworn I saw a free extension awhile ago that allowed you to set both a flat price for an option, and a price for each on the quantity. Trying searching everything I could think of, but the only thing that I could find is for shipping (we already have a pretty complex setup for the shipping, so can't mess with that).
Has anyone came across a solution, or simple extension for this problem. Seems like a simple thing, but still can't find a solution for the life of me.
Thanks!
The easiest way I can see to do this would be to have fixed costs for certain price breaks which can be done through the Discount tab of each product, and can even be set based on customer group if you have wholesale as well as regular customers or other customer groups

When does the Google Analytics API zero out ga:adCost? Is there a workaround?

Good afternoon. The ga:adCost metric and the ga:date and ga:referralPath dimensions are compatible, according to the reference doc. But when I query for these three values:
https://www.google.com/analytics/feeds/data?ids=XXX&dimensions=ga%3Adate%2Cga%3AreferralPath&metrics=ga%3AadCost&filters=ga%3AadCost%3E0&start-date=2011-04-21&end-date=2011-05-05&max-results=50
I get no results. Removing the filter does not change the outcome. If I remove ga:referralPath, I get expected results, with many records with non-zero ad cost. Other Campaign dimensions are OK, such as ga:source and ga:medium, though apparently ga:adContent is also no good.
At least one other person has seen very similar behavior (blog here). I've considered that it could be due to sampling and rounding, but it persists for very small date ranges.
Is there a workaround? ga:adCost is not allowed with ga:transactionId, which is the only unique identifier of which I'm aware, and even that only applies to customers who make a purchase.
I think that the problem is due to there not being a referral path for AdWords visits recorded in Google Analytics. If you want to see where AdWords visits are coming from then you need to use the other campaign dimensions (source, medium, campaign, keyword and adContent).

How should your company sponsor programming certification

Say your company is willing to sponsor the fees for taking programming certification examination. What is the best aproach to implement this?
I would say if the programmer passes the exam at the first try, it shoud be fully sponsored.
If the programmer doesn't pass the first try, the 2nd exam should be 50% sponsored. If failed 3rd time, the programmer should pay in full (including for the first 2 exams).
I find that it is difficult to balance between voluntary taking up the exam (for confident programmers) and mandatory / policy set by the management.
Anyone like to share your experience / suggestion on this?
For optional certification:
At our company, you must receive a pass to get any sort of compensation. Anything below, and you get nada. If you fail the first two times and pass the 3rd time, you still pay for the first two times...but the company will pay for the third.
For required certification:
Company pays no matter what.
Sponsor the first time regardless, that includes the necessary training.
Failure or success of the exam is of secondary importance comapred to the training, many companies often require staff to be regularly trained too, so its not much of a cost in the first place.
Taking the exam is also up to the staff member, let them take it if they want, but don't worry if they don't.
Fully sponsor training and test fees for the first attempt of the test and give a small bonus (~ cost of test fees) upon successfully passing a test or attaining a certification.
That way if the person doesn't pass on the first attempt, there's still an incentive to pass, even when they're putting up their own money.