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
hi. depends what base folder your webpages are served from. you want them in a folder that apache has no access to.
i.e. what's the /path going to be to the index.php file (assuming you're using my github). That file needs to be accessable to visitors to your site.
if that page is going to be reachable by a url like this www.yoursete.com/index.php then a folder one level up should be fine
if instead it's going to be reached by www.yoursite.com/three/two/one/index.php then store apple_pay_conf.php and the two .pem files 4 folders up (so it's higher than folder /three
yeah?
I don't seem to have a way to install the certificates before the root level.
So, I have installed ApplePay.crt.pem and ApplePay.key.pem at the root level
Then I installed the applepay_includes folder at the root level
Inside of applepay_includes folder I have...
apple_pay_comm.php
apple_pay_conf.php
index.php
I have changed the path in the index.php file like this...
require_once ('/applepay_includes/apple_pay_conf.php');
I still get the same error that says Can't find variable: performValidation
sounds like you're still serving your previous file, I don't think you're reading any of these files in the browser yet.
so, before you started with any of my files, where did you save the web page file you were working on/browsing to, the one that was giving you "Can't find variable: performValidation". where on your server have you saved that?
in that same folder, the folder you know you can already serve https web pages, place a new file, perhaps called "fred.php"
in that file paste these 6 lines. goto the file in your web browser and you should see info about your server.
<p>Hi csw. you should see Array { below this line when viewed with a web browser</p>
<?php
echo "<pre>";
print_r ($_SERVER);
echo "</pre>";
?>
The relevant lines you'll find useful are:
[SCRIPT_URI] =>
[DOCUMENT_ROOT] =>
[SCRIPT_FILENAME] =>
The file you talked about earlier today, the one which is successfully showing you the payment sheet. The index.php file should be in that same folder as that is on your server.
Thanks much. I think the problem is that I need to have index.php deeper into my web site.
I think I can get somewhere now.
I think I am ready to test now.
Where do I get the ApplePay test card?
https://developer.apple.com/support/apple-pay-sandbox/ You'll need a sandbox iTunes connect account too, which you login with as an iCloud account on your iPhone first. Then add a test card. The link above tells all
I created a sandbox user and logged into iCloud on my iPhone with that user account.
Tried to follow these steps but do not know what my test credential is in step 3
Adding a Test Card Number
- Sign in to your test device with your Sandbox Test account.
- Go to Wallet and tap Add Credit or Debit Card.
- Using your test credential, follow the steps to add a new card using manual entry.
- After your card has been added, you may begin testing.
It's badly worded. Just do number one and then add one or more of the test credit cards from the bottom of the apple sandbox webpage I posted above
There is no test credit card at the bottom of the page.
I AM logged in with my sandbox account and it does say SANDBOX where I click to Add Credit or Debit Card in Settings.
But no cards are listed and it rejects any real card number I try to enter.
The sandbox webpage I linked to above has about 50 cards at the bottom of it
Ah, the card numbers are on the web site. Got it
In your readme file you say to connect the iPhone to the Mac and load my test page and select my iPhone from the develop menu.
But my iPhone does not appear in the Develop menu.
Sorry to be such a pain and I really appreciate your help. Nothing is easy
PS: Do I need to connect my iPhone with bluetooth? I tried that and it will not connect whan I am logged into my sandbox account on the iPhone
Rich
😉 On the iPhone. Settings > safari > advanced > web inspector > enable
make sure safari on the iphone is the active app, then, on the connected (with a cable) mac. Safari > develop > {your iPhone}
OK, I can now see the log of my iPhone session while logged into my sandbox account
And I have my sandbox credit card loaded into Wallet.
I load my index.php in Safari on my iPhone and tap the Pay button.
It says Processing
But it does not get beyond that.
When I look at the log in Safari on my Mac, it says
ApplePayValidateMerchantEvent {isTrusted: true, validationURL: "https://apple-pay-gateway-cert.apple.com/paymentservices/startSession", type: "validatemerchant", target: ApplePaySession, currentTarget: ApplePaySession, …}
And when I look at Errors, it says... (note that I have replaced my actual website name with MyWebSite )
Failed to load resource: https://MyWebSite/php/apple_pay_comm.php?u=https://apple-pay-gateway-cert.apple.com/paymentservices/startSessionFailed to load resource: the server responded with a status of 404 (Not Found)
Is this normal with beta 5 or should it be completing the credit card transaction?
Excellent, progress ;) Now just put apple_pay_comm.php in the same folder as index.php , update the reference to it within the xmlhttprequest bit of index.php to be just "/apple_pay_comm.php" And you should get further
Changing the location of apple_pay_comm.php and associated links did not change the symptom.
I wonder if the problem could still be the location of my .pem files
My server does not allow me to put them above the root.
So they are at the root level.
Note that it is not passing performValidation
I get the error, var data = JSON.parse(this.responseText); JSON Parse error: Unrecognized token
Rich