You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 8, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ This repository contains a polyfill for [Apple Pay JS](https://developer.apple.c
8
8
9
9
Apple Pay JS is a way of accepting Apple Pay in websites using Safari in either iOS 10 (and later) and macOS for users who have a TouchID compatible device.
10
10
11
-
This polyfill provides a way to make [```ApplePaySession```](https://developer.apple.com/reference/applepayjs/applepaysession) available for testing your implementation in browsers that would otherwise not provide support for Apple Pay JS, such as in Chrome on Windows.
11
+
This polyfill provides a way to make [`ApplePaySession`](https://developer.apple.com/reference/applepayjs/applepaysession) available for testing your implementation in browsers that would otherwise not provide support for Apple Pay JS, such as in Chrome on Windows.
12
12
13
-
The polyfill supports the Apple Pay JS API for versions 1 to 6. The Payment Request API is not supported.
13
+
The polyfill supports the Apple Pay JS API for versions 1 to 10. The Payment Request API is not supported.
14
14
15
15
## Examples
16
16
@@ -26,7 +26,7 @@ Then reference it in your HTML (don't forget to remove it in production environm
Next, configure the callbacks on the ```ApplePaySessionPolyfill``` object to return the values you want:
29
+
Next, configure the callbacks on the `ApplePaySessionPolyfill` object to return the values you want:
30
30
31
31
```js
32
32
// Set the merchant identifier to drive ApplePaySession.canMakePaymentsWithActiveCard()
@@ -57,7 +57,7 @@ ApplePaySessionPolyfill.createPaymentToken = function (session) {
57
57
};
58
58
```
59
59
60
-
Now you should be able to test your implementation of [```ApplePaySession```](https://developer.apple.com/reference/applepayjs/applepaysession) in an HTML page in a browser that does not already provide the object in ```window```. For example:
60
+
Now you should be able to test your implementation of [`ApplePaySession`](https://developer.apple.com/reference/applepayjs/applepaysession) in an HTML page in a browser that does not already provide the object in `window`. For example:
61
61
62
62
```js
63
63
if ("ApplePaySession"inwindow&&ApplePaySession.canMakePayments() ===true) {
@@ -79,7 +79,7 @@ if ("ApplePaySession" in window && ApplePaySession.canMakePayments() === true) {
79
79
}
80
80
};
81
81
82
-
var session =newApplePaySession(6, paymentRequest);
82
+
var session =newApplePaySession(10, paymentRequest);
83
83
84
84
session.onvalidatemerchant=function (event) {
85
85
/* Merchant validation implementation */
@@ -97,15 +97,15 @@ if ("ApplePaySession" in window && ApplePaySession.canMakePayments() === true) {
97
97
98
98
### Apple Pay Set Up
99
99
100
-
If you need to test displaying the "Set Up Apple Pay" button, use the ```setUserSetupStatus(bool)``` function, as shown below, to specify that the user has not yet set up Apple Pay on the device.
100
+
If you need to test displaying the "Set Up Apple Pay" button, use the `setUserSetupStatus(bool)` function, as shown below, to specify that the user has not yet set up Apple Pay on the device.
By default this value is set to ```true``` so that Apple Pay is available in the polyfill.
106
+
By default this value is set to `true` so that Apple Pay is available in the polyfill.
107
107
108
-
If you need to test compatibility with devices that do not support Apple Pay set up, then delete the function from ```ApplePaySession``` before your implementation code is loaded:
108
+
If you need to test compatibility with devices that do not support Apple Pay set up, then delete the function from `ApplePaySession` before your implementation code is loaded:
0 commit comments