I am stack to finding a filter or any way to find a phone number from string. Actually I get a response in string and there is a phone number too and client want to make link because of smart-phone when user tab on it. it's goes to call directory.
here is client request to do with response.
"Low priority but could we make it so that the phone number is a hyper link so the user can press and it goes to make call.
I.e.
0035312998080
Or
+35312998080"
here is a test response.
Unable to process this booking online it is too close to the party date. To book please phone Fun Fitness - Play Centre on 353 - 1 - 2998080
Why do you need to find it? It's right there...
To make it callable:
555-555-1212
Stolen from How to create hyperlink to call phone number on mobile devices?
Related
I have a Square Account. I also have a web page. On this web page, I'm collecting credit card details (name, number, expiration date, cvv). I want to charge the user an amount against the credit card details they've provided. I thought that Square had an API that allowed this. However, I don't see it. It looks like everything has to be done on the server.
Isn't there a way to securely do this from JavaScript purely on the client-side? It seems riskier to send details over the internet to a server, just to pass that information onto Square.
At this time, I have the following:
var creditCardNumber = '....';
var credidCardHolderName = 'Joe Smith';
var creditCardExpiration = '10/2020';
var creditCardCvv = '...';
var purchaseAmount = 50.50;
Is there a way to charge the purchaseAmount against the user's credit card using JavaScript on the client-side via Square? If so, how?
Thank you
You can't cut your own server out of the equation entirely. That would mean you would never get to know about the order. Money would just appear in your account.
You shouldn't be collecting credit card information though. Look at the Square Documentation for online transactions.
As part of the process, the user is redirected to Square's website where the credit card information is collected. You never need to send the credit card details to your server.
Merchant - Create a POST request: . Package the order information as a JSON message. NOTE: Currently, Square Checkout cannot calculate
shipping costs or taxes dynamically, those totals must be provided in
the POST request as line items in the order.
Add an authorization token to the header.
Merchant - Send the generated POST request to Square Checkout and process the response:
Save the returned checkout ID.
Automatically redirect the customer to the returned Checkout page URL.
Customer - Provide payment details using the Square Checkout UI.
Square Checkout - Process the transaction and sends email confirmation to merchant and customer.
Merchant - Verify the transaction results.
To process the payment you probably need to send some API credentials which wouldn't be safe to show on your frontend. That's why you may need some backend for that.
And of course you would allow customer to change the payment amount, which usually isn't OK.
Square documentation has got few nice diagrams and images showing how their API works and how to understand integrating it, e.g.
Take a look at "Get started" guide on their website, especially how it works.
Unfortunately, I am unable to find the specific documentation you would need to do this. It appears you need to log into the developer portal using your account credentials. If you are unable to find the documentation you need then you should reach out to Square support. That being said, I can give you some basic guidance.
DO NOT store any credit card information in your website. Do not store in javascript variables, send to your sever, or store them in any database. There is specific code Square will have you use that keeps that data secure and ensures it only ever is shared with Square.
Try digging around in the documentation of the product you're trying to use. What you are trying to accomplish should be found in some kind of "Setup" or "Get Started" type documentation that will be prominently displayed.
I'm having some hard times with twilio conference.
I connect from web browser using js client v1.3
conn = Twilio.Device.connect(params);
I want to create a new conference and allow this web user to hangup by pressing * and then add another person on the call by entering 10digits followed by #.
Here is python code that generates Twiml for this connect:
resp.dial(hangupOnStar=True).conference(conf_name, waitUrl='http://twimlets.com/holdmusic?Bucket=com.twilio.music.soft-rock')
resp.say("Please enter 10 digit phone number followed by # to add someone to this call. "
resp.gather(action="example.com/add_participant/", numDigits=10, finishOnKey='#', timeout=30)
Here is a sample Twiml:
<?xml version="1.0" encoding="UTF-8"?><Response><Dial hangupOnStar="true"><Conference waitUrl="http://twimlets.com/holdmusic?Bucket=com.twilio.music.soft-rock">room1</Conference></Dial><Say>Please enter 10 digit phone number followed by # to add someone to this call. Press any key followed by # if you want to be placed back to the call!</Say><Gather action="http://example.com/add_participant/room1/" finishOnKey="#" numDigits="10" timeout="30" /></Response>
After connection is opened, in web browser I try to send dtmf code for * that would execute SAY and GATHER verb.
For this I tried:
1. conn.sendDigits('*');
2. c = Twilio.Device.activeConnection();
c.sendDigits('*');
But I connection does not hangup and thus it does not get me to SAY and GATHER verbs.
Same Twiml works good if I call in from a cell phone and send dtmf code from cell keypad. Users hangs up and SAY + GATHER flow follows as expected.
Also, if there is a second party connected to this conference, and I call sendDigits('*') I can here dtmf code on the other end of the call, it just won't trigger tha hangup.
Is there something about the JS client that I'm missing?
Thank you!
What id need it to do is login in to another websites account and look up prices for items as it applies to that user. this is because the users may have specific contract deals that gives them cheaper prices. id then need to show all of the results side by side and maybe link to the company offereing the price but it wouldn't have to do anymore than that (like buying etc). I am familiar with HTML, CSS and PHP, but please tell me if i need to learn another language, frameworks i can start with etc. thanks.
You will have to check with "another website" about availability of API for finding the information you need.
Generally, if API is available - you will be able to get the profile or account info, to find out a group of the user (if the discounts are provided to the groups, like "beginner" get 5%, "advanced" get 10% rates), or activity (make 500 posts on the forum - get 10%, buy 10000$ worth of products within a year - get 15% discount) and etc. After that you might get another API function to use which will give you the product info and price actual for the user.
If API is not available, you will need to find out what is available.
Worst way in terms of work required for programming and etc - you have to use pure PHP or perhaps some browser imitating library to manually authorize with your users's login and password, store session and browse the "another website". But a question here - will your users provide you with their login and password for "another website"??
At this point it isn't a PHP, Javascript or anything else question. It is a question of how you can get your data.
I have a website that a lot of people view on mobile.
I have link for : Call and SMS and I want to add one for Whatsapp, so a user can click the whatsapp link I create and start a conversation with me.
If this is possible can someone point me in the right direction on how?
below link will open the whatsapp. Here "0123456789" is the contact of the person you want to communicate with.
href="intent://send/0123456789#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">
Check this link out
Launching Your iPhone App Via Custom URL Scheme
and more on the whats up url scheme document
I did a quick mock up and tried it on my iphone with a link like this from a webpage and it opened the app on my iphone.
whatsapp
I could not try to send a message as I don't have a current Whatsapp account sorry.
Add user name using abid parameter
let's say your whatsapp username was username then it would be
whatsapp
once again sorry I can't test this. Also I have no idea what would happen if the username is the actual user of the current mobile device. eg. You try to whatsapp yourself.
Here is the solution to your problem! You just need to use this format:
In the place of "urlencodedtext" you need to keep the content in Url-encode format.
UPDATE-- Use this from now(Nov-2018)
Use: https://wa.me/15551234567
Don't use: https://wa.me/+001-(555)1234567
To create your own link with a pre-filled message that will
automatically appear in the text field of a chat, use
https://wa.me/whatsappphonenumber/?text=urlencodedtext where
whatsappphonenumber is a full phone number in international format and
URL-encodedtext is the URL-encoded pre-filled message.
Example:https://wa.me/15551234567?text=I'm%20interested%20in%20your%20car%20for%20sale
To create a link with just a pre-filled message, use
https://wa.me/?text=urlencodedtext
Example:https://wa.me/?text=I'm%20inquiring%20about%20the%20apartment%20listing
After clicking on the link, you will be shown a list of contacts you
can send your message to.
For more information, see https://www.whatsapp.com/faq/en/general/26000030
This is possible by creating the following link:
whatsapp://send?text=Hello this has been opened from the browser&phone=+PHONENUMBER&abid=+PHONENUMBER
Thanks to:
https://forum.ionicframework.com/t/open-whatsapp-intent-with-msg-specific-contact/73903/4
I have tested this on iOS, Windows Phone and Android
I just posted an answer on a thread similiar to this here https://stackoverflow.com/a/43357241/3958617
The approach with:
whatsapp
and with
whatsapp
Only works if the person who clicked on your link have your number on their contact list.
Since not everybody will have it, the other solution is to use Whatsapp API like this:
Send Message
More details on this API here: https://www.whatsapp.com/faq/en/general/26000030
And observations on how to use it here: https://stackoverflow.com/a/43357241/3958617
Use:
https://wa.me/YOURNUMBER
where YOURNUMBER is without the two leading 00.
For instance for +37061204312 you write:
https://wa.me/37061204312
This link seems to work on mobiles and on desktop computers.
To prefill the message with text you can use:
https://wa.me/YOURNUMBER/?text=urlencodedtext
More in the Whatsapp FAQ: https://faq.whatsapp.com/en/android/26000030/
Rahul's answer gives me an error: You seem to be trying to send a WhatsApp message to a phone number that is not registered with WhatsApp..., even though I'm sending it to a registered WhatsApp number.
This, however works:
<li><a href="intent:0123456789#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end"><i class="fa fa-whatsapp"></i>+237 655 421 621</li>
I am thinking of adding a country-specific javascript conditional redirect code right beneath the opening 'head' tags of all the pages in my website. This is intended to redirect visitors from certain countries to a different version of the site. What I am worried about is whether this will cause any problem with the Search Engines or affect my SEO/SERP, e.g. preventing the SE from crawling and/or indexing the current page, etc ?
Secondly, I am not fully sure whether this redirect will really work. Here is the code --
<head>
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var country= geoip_country_code();
if(country == "2_letter_country_code_here")
{
window.location = "http://www.Target_URL_for_Redirection.com";
} else {
window.location = "http://www.URL_of_the_Current_Page.com";
}
</script>
bla..bla...
...
...
</head>
Source: [here][1] [1]: http://www.geekhelpguide.com/javascript/easy-country-based-redirect-in-javascript/
The first line probably pulls data from the Maxmind (maxmind.com) GeoIP database. How reliable is this? Are these databases continuously updated, since I understand IP range of a country is dynamic and changes all the time?
My main and only goal here is to redirect the visitors from certain country/countries (visitors from '2_letter_country_code' above) to another URL, BUT everybody else MUST be able to continue with the CURRENT page without being redirected anywhere else or experiencing any other problem because of this. What do you think?
Will this cause any problems for the Search Engines in any way, or affect the SEO/SERP performance of the 'Current Page' ? If so, what can be done to correct that?
1.
First of all IP ranges are not per country. Companies/Persons buys IP ranges or rents an IP or range from a company owning a range.
What Maxmind tries to achieve is to maps a single IP or range to a geo location.
How they could do this?
Well you can do a whois query for an ip which returns the holder with address, but this would be the most inaccurate mapping, because you don't know where the IP is finally used (One business travel i use the companies VPN so i always have the same IP, to you would not know where i am).
ISP often use a certain IP range for a certain region only. To get this information they either need collaborate with these ISP or with sites that do speed test where users can enter their zip and city.
How accurate is this data?
For ISP for home users it is ok. At least you have a raw guess, and you have a high probability that you know form which country the users is visiting your page (If the user is not using a proxy or vpn).
The accuracy for region of the country depends on the ISPs, because there is no rule that they have to use certain IP ranges for certain regions.
E.g. whit mobile devices there are some ISPs that use their whole mobile IP range for the whole country.
Honestly i don't know what the IP for mobile devices is with roaming. If it is the local IP or the one of my Mobile network operator.
With this being said, you can assume that the match for countries is relatively high, if you target normal internet users. With company networks which have their own IPs you could/would have more wrong mappings.
2.
If you don't want to block users out but redirect them a country based entry page this approach should be ok for you. But always keep in mind that you could o a false assumption. E.g. when i'm traveling and i open well known page where i want to visit the page related to my home country and not the one where i'm currently at, then it would be ok for me if i'm redirected, but i should have the possibility to switch to the correct page.
Thats the same problem as with language. It is ok to guess what the user wants to see, but always make sure that it is easy for the user to correct your assumption.
3.
That depends on how yo do it. Search Engines visit you page without javascript (there are some exception), but generally they follow only plain window.location = .... To be sure you should e.g. use googles Webmastertools to see how google bot sees the given page.
If you do redirect (no matter if this is by header or by javascript) then do it always in a way that it does no show additional content to the search engine that is never visible for the visitor.
But as this depends how you implement the redirect it is not possible to tell if it has a bad impact on SEO. I can just say it is possible to do in a way that you don't have bad impact.