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?

This will get you as far as seeing the format/content of the json returned in the "event" object. From there you can start using it


session.onshippingcontactselected = function(event) {
  console.log('starting session.onshippingcontactselected');
  console.log(event);
}


From the above, I'm getting partial address values returned in a event.shippingContact object, but I stress *partial*. It's currently missing the name (familyName, givenName), street address and truncating the postalCode to the first 4 chars only.


NB though, that when I include

requiredShippingContactFields: ['postalAddress']

in the paymentrequest it's currently (iOS10b4 and iOS10b3) causing the payment sheet to no longer show "Pay with touch id". instead it's hanging on the preceeding "Processing" stage

Hi NorfolkMustard,


If i want to add shipping methods to apple pay sheet please send any sample code .


I am trying like below ,but throwing error like



[Error] TypeMismatchError (DOM Exception 17): The type of an object was incompatible with the expected type of the parameter associated to the object.



shippingMethods:{

label :'123'

}

Thanks NorfolkMustard.


i am trying to add line items like subtotal,discount tax fileds in payment sheet.

If you have any sample code ,please share .

I didn't any sample code/syntax from apple pay document.

I have got that working e.g.


var paymentRequest = {
    currencyCode: 'GBP',
    countryCode: 'GB',
    lineItems: [{label: 'line 1', amount: '15'}, {label: 'Line 2', amount: '6'}],
    total: {
   label: '**TEST**',
   amount: '21'
    },
    supportedNetworks: ['amex', 'masterCard', 'visa' ],
    merchantCapabilities: [ 'supports3DS', 'supportsEMV', 'supportsCredit', 'supportsDebit' ]
  };

Thank you so much for help.

Now its working fine for me.

Also, I just worked out how to get shippingMethod working


each set needs: label, amount, detail, identifier


shippingMethods: [{label: 'Express Shipping', amount: '15', detail: '1-5 days', identifier: 'exp'}, {label: 'Standard Shipping', amount: '6', detail: '5-10 days', identifier: 'std'}],

Thank you so much NorfolkMustard.


Its working fine for me

I sure appreciate the help of those of you posting. As we all know, the documentation is SO thing...


Two issues:

on IOS I am getting to the "Pay with Touch ID" using sample code. When I go to pay it just comes back and says "Payment Not Completed". I see zero ways to troubleshoot this sucker.


Also.. On Beta 4 - Mac OS - Safari I always get

- ApplePay not available on this browser


I see reference to Wallets in Mac OS but I sure dont see a Wallet or PassBook. Someone have some guidance?


Tony

"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

MacOS Safari not showing Apple Pay payment sheet
 
 
Q