Sandbox user not working

I'm trying to spin up the Apple Pay Web magic, and I can't seem to get can make payments to return true. I've got my sandbox test account signed in on both my iPad and sierra MBP, with the latest beta on both. On the iPad, I have two different test cards from the documentation in place, and I definitely see sandbox under Wallet and Apple Pay. I went ahead and ran the same code on Safari on the ipad, and I get the same result. Thanks.

if (window.ApplePaySession) { // returns true
  console.log("supports version: " + ApplePaySession.supportsVersion(1)); // returns true
  var merchantIdentifier = 'merchant.blah';
  var promise = ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier);
  promise.then(function (canMakePayments) {
  if (canMakePayments) { // returns false
  $("#applePay").show();
  console.log('hi, I can do ApplePay');
  } else {
  $("#applePay").after('<p>ApplePay is possible on this browser, but not currently activated.</p>');
  console.log('ApplePay is possible on this browser, but not currently activated.'); /
  }
  });
} else {
  console.log('ApplePay not available on this browser');
  $("#applePay").after('ApplePay not available on this browser');
}

You get that if the merchant validation call fails


Are you using my latest code example, in that I've crafted the cURL error into a JSON formatted response so you can see it in the javascript console as you would the successful response


e.g.

http://farm9.static.flickr.com/8557/29019624206_170d4c4fb7_b.jpg

Ok, I was able to get all the way to the paymentsheet asking for my finger print to authorize the charge (i.e. "Pay with Touch ID") and the red fingerprint outline image above that text. Turns out my mistake was assuming that the shipping and payment javascript events were optional. Foolish me, the following events must be wired up and the "completed" events must be fired via javascript or else it will not continue.


session.onshippingmethodselected = function(event) {

session.completeShippingMethodSelection(status, newTotal, newLineItems);

}


session.onpaymentmethodselected = function(event) {

session.completePaymentMethodSelection(newTotal, newLineItems);

}

I should also mention that in the iOS 10 simulator I see that the session.onpaymentauthorized event is called with a payment token json value of


{transactionIdentifier: "Simulated Identifier", paymentMethod: {displayName: "Simulated Instrument"}}


On my iPhone 6S Plus device, I don't yet see the onpaymentauthorized event executing. Still unable to use the iTunes connect sandbox user account on my device. Hmmm..

I figured out how to use the iTunes Sandbox account on my iPhone 6S Plus. Turns out the Apple Wallet is part of the iCloud account, not the "iTunes & App Store". Simply sign out of iCloud personal account and sign back in with the iTunes Sandbox user account. Then one can use the Apple Pay Test Credit card numbers found here:


https://developer.apple.com/support/apple-pay-sandbox/

How did you solve your original problem of canMakePayments always returning false?

Did you ever find out how to do it on your MacBook? I am trying to test on macOS (and improve debugging, development) but I can't get the Wallet/payment options to work at all. I have a related post:


https://forums.developer.apple.com/message/225668#225668

Sandbox user not working
 
 
Q