MacOS Safari not showing Apple Pay payment sheet

Hi,


I'm running MacOS Sierra Beta 2 with Safari (Version 10.0, 12602.1.38.2), and when we call session.begin(), the payment sheet is not being displayed. There are no exceptions being thrown, the onvalidatemerchant callback is not being called, and no payment sheet is displayed.


Is anyone else having problems with this?

Answered by skunkworks in 155941022

MacOS Sierra Beta 3 has resolved this issue.

"Payment not completed" is perfectly fine at this point. Apple Pay will only ever go as far as collecting a tokenised credit card from your customer. You then give the token to your third-party payment processor to turn that into money. Payment processors like stripe.com and Braintreepayments.com are working in parallel on their integration with Apple Pay JS

Really?? I was under the impression that we would be getting back customer data (email, name, address) and at least a development token. Is that available someplace else that I am missing??


We definately need that sort of data to be able to build stuff. "Winter is coming". We need to prepare.


Tony

oh, yeah, don't get me wrong. At this stage you could fake a successful payment just to follow through to the conclusion of an applepay transaction. Just wasn't sure if you knew; applepay on its own != cash in the bank.


I've put this github up, which has an end-to-end applepayJS implementation, including a faked success from the payment provider. This will work if:-


  1. you have all the certs/keys/approved site and merchant stuff @ apple
  2. you have an applepay sandbox account and use that with one of the test credit cards apple supply for testing


https://github.com/norfolkmustard/ApplePayJS

Hi,


Thanks for sharing this with us!


In the README you write: "... Merchant (session) certificate from apple (using your own csr & private key)".

I still have the csr I used but private key... Can you please tell me which private key that is?


That is the same private key we need for "...export the combined private-key and cert as a .p12 file", right?


Thanks,


Hugo

I noticed with today's upgrade to Beta 5, a whole lot more stuff is working. I finally have the Mac OSX Safari prompting for setting up cards and now it is calling the payment approval screen on the iPhone. WAY WAY COOL!!!!


So a followup to my earlier question. I still am not getting Payment approved. There must be some way that we can get a sandbox approval so that we can demonstrate the completed transaction as well as to be able to handle the final payment details from the transaction.


Is that possible?


Tony

great.


yeah, you can deff get an approved payment flow in the sandbox. you must be using an icloud sandbox account on the iphone, and you must use one of the test credit cards provided on the sandbox site. ONLY these test credits cards will be approved for payments in the sandbox, and ONLY the sandbox will allow you to get past "Processing payment"

Hi


If you follow the guide on the apple site, where you create 2 x certificates, that shows you how to create the csr using Keychain Access.app on your mac


  1. Go here https://developer.apple.com/account/ios/identifier/merchant
  2. click + to create a merchant ID if you haven't already done so. If you have one already, click it, then click "edit"
  3. on the next screen you have 3 things to do.
    1. create a Payment Processing Certificate (use your 3rd party payment provider's csr for this)
    2. add a Merchant Domain
    3. create an Apple Pay Merchant Identity (which is another certificate).
      1. Click "Create Certificate"
      2. Follow the "Create a CSR file. (Optional)" method then hit "Continue"
      3. You'll see at the top of the next page that the act of using KeychainAccess.app to create a CSR, actually creates a private key and certificate (aka public key) pair. These are both kept in keychainaccess.app on your mac. The public key/cert is also saved to disk when you create it, it's this ***.certSigningRequest file which you'll upload to apple next
      4. Once you upload your public key ( ***.certSigningrequest file), apple will use it to generate your Apple Pay Merchant Identity (certificate) - a file called merchant_id.cer
      5. download this merchant_id.cer file, and double-click it to insert it into keychain access.app. this should automatically get appended to the existing entry for your Private key in keychain access.app
      6. right-click that certificate (probably named "Merchant ID: merchant...." from within keychain access.app (you may need to expand the private key entry to see the certificate under it) and select "Export 'Merchant ID merchant....' ". This will default to exporting a xxxx.p12 file to your desktop.
      7. it's this ***.p12 file which you then use openssl in terminal.app on your mac, to create the two ***.pem files which you upload to your webserver

This is the correct way of doing this.


Just to piggy back on your comment, I am using Spring as my server-side and I can actually just use the .p12 file instead of having to to the .pem conversion.

Great. I've also found that a more recent version of curl lets you use the .p12 file directly too

I am trying to integrate apple pay with my website but since i m not hosting it over https(running on localhost) i used ngrok to host it over https. but i dont have made any sandbox or any itunes connect account.

<script type="text/javascript">

function showApplePayButton()

{

document.getElementsByClassName("apple-pay-button").style.visibility = "visible";

}

document.addEventListener('DOMContentLoaded', () => {

if (window.ApplePaySession) {

if (ApplePaySession.canMakePayments) {

alert("going to show button")

showApplePayButton();

}

}

});

function applePayButtonClicked()

{

alert("apple pay begins")

var request = {

countryCode: 'US',

currencyCode: 'USD',

supportedNetworks: ['visa', 'masterCard'],

merchantCapabilities: ['supports3DS'],

total: { label: 'Your Label', amount: '10.00' },

}

debugger

var session = new ApplePaySession(2, request);

debugger

session.begin();

}

</script>

i am trying this code and no error is coming but payment sheet does not appear. Am i skipping any step here.

MacOS Safari not showing Apple Pay payment sheet
 
 
Q