Apple pay demo web

Sandbox Testing

The sandbox environment is a great way to test offline implementation of Apple Pay for apps, websites, and point of sale systems. This document provides an overview of the sandbox environment, details on how to get started, and general support to test your Apple Pay transactions.

Sandbox

The Apple Pay sandbox environment allows merchants and developers to test their implementation of Apple Pay with test credit and debit cards. Currently the sandbox supports Apple Pay testing for:

  • Australia
  • Canada
  • China mainland
  • Hong Kong
  • Taiwan
  • France
  • Ireland
  • Italy
  • Japan
  • New Zealand
  • Russia
  • Singapore
  • Spain
  • United Kingdom
  • United States

Note: It is also important to test Apple Pay in your production environment. Real cards must be used in the production environment. Test cards will not work.

Getting Started

You’ll need the following to test Apple Pay in the sandbox:

  • iPhone 6 or later, iPad mini 3 or later, iPad Air 2, iPad Pro, or Apple Watch
  • App Store Connect sandbox tester account
  • Supported test credentials

Developer Account and Website

To successfully establish an Apple Pay session with Apple Pay servers, your Apple Developer account needs to be configured for Apple Pay. This includes registering a merchant ID, creating certificates, and verifying your website domain if you plan to implement Apple Pay for the web. Make sure to complete the steps below before testing your Apple Pay implementation with Apple Pay servers.
Learn more about configuring your environment

  • Register a Merchant ID in your developer account.
  • Create your Payment Processing Certificate or obtained a CSR from your PSP.
  • Create your Merchant Identity Certificate (Apple Pay for web only).
  • Register and verify a Merchant Domain (Apple Pay for web only).
  • Verify that all webpages hosting an Apple Pay button are HTTPS and your web server supports TLS 1.2.

Create a Sandbox Tester Account

To create a sandbox tester account, follow these steps:

  1. Sign in to App Store Connect.
  2. On the homepage, click Users and Access.
  3. Under Sandbox, click Testers.
  4. Click “+” to set up your tester accounts.
  5. Complete the tester information form and click Invite.
  6. Sign out of your Apple ID on all testing devices and sign back in with your new sandbox tester account.

For more information on how to create a sandbox tester account, see App Store Connect Help: Create a sandbox tester account.

Important: If you mistakenly use a sandbox tester account to sign in to a production environment, like iTunes, on your test device instead of your test environment, the sandbox account becomes invalid and can’t be used again. If this happens, create a new sandbox tester account with a new email address.

Adding a Test Card Number

To get started, add a test card to Wallet:

  1. Make sure to sign out of iCloud and sign into your test device with your sandbox tester account.
  2. Go to Wallet and tap Add Credit or Debit Card.
  3. Using your test credential, follow the steps to add a new card using manual entry.
  4. After your card has been added, you may begin testing.

Note: To provision test cards on your device and use the sandbox, you will need to make sure that your device’s region is set to a country or region that supports Apple Pay.

Testing Apple Pay on Your Apps and Websites

With your iPhone, iPad, or Apple Watch, you can use the Apple Pay sandbox to pay within your app and website. The Apple Pay sandbox environment allows merchants and developers to test Apple Pay before or after implementation. Developers don’t have to use their personal production cards for testing. Merchants or your PSP can test whether they’re able to decrypt the transaction-specific payment load.

Note: Your sandbox test transaction will decline pre-fulfillment as the test key will not match your production key.

Test Cards for Apps and the Web

Test card numbers (FPAN, CVV, CVC, Expiration Date) from the payment networks are listed below and can be used on supported devices to test within the Apple Pay sandbox environment.

Note:

  • FPAN and DPAN expiration dates do not need to match.
  • American Express test cards can only support device regions that are set to the United States.
Читайте также:  Как найти утерянный айфон по imei

Test Cards for Apps and Websites in China Mainland

Test card details (FPAN, CVV, Expiry, OTP) for China UnionPay cards are listed below and can be used on supported devices to test your Apple Pay implementation.

Note:

  • China UnionPay test cards can only support device regions that are set to China mainland.
  • You will be prompted to enter a One Time Password (OTP) during provisioning. You should enter the value 123456.
  • China UnionPay test debit cards do not require CVV or expiry date.
  • China UnionPay test cards may require a PIN when making an Apple Pay test transaction. The PIN is 939393.
  • In China mainland, Apple Pay for websites is available only on Safari on iOS devices that are compatible with Apple Pay and running iOS 11.2 or later.

Test Cards for Point of Sale Systems

Retailers can use the sandbox to do simple terminal offline tests to make sure Apple Pay transactions are working in their PoS terminals before they enable NFC functionality.

Test card numbers (FPAN, CVV, CVC, Expiration Date) from the payment networks are listed below so you can test within the Apple Pay sandbox environment.

Note: This does not replace Payment Network contactless certification. These FPANs can only be used for terminal offline beep tests using Apple Pay after completing Payment Network certification.

Network FPANs MagStripe Contactless EMV Contactless
Amex 3499 562866 52212
Exp Date: 11/2022
CID: 1111
3499 567268 99159
Exp Date: 11/2022
CID: 1111
Discover 6011 0009 9606 5037
Exp Date: 11/2022
CID: 111
6011 0009 9631 8741
Exp Date: 11/2022
CID: 111
MasterCard 5204 2477 5000 1471
Exp Date: 11/2022
CVC: 111
5204 2452 5000 1488
Exp Date: 11/2022
CVC: 111

Feedback and Questions

Have feedback? Send it to Apple Pay Support. Have additional questions? Join the conversation. Post questions and search for answers at Apple Developer Forums.

Design guidelines

Learn how to optimize the design and checkout experience for Apple Pay.

Payment service providers

Support Apple Pay quickly and reliably with an SDK or API from a payment service provider (PSP).

View payment service providers

Contact us

Have a question or request? We can help by phone or email.

Источник

Apple pay demo web

Apple Pay is a secure, easy way to make payments for physical goods and services — as well as donations and subscriptions — in apps running on iPhone, iPad, Mac, and Apple Watch, and on websites. People authorize payments and provide shipping and contact information, using credentials that are securely stored on the device.

TIP It’s important to understand the difference between Apple Pay and In-App Purchase. Use Apple Pay in your app to sell physical goods like groceries, clothing, and appliances; for services such as club memberships, hotel reservations, and tickets for events; and for donations. Use In-App Purchase in your app to sell virtual goods, such as premium content for your app, and subscriptions for digital content.

Apple Pay in Apps

Apps that accept Apple Pay display an Apple Pay mark wherever available payment options are shown and an Apple Pay button that people tap to bring up a payment sheet. During checkout, the payment sheet can show the credit or debit card linked to Apple Pay, purchase amount (including tax and fees), shipping options, and contact information. People make any necessary adjustments and then authorize payment and complete the purchase.

For developer guidance, see PassKit > Apple Pay.

Apple Pay on the Web

Websites that accept Apple Pay incorporate it into the purchasing flow. An Apple Pay mark should be shown wherever available payment options are shown and an Apple Pay button can be clicked to bring up a payment sheet. During checkout, the payment sheet can show the credit or debit card linked to Apple Pay, purchase amount (including tax and fees), shipping options, and contact information. People make any necessary adjustments, authorize payment, and complete the purchase using securely stored credentials on iPhone, iPad, and Macs that include Touch ID or a Magic Keyboard with Touch ID (for a complete list of supported Macs, see Apple Pay is compatible with these devices). On other Macs, people confirm the purchase with their nearby iPhone or Apple Watch that has Apple Pay enabled.

All websites that offer Apple Pay must include a privacy statement and adhere to the Apple Pay on the Web Acceptable Use Guidelines. For developer guidance, see Apple Pay on the Web. For a hands-on demo of Apple Pay on the web, see Apple Pay on the Web Demo.

Источник

Apple pay demo web

Vantiv Integrated Payments Apple Pay on the Web demo using Node and Heroku

Site adapted from EmporiumWeb

  • iOS 10 device that supports ApplePay (has TouchID or is an Apple Watch)
  • macOS Sierra computer that supports Handoff (mid 2012 or newer, requires Bluetooth LE support)
    • Development can be largely done even with an OS version below Sierra and without Handoff support, though testing on it won’t work.
  • Apple developer account ($99/yr)
  • Heroku account (free)
  • Git, Node and NPM installed
  • Vantiv Integrated Payments Cert account

How to host for free using Heroku

Sign up for Heroku (no credit card needed)

Sign up then install the Heroku CLI.

Next from a terminal run heroku login and login.

Next clone this project to your computer and in your terminal change directories to that folder.

In the lib/config.js file change the vantivIPAuth value from to the value provided by Vantiv IP.

In the public/js/eprotectsupport.js file change line 74 to contain the PaypageId provided by Vantiv IP.

Run heroku create to create a new Heroku app with a random name (that you can change later).

Next let’s do some Apple setup.

Get your Merchant Identity Certificate

Request your Merchant Identity Certificate by logging into your Apple Developer Site and going to your Merchant ID and clicking «Create Certificate» under «Merchant Identity Certificate» and following the instructions. After you have the certificate, follow these instructions to convert it to .PEM format and place it in the certificates folder.

Convert your Merchant Identity Certificate (.CER) to .PEM format

See this link on SO

Ignore all the stuff about push certificates, this works for converting our Merchant Identity Certificate as well.

  1. Import the .cer into Keychain, export both the certificate and private key as a single .p12 format file then run:

.pem -nodes -clcerts «>

  1. Then put the pem file in /certificates named applePayCert.pem

First install all prerequisites by running npm install .

Then run npm run dev and browse to http://localhost:4567/ . You should be able to open the page, but ApplePay won’t work locally.

The app.js will run using HTTP instead of HTTPS because Heroku will automatically serve the page over HTTPS. This also has the nice side benefit that we don’t need the sslKey or sslCert like we would with original EmporiumWeb example (but we still need the applePayCert).

If running locally using npm run dev then the server will spin up on port 4567 otherwise process.env.PORT will be used (which Heroku will have set to 80).

Deploying to Heroku

Now deploy this project to Heroku by running git push heroku master .

You should now be able to hit https:// .herokuapp.com though ApplePay won’t work yet. You can also open the page by running heroku open .

If any changes are made to any files in the lib folder be sure to run npm run build before deploying to Heroku, in order to generate the files in the dist folder (which Heroku will run).

Validate your domain

Next, follow the instructions here to validate your merchant domain. Apple will provide a file with which to perform the validation.

Place the file in the .well-known folder, commit the file with

then deploy to Heroku again with git push heroku master . Then return to your Apple Developer page and complete verification.

Finally, with all that done you can hit https:// .herokuapp.com and perform an ApplePay transaction in two ways:

  • From Safari on an iOS 10 device with ApplePay support
  • From Safari on a Mac running macOS Sierra that supports Handoff (2012 and later hardware)

After completing a transaction you should see, first, a RegistrationId appear, followed by the results of the transaction to Vantiv IP.

About

Shows how to integrate with Vantiv Integrated Payments using ApplePay on the Web

Источник

Apple pay demo web

Apple Pay Web Sample App

This small Spring Boot App demonstrates a basic Apple Pay Web integration with Datatrans. Use it as a step by step guide to get started with Apple Pay on the web.

  1. A Datatrans test merchantId and access to the webadmin tool
  2. An apple developer account with an active membership
  3. Java installed on your local dev system
  4. openssl installed on your local dev system
  5. A domain (for example my-shop.com or the one Heroku assigns to you)
  6. An iPhone or MacBook with Touchbar supporting Apple Pay
  7. A credit card from an issuer (bank) supporting Apple Pay
  8. A Heroku account if you want to deploy this sample application
  9. Experience with the ‘Getting Started on Heroku with Java’ Guide

Initial Apple Pay Web setup

  1. Create a new identifier (Merchant ID) at developer.apple.com
  2. Click on the ‘Edit’ button of the newly created Merchant ID
  3. Here you see 3 ‘boxes’

    Payment Processing Certificate

    This is the certificate you need to upload in the Datatrans webadmin tool. But first a CSR needs to be created. For this (also in the webadmin tool), navigate to ‘UPP Administration’ > ‘UPP Security’ > ‘Apple Pay key and certificate’ and click the ‘Download CSR file’ button. Use the downloaded CSR to create a payment processing certificate. Finally, again in the webadmin tool, upload & import the certificate.

    Side note: Once you completed this step you should be ready to perform Apple Pay (not Web) transactions with the Datatrans iOS Mobile Library

    Apple needs to validate your shop domain. Add your fully qualified domain name there and upload the verification file as instructed (or check the ‘Deploy to Heroku’ section if you want to use the domain assigned to you by Heroku). You should get your domain validated pretty easily. You can also do this step later. During the deployment of the app to Heroku, you will be assigned a Domain name. This one can then be used for validation. For example:

    Merchant Identity Certificate

    This is the certificate you need to make a connection from your server to apple to do the merchant validation. Do not re-use the CSR from above here. Instead, create your own:

    Use applepaytls.csr to create your merchant identity certificate on developer.apple.com.

    Convert the downloaded merchant identity certificate to .pem

    And finally create a .p12 file

    Prepare the sample application

    Clone this repo

    Put the apple-pay.p12 file into folder src/main/resources/tls

    Adjust the application.properties in src/main/resources

    ch.datatrans.applepay.merchantIdentifier : The merchant identifier you used to create your merchantId on developer.apple.com

    ch.datatrans.applepay.domainName : The domain you used on developer.apple.com (where you uploaded the verification file) or the Heroku domain name assigned to you (see the ‘Deploy to Heroku’ section).

    ch.datatrans.applepay.displayName : Will be shown on the touchbar during a payment.

    ch.datatrans.merchantId : Your Datatrans merchantId

    ch.datatrans.sign : The sign configured in the webadmin tool. Note: this sample currently only supports security level 1 (=static sign).

    Deploy to Heroku

    Create the application

    Make sure to validate the domain assigned to you by Heroku on developer.apple.com. For this put a folder with the name .well-know to src/main/resources/static and put the apple-developer-merchantid-domain-association file (downloaded from Apple) there.

    Set the $KEYSTORE_PASSWORD config variable used in the Procfile . The value should be the password you used to create the apple-pay.p12 file.

    Push to Heroku and launch the instance

    On your iPhone / MacBook it’s the easiest if you just configure a real Apple Pay enabled credit card. Authorizations with real cards will be declined on the Datatrans test system. So don’t worry, your card will not be charged. In order to get some successful transactions, Datatrans has the following logic in place (only on the test system obviously):

    If a valid Apple Pay token is sent and the amount is

    Adjusting the Apple Pay payment sheet for recurring

    You might have a use case were you want to do some recurring transactions. Therefore it would make sense to adjust the Apple Pay payment sheet accordingly. Unfortunately not every part on the payment sheet can be changed.

    This is a free text label of a line item indicating that this is ‘only’ a registration

    The amount set to 0.00. In general those line items are optional.

    The word ‘PAY’ is static. ‘DATATRANS’ (indicating the merchant name) is again free text.

    To get the ‘AMOUNT PENDING’ text the total item needs to be like:

    As you can see Apple Pay does not allow a total amount of 0.0. Therefore please use an amount > 0.

    ‘Pay with Touch ID’ cannot be changed and is a hardcoded label.

    Please get in touch with us if you want to do recurring payments with Apple Pay. Also please note that on a late 2016 MacBook Pro the Touchbar will show an amount of 0.01. There is currently no way of hiding the amount when using the Touchbar.

    Источник

    Читайте также:  Айфон с другой кнопкой
Оцените статью