Magento2 currency switcher using rest API - rest

I am creating a Magento website with currency switcher, It works fine in webview. I need the same for mobile app. If the user changed the currency once, all the prices should change to selected currency.
Are we need to add any extra parameter on every API call to get chosen currency value?

You can create multiple store views for each currency. When user change currency you can simply load that store view via API.

Related

How to add currency converter to my flutter e-commerce app?

I'm creating an app where users can upload products in their country's currency and the product will be visible for other users in their own country's currency.
For example, a user from France should be able to set the price of the product in Euros and other users viewing the product, say one of them is viewing the product from Australia then the price should be converted to Australian dollars.
How do I achieve this with flutter?
If I have the user's country details already, is there any converter plugin or API that does this?
The plugin or API should obviously update with rates. I'm using Firebase for the database to store the uploaded product and details. Or maybe I can save the product price in multiple currencies with their current rates at the time of upload and the price wont change with the change in rates after upload.
use the api to get the updated conversion rates. You can use this api
You can use the forex package to access exchange rates easily.
From their examples section:
quotes = await Forex.fx(
quoteProvider: QuoteProvider.ecb,
base: 'JPY',
quotes: <String>['EUR', 'USD']);
print('Number of quotes retrieved: ${quotes.keys.length}.');
print('Exchange rate JPYEUR: ${quotes['JPYEUR']}.');
print('Exchange rate JPYUSD: ${quotes['JPYUSD']}.');
Please note that getting the exchange rates of currency is the easy part in the mess that banking is... be sure to think about all the edge cases in your application if you want to do more than just display a price tag.

Paypal PDT doesn't return "custom" value anymore (regression?)

We use PDT's cmd=_notify-synch API to validate transactions when the customer is redirect back to our website after a payment.
We pass a "custom" value in our Paypal buttons with a customer id, and we expect to get this value back. This worked fine for the past 5 years.
Starting on or around 2018/10/19, the PDT API stopped returning the "custom" value that was passed in. This broke our payment flow.
Not sure if anybody else ran into this issue, and/or if there's a workaround or a configuration to change.
That button URL is for a hosted button, which means all of the parameters are set within PayPal when you create the button. You cannot pass a return value directly to a hosted button. You would need to adjust that in the hosted button itself within the PayPal account.
The only way to set it there would be with the Advanced Variables section, but of course you won't be able to make that dynamic. If this is a problem you're going to need to switch to using a non-hosted button so that you can then pass parameters directly the way you are trying to do.
Beyond that you could switch to using the Express Checkout API, and then you have more freedom and flexibility to do whatever you need during checkout.

Paypal pass-through variable?

I have looked at the paypal documentation and this one.
It seems pass-through variables only have 3:
custom
item_number or item_number_x
invoice
I want to use custom, but it is already used by one of the plugin. (I am using joomla)
Is there any variable that I can use as pass-through variable?
I would recommend saving any data you need to the order (I'm assuming you're using VirtueMart on Joomla..??)
Then you can pass that order ID into the invoice parameter, and then pull data back out of the order that you need based on that order ID.
If you're using VirtueMart it would be the same flow. Just save all the data you need to your order/invoice record, then pull it back out when you need it based on the invoice value PayPal has.

How to add notify me functionality on pdp page in demandware

Hello I am new to demandware just worked on few POC's and I need to create a notify button on pdp page if a product is out of stock then on clicking this button a pop up window will open which will ask for email id that should be saved in a custom object and the user should be alerted when the product comes in stock via email that has been saved in custom object
Generally you should rely on a third party system (usually the OMS or some other back-end system) to store and send notifications. The mechanism I've seen used most often to achieve this is to record the product ID, customer email address, and timestamp into a Custom Object. Periodically these Custom Objects should be exported to the third party system via a job and then deleted from the Demandware system. Deletion is important because of system quotas limiting the total number of Custom Objects than can be stored.
The third party system would periodically look at the the products that have been 'subscribed' to, if they have inventory, then email the people who wanted to be notified.
What you can do is create a simple button on PDP upon clicking which, a popup box is shown which contains a form with hidden pid field and a text box for entering user's email, and a submit button to submit this information.
Use jQuery and AJAX to get the form data (pid & email), pass this on to Controller, store the data into custom object, get the response back from the Controller, and show the response back on the popup or in any other way you feel fit.
You'd need to create custom object to store this data, wherein your unique key would be combination of email and pid (encryption recommended).

How to generate unique payment URL using Paypal?

I'm trying to work out how I can generate a unique payment token that I can redirect users to so they can pay for a digital item.
I think the Button Manager SDK is what I need. However, I can not see how I can set the receiver email? For a particular item, there is a different receiver and I want to dynamically set this.
However, it seems I just have to set my credentials as the receiver. I want to use many receivers for different items rather than one sdk config file.
What I currently use is simply a HTML Paypal button but I'd rather dynamically create a unique URL to redirect a user to stop users tampering with things.
Have you considered the Express Checkout API? -- (perhaps with SOLUTIONTYPE=Sole to allow guest checkout?)
I believe it's a better tool for this job; token redirection is a core feature of EC.