Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Last active August 15, 2019 12:21
Show Gist options
  • Save dotherightthing/047a6430ef57e774497e9d4f7ab9254a to your computer and use it in GitHub Desktop.
Save dotherightthing/047a6430ef57e774497e9d4f7ab9254a to your computer and use it in GitHub Desktop.
[Apple Pay] #ios

Apple Pay

Created: 2017.03.29

An Upwork project showed some functionality that presented an Apple Pay button to iOS users.

Apple Pay, which lives inside the Wallet app, keeps all your credit cards, debit cards, store cards, and loyalty cards safe and secure on your iPhone or iPad. With Apple Pay you can use your Visa, Mastercard, American Express card, or Discover Card at any store that accepts tap-to-pay, or in any app that incorporates it. With Wallet, you can also board a plane, scan for your coffee, get into a movie or concert, accumulate loyalty points, and more. All right from your lock screen or with the tap of an icon.

Layout bug involving an Apple Pay button.

Layout bug involving an Apple Pay button.

And check out this CSS! How's that for proprietary?

element.style {
  -webkit-appearance: -apple-pay-button;
  -apple-pay-button-type: buy;
  -apple-pay-button-style: black;
}

Apple​Pay​Session: Choosing a Button Type

You choose the type of Apple Pay button to draw by setting the-apple-pay-button-type property to one of these values:

  • plain: For the Apple Pay button.
  • buy: For the Buy with Apple Pay button.
  • set-up: For the Set up Apple Pay button.
  • donate: For the Donate with Apple Pay button.

Refer to the Apple Pay on the Web Human Interface Guidelines for information on how to use Apple Pay buttons including guidelines for using the donate button.

I didn't bid for the project as BrowserStack does have iOS devices, but I'd need to open up Wallet on the device and add my credit card details. I'd only do that if I had the physical device in my hand.

I tried simply toggling the visibility, in order to reveal the button, but this only displayed an unstyled radio (or very small button):

An unstyled Apple pay button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment