Hi guys. I just started to use ApplePay on Web.
For now, I have iOS10 with Safari 10 on it, I have MacOS Sierra with latest Safari on it too.
When I try to push my "Apple Pay" button, I can see sheet with my test sandbox user card on it with his fake billing address. Also I see "Processing" status, but I cant go further.. If I go on this website with my device and its Safari, I get same issue.
So I am wondering, what should I do to see "Finger print" button after that "Processing" status?
P.s. The only thing I can imagine it touch is my "fake" validation, may be I have some problems with it?
Can't get "Finger print" after "Processing" status
"headers already sent by..." proves you have something outputing to the browser before that line. Can you check again for anything before <?php on line one of apple_pay_comm.php
in the console log, where you get "json parse error: ... " it should say what caused the error. like "json parse error: unidentified identifier ..." or similar
Oh, I actually caused that headers error when I pasted in your header code. It created a blank line above <?php
After I deleted that blank line, I get no more header error.
However, I still get a JSON parse error.
It says SyntaxError: JSON Parse error: Unable to parse JSON string
I am still wondering if my old JSON 1.2.1 server version is too old?
Rich
Yea! SUCCESS
I found the problem and now have the Pay with Touch ID fingerprint.
The problem was a change I had made in apple_pay_conf.php
at this line
define('PRODUCTION_MERCHANTIDENTIFIER', openssl_x509_parse( file_get_contents( PRODUCTION_CERTIFICATE_PATH ))['subject']['UID'] );
I had changed it to my actual merchant ID because Dreamweaver was complaining that there was a syntax error on that line.
Don't know why Dreamweaver does not like that line but I had changed it to
define('PRODUCTION_MERCHANTIDENTIFIER', 'merchant.com.applepay.MyMerchantID'); // where MyMerchantID is my real merchant ID
But changing it to my real merchant ID is what caused the problem.
OK now.
I got "Test transaction completed, thanks"
At first, it would not complete the transaction until I changed the Country code to US and Currency code to USD
All is well.
Thanks so much for sticking with me through this lengthy process.
UPDATE:
One last strange problem. Everything is working great with my iPhone connected to my MacBook and running Safari on the iPhone.
But when I try to run the test page in Safari on the Mac, it says ApplePay is possible on this browser, but not currently activated.
It seems to be having a problem with this line in the index file
var merchantIdentifier = '<?=PRODUCTION_MERCHANTIDENTIFIER?>';
Works fine on my iPhone in Safari but not on the Mac.
Rich
excellent news. well done (click on "This helped me" below to give me some kudos points 😉 )
So, applepay on your macbook opens a whole new avenue of ways to stop it working 🙂
prerequisites:-
- You must be running the latest beta of macOS Sierra
- You must be logged into the same iCloud account on both your MacBook and your iphone, and that iCloud account should be the sandbox one you created
- anecdotally - through trial and error, I think I've found the macbook needs to support BluetoothLE. I couldn't get it working on an iMac which didn't have it, but I could get it working on a macbookPro which does have BTLE.
- In safari on the macbook, enable applepay in the settings (can't remember exactly where it is - perhaps "Security" ?
- If you meet the above and can't get it working, try enabling keychain syncing in the icloud account on the iphone and macbook
Got it working in Safari on my 2013 MacBook Air 13"
No need to connect a cable either.
Awesome!
The probem was that I was trying to test using a 2011 Mac Mini.
It does support Bluetooth LE but it would not work for some reason.
It would work just fine in Safari on the iPhone and plugged into the Mac Mini.
But would not work in Safari on the Mac Mini.
Thanks again,
Rich
Ossum 🙂
I am guessing it is too early to test this but...
What commands will we use to pass our payment to a third-party payment provider in function sendPaymentToken ?...
function sendPaymentToken(paymentToken) {
return new Promise(function(resolve, reject) {
logit('starting function sendPaymentToken()');
logit(paymentToken);
logit("this is where you would pass the payment token to your third-party payment provider to use the token to charge the card. Only if your provider tells you the payment was successful should you return a resolve(true) here. Otherwise reject;");
logit("defaulting to resolve(true) here, just to show what a successfully completed transaction flow looks like");
if ( debug == true )
resolve(true);
else
reject;
});
}
that's specific to the integration with your chosen payment gateway. I don't know of any which are ready to share their code yet - I know some are working on it.
I also wouldn't be surprised if they try to simplify it more - they're all about the "three lines of code and you're done" school - so they're accessible to a wider customer base, with varying degrees of technical knowledge.
Hi
I managed to get json returned from apple_pay_common.php as starting with {"epochTimestamp bla bla bla but still can't get "Finger print"
Hello @NorfolkMustard
I have followed all the steps, but still I am not getting the Payment complete.
When I click on Pay button, it is going into "onvalidatemerchant" Event and from that it is going to "onpaymentmethodselected" Event, but from there it is not going further.
and on my Iphone it's opening the Payment sheet but I am not getting the "Double click to Pay" and it is showing only processing and after sometime it is showing message like " Payment not completed"
Not getting what can be the issue.