Apple Pay - get full shipping address (containing 'addressLines') - javascript

I'm doing an Apple Pay WEB integration (using JS) and Braintree as a payment provider.
I need to calculate some taxes (US sales tax) for the order.
Current flow: The user clicks Pay with Apple Pay button, the Apple Pay payment sheet is displayed (we require shipping address containing the postal address,zipcode,name and email).
After that the payment sheet is displayed -> I call the session.onshippingcontactselected function, but at this point I can only get the locality,administrativeArea,postalCode,country and countryCode values from the shippingContact, so I'm not getting the addressLines containing the street name and its number. I need these values as well to accurately calculate my tax.
I know that Apple says in docs that they only provide the full address after the user authorizes the payment, meaning after the payment was done (this is too late for me, cause I need to know the tax amount before the order is being placed/before the user authorizes/pays the order).
Is there a workaround through this?

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
As this information is delivered by Apple directly, there isn't a means by which you could circumvent the redacted shippingContact information provided in the pre-authorized session using Braintree's integration. If you need the full address to calculate tax you'd need to collect that from your customer earlier in the payment process or use a different means to calculate tax using the information provided in the shippingContact object. I'd recommend sending our support team an email to discuss this further.

Related

PayPal Currency Conversion is incorrect

I am implementing paypal checkout 2.0 with smart buttons into an eCommerce website I am developing.
Now the problem I am facing is that the "shop" is priced in South African Rands(ZAR) and paypal gateway does not support ZAR as a currency to pay in, so I convert the currency to USD through a third party library. where I send a get request to an api and get the exchange rate for USD/ZAR.
then I divide the product order total/exchange rate and the result is the USD amount. which I parse to the paypal object then proceed with the checkout.
The problem is that Paypal has its own exchange rate and when it picks up that a users card is with a South African Bank it automatically does a conversion and shows the user how much he/she will be paying in the ZAR amount, and that value is different to the actual ZAR Amount.
I would like to know is there an api I can request the exchange rate of the USD/ZAR amount and use that value as the exchange rate or Is there away to disable the ZAR value from being Shown in the checkout
There is no API to get the current foreign exchange rate. The rate varies from moment to moment.
As far as hiding the rate in your screenshot, the answer is no. That currency conversion is happening for the buyer end and is invisible to whoever is receiving a payment denominated in a different currency (USD in this case). They have no visibility or control over this process. A buyer paying from a non-South African country would see something entirely different on this screen, for instance --not ZAR. So that's entirely between them and PayPal, you are not a party to this.

Google Maps Javascript API Billing

I want to use any of these 3 APIs:
Maps JavaScript API
Geocoding API
StreetViewPanorama(Dynamic Street
View)
But I could not get an exact information on how the billing works.
I want to know 2 things regarding these:
By using any of these APIs, can we get requests for free without adding the billing details?
If its mandatory to add billing details, how many requests will I get for free if billing details are added?
Anyone who knows these, please help.
By using any of these APIs, can we get requests for free without adding the billing details?
No, you will have to add the billing details to get the requests.
If its mandatory to add billing details, how many requests will I get for free if billing details are added?
You get the equivalent of 200$ per month for free. The price of each request is stated here: https://cloud.google.com/maps-platform/pricing/.
Once you have used 200$ worth of requests, you will have to start paying.
If you are afraid of going beyond the free 200$ per month you can setup quotas to prevent sudden, unexpected bills.
For example: "if i have to spend more than 1$, stop serving the APIs." so that your bill at the end of the month will be maximum 1$ - or 0$ if you so please:
Manage Your Cost of Use
To manage your cost of use of the Google Maps Platform APIs, you can set daily limits to all requests to any billable API.
To view or change daily billable limits for the Maps JavaScript API, do the following:
Go to the Maps JavaScript API Quotas page in the Google Cloud Platform Console.
From the projects list, select a project. In the Requests section, on the Requests per day line, click the edit icon, then enter the preferred total billable daily quota, up to the limit (if any) specified by Google.
From: https://developers.google.com/maps/documentation/javascript/usage-and-billing#set-caps
In order to use maps services, you will need to provide a valid billing account/payment method. this is because once your free trial period is over or free trial credit is fully used up then you can simply upgrade to a paid account.
Once you have a valid/working billing account then you are entitled to receive a free $200/month maps credits. once this credits is fully consumed then it checks for your free trial credit worth $300 valid for 1 year. if you have this free trial credits then it can be use to offset any charges. otherwise if your account does not have a free trial credits left then you will get billed automatically using the payment method setup on your account.

Check Apple-Pay Price

The site has implemented payment through applePay. The problem is that the payment amount is set in javascript, i.e. can the user open the code and change the amount? How to implement verification on the server?
Apple Pay doesn't actually process the payment. It provides your site with a payment credential that you use to send to a payment processor.
Yes, a user can change the amount in the browser, but it only impacts what that user sees, not what is ultimately charged. The amount in the sheet is for user feedback where you can display a breakdown of the price, etc.
The best way to verify the amount is by doing this on the server side. If your site processes orders, use the items in the order to calculate the total, shipping etc. You should be able to ignore the amount coming from the client altogether.

temporarily storing credit card information in database

I maintain an internal web app used for customer relationship management (CRM) by company staff (agents and bookkeepers), there are no online sales/purchases all payment processing is done in person with terminals to accept credit card payments. Sometimes there are subsequent payments that have to be processed at later date away from customer.
Here's my scenario:
A staff agent answers a call and requested to take a credit card payment the customer wishes to pay with, but since the agent cannot run the payment through the terminal (only the bookkeeper can) they take a note of the information and give this note to the bookkeeping staff to run the credit card payment on terminal at a later time.
Of course this is an insecure method of transferring credit card information as anyone could see in plain text what is written on the sticky note, including cleaners of the office, etc. When the payment is finally run by the bookkeeper and destroyed in a shredder.
Anyway, I got a request to store this information temporarliy until the bookkeeper runs it and deletes from the database. I can't find specific information about temporary storage and hoping someone can help point me in the right direction or give me a better idea of what the practices should be or if there are third party I can use.
So far what I think is to encrypt the cc data and store in db until the bookkeeper clicks delete in which case it will be removed from the database.
Final note; I am using PHP/MySQL and javascript front end.
Thanks for the help.
If your software handles credit cards in any way and for any period of time, you're in scope for PCI. PCI compliance is kind of a big deal and best left to a 3rd party vendor that specializes in this kind of thing. Storing credit cards even "temporarily" is asking for trouble.

Is there a means to disassociate shipping addresses with the billing account in magento?

I am working on a site for a client where purchases are always sent to a third party in Magento CE ver. 1.8.1.0. While doing some style edits, we ran into a deeper issue; all of the shipping addresses are anchored to the account that created the billing information. The initial problem became apparent when dealing with shipping address pre-population in onepage checkout, where shipping was defaulting to the billing address (when tracing the methods calling the name). We could resolve this part on the frontend by repopulating the fields (or depopulating them) with javascript/ajax, however this will still leave an administrative nightmare unresolved on the back end, which will need to be addressed for the clients business model to work as intended. Basically, we need to disassociate the shipping addresses completely with the billing account and assign independent addresses to each purchase rather than keeping them all tied to the origin account, so when whoever is administrating the site has to deal with ongoing business concerns, they don't have to sort through a billion addresses in admin >> customers >> (account) >> addresses to deal with customer issues. Is there any extension that can easily accomplish this, or alternately some hidden core functionality to do so? Writing a custom solution will be difficult on the budget.

Categories