Adding Apple Pay to Payment Form

I have a payment form set up in the sandbox with square-php-sdk and v2020-08-26 of the API. Google Pay and credit card payments work, but Apple Pay does not. When using Apple Pay, the cardNonceResponseReceived callback is not called, so I think I may be missing something in the createPaymentRequest. I am using the same code for both Google Pay and Apple Pay in createPaymentRequest, can you tell me if this should work (walletAmt is “1.00”:
createPaymentRequest: function () {
//For membership payment, we don’t need shipping info
return {
requestShippingAddress: false,
requestBillingInfo: false,
currencyCode: “USD”,
countryCode: “US”,
total: {
label: “SBGS Donation”,
amount: walletAmt,
pending: false
},
lineItems: [
{
label: “SBGS Donation”,
amount: walletAmt,
pending: false
}
]
}
},

Hi @gswanson welcome to the forums!

The requests should work for all digital wallets as far as I know. Are you actually seeing the Apple Pay button appear, and is it functional when you click it?

The Apple Pay button appears and when I tap it the payment sheet appears with a prompt to double click the slider button (on my iPhone). As soon as I tap the slider button it disappears and nothing happens.

Strange…would you be able to share your Square application id and try another request shortly after so I can check our logs to see if I can tell what might be happening?

Hi sjosey - the Application Id:
sandbox-sq0idb-F1tqe2EreKyvAG5JEHCdVA

I will do a transaction on my iPhone now. It’s 1:00 PM Pacific.

Hi sjosey - did you have a chance to look at Square’s logs?

Hi @gswanson apologies for the delay here. I did not find anything obvious in the logs. I spoke with some of our Square Payment Form engineers and looking at the URL that is associated with the above id, it loads successfully on laptop (including Apple Pay), but we do not see the payment form loading at all (including the Apple Pay button) on Safari iPhone.

I figured it out, I was using the double-click side button wrong. I was double-tapping the icon, but I was supposed to be double-clicking or double-pressing the button on the side of the phone. It worked fine when I did that.

I’m not sure why you are not seeing the payment form, but I notice that the Apple Pay button does not always fully appear and I need to refresh the page. Maybe that is because I included the Google Pay and Click-to-Pay options on the same page.