- Обмен сертификатом Apple Pay Merchant Identity Certificate
- Apple Pay
- 1 Introduction
- 2 Configuration
- 2.1 Creating a Merchant ID
- 2.2 Creating an Apple Pay Payment Processing Certificate
- 2.3 Validating a domain
- 2.4 Creating an Apple Pay Merchant Identity Certificate
- 3 Integration
- 3.1 iOS integration
- 3.2 Web integration
- 4 Order
- 5 Sandbox
- Apple pay merchant identity certificate
- Configuring Your Environment
- Авторизация в Apple Pay для самых маленьких
- Введение
- Краткий обзор
- Обзаводимся сертификатами
- Отправляем запрос
- Примечание
Обмен сертификатом Apple Pay Merchant Identity Certificate
Apple Pay Merchant Identity Certificate — сертификат, который используется для шифрованной передачи платежных данных между серверами Apple Pay и Вашим сайтом. Для того чтобы выполнить обмен сертификатами необходимо:
ЗАМЕЧАНИЕ: Для создания запроса на сертификат, необходимо наличие Mac. Если у Вас нет компьютера с операционной системой MacOS, или Вам необходима любая другая помощь по установке пишите нам на почту apple.pay@epages.su.
- Запустите утилиту Связка ключей (Keychain Access).
- Выберите Связка ключей > Ассистент сертификации > Запросить сертификат в бюро сертификации.
- В диалоговом окне заполните поля E-mail пользователя и Общее имя и в поле Запрос выберите Сохранен на диске и нажмите кнопку Продолжить.
- Сохраните файл .certSigningRequest на компьютер.
Источник
Apple Pay
1 Introduction
Note: The description below concerns making the service available in a mobile app or by running the Apple Pay application directly from the website of the payment recipient (e-store).
2 Configuration
If you do not wish to use Web integration, you may skip the last two steps.
2.1 Creating a Merchant ID
To create a Merchant ID, follow these steps:
- Log on to your Apple Developer account.
- Select Certificates, IDs & Profiles.
- Select Identifiers.
- Add a new Merchant ID by selecting the + sign in the top right of the screen.
- Enter an ID and description, and select Continue.
- Select Register to confirm the data entered.
2.2 Creating an Apple Pay Payment Processing Certificate
Before creating certificate please contact us and ask for CSR file which is required in below process
To create a Payment Processing Certificate identifier, follow these steps:
- Log on to your Apple Developer account.
- Select Certificates, IDs & Profiles.
- Select Identifiers.
- Select the Merchant ID that you have created, and select Edit. You can make your search easier by using the Merchant IDs filter at the top right of the screen.
- In the Apple Pay Payment Processing Certificate section, select Create Certificate.
- On the next screen select Continue.
- Take received CSR file from the PayU IT support department and upload it to the site, selecting Choose File and then Continue.
- Download the generated certificate.
- Send the downloaded certificate (the file apple_pay.cer) to the PayU IT support department.
2.3 Validating a domain
This applies only to web integration.
To validate a domain, follow these steps:
- Log on to your Apple Developer account.
- Select Certificates, IDs & Profiles.
- Select Identifiers.
- Select the Merchant ID that you have created, and select Edit. You can make your search easier by using the Merchant IDs filter at the top right of the screen.
- In the Merchant Domains section, select Add Domain.
- Enter the name of your domain and select Continue.
The domain must support HTTPS. Check if the server settings are in accordance with Apple guidelines.
Download the file only once, before performing domain validation! Repeated download will generate new file content which may result in error in the domain validation process.
2.4 Creating an Apple Pay Merchant Identity Certificate
This applies only to web integration.
To create an Apple Pay Merchant Identity Certificate, follow these steps:
- Log on to your Apple Developer account.
- Select Certificates, IDs & Profiles.
- Select Identifiers.
- Select the Merchant ID that you have created, and select Edit. You can make your search easier by using the Merchant IDs filter at the top right of the screen.
- In the Apple Pay Merchant Identity Certificate section, select Create Certificate.
- In order to prepare the CSR file, follow the steps described on the Apple website, and then select Continue.
- Copy the generated CSR file, by selecting Choose File and then Continue.
- Download the generated certificate (merchant_id.cer) and open it in the Keychain Access application on a Mac computer.
- In Keychain Access, select the imported certificate and export it to .p12 format (Personal Information Exchange).
- (optional) Run the command: If you prefer .p12 format for the certificates and you find it easier to manage them in this format, you can skip this step.
- Copy the created certificate in the prefered format onto the server. It will be needed to create an Apple Pay Payment Session in the store validation process, during payment creation.
3 Integration
3.1 iOS integration
To integrate a mobile app with Apple Pay, follow the instructions at Apple Developer.
To make the integration easier, use the technical documentation for the PayU | Mobile SDK.
3.2 Web integration
To integrate a website with Apple Pay, follow the instructions at Apple Developer.
When creating an Apple Pay Session, note that PayU supports only Visa and MasterCard payment cards under the 3DS protocol, and thus requires correct parameterization of the created Apple Pay request (regardless of whether you are using the Apple Pay JS API or the Payment Request API):
An example Apple Pay Token looks like this:
4 Order
To charge a payment card stored in Apple Pay, you must place an extended payMethods object in an OrderCreateRequest.
The payMethods.payMethod object must contain the authorizationCode field, the value of which is the Apple Pay token parameter encoded using the Base64 function. The field payMethod.value should have the value jp, and payMethod.type should have the value PBL.
Further processing of the request is subject to the standard process described in the REST API documentation.
As the orders paid with the Apple Pay method shall be settled just as standard card payments, it is worth considering the integration of the service transaction data retrieve. In this manner, you will be able to differentiate cards entered through the PayU form from cards downloaded from Apple Pay.
5 Sandbox
The Apple Pay payment method is also available in a sandbox environment. In the integration process, we suggest creating an independent Merchant ID (with a name ending “.test”, for example) together with a set of certificates.
Because Apple Pay is not the default payment method, please contact the PayU IT support department after registering in the sandbox environment, but before beginning integration using the Apple Pay payment method. In response you receive also CSR file for Sandbox environment.
Before beginning to perform tests in the sandbox, please also read the Apple sandbox testing instructions.
Источник
Apple pay merchant identity certificate
Developer
Apple Pay Programming Guide
Configuring Your Environment
A merchant ID identifies you to Apple Pay as being able to accept payments. A Payment Processing certificate that is associated with your merchant ID is used to encrypt payment information. Before your app can use Apple Pay, you need to register a merchant ID and create its Payment Processing certificate.
To register a Merchant ID
Under Identifiers, select Merchant IDs.
Click the Add button (+) in the upper-right corner.
Enter a description and identifier, and click Continue.
Review the settings, and click Register.
To create a Payment Processing certificate
Under Identifiers, select Merchant IDs.
Select the merchant ID from the list, and click Edit.
In the Payment Processing Certificates section, click Create Certificate. Follow the instructions to obtain or generate your certificate signing request (CSR), and click Continue.
Click Choose File, select your CSR, and click Generate.
Download the certificate by clicking Download, and click Done.
If you see a warning in Keychain Access that the certificate was signed by an unknown authority or that it has an invalid issuer, make sure you have the WWDR intermediate certificate — G2 and the Apple Root CA — G2 installed in your keychain. You can download them from apple.com/certificateauthority.
To enable Apple Pay for your app in Xcode, open the Capabilities pane. Select the switch in the Apple Pay row, and then select the merchant IDs you want the app to use.
When troubleshooting, it is sometimes helpful to enable Apple Pay manually. Follow these steps to manually enable Apple Pay:
Under Identifiers, select App IDs.
Select the app ID from the list, and click Edit.
Select Apple Pay, then click Edit.
Select the merchant IDs you want to use, and click Continue.
Источник
Авторизация в Apple Pay для самых маленьких
Внимание будет уделено конкретному моменту — это получения криптограммы со стороны Apple после того как покупатель прошёл TouchID или FaceID. Языком на бэкенде будет PHP.
Меня зовут Александр, я младший PHP-программист компании Moguta, и мне пришлось столкнуться на своем пути с интеграцией Apple Pay в нашу Moguta.CMS. Сегодня я расскажу как авторизовать себя через Apple Pay для проведения оплаты без вникания в матчасть защищенных соединений и сертификатов, так как мне в начале своего пути не хватало такого материала.
Введение
Я не буду расписывать здесь всю простыню по внедрению Apple Pay себе на сайт. Инструкций о том, как зарегистрировать аккаунт разработчика Apple, где сделать Payment Processing сертификат, куда отправить полученный ответ, полно на рунете, достаточно спросить у Гугла «интеграция apple pay на сайт» и выбрать приглянувшийся агрегатор платежей, который подробно распишет вам по шагам все необходимые действия.
Краткий обзор
Минимальным требованием для этой инструкции будет наличие MacOS для работы с ключами, так как работать с сертификатами на других ОС — это уже отдельный материал, которому я здесь уделять внимание не буду.
Давайте сначала сориентируемся где будет место наших боевых действий. Алгоритм следующий:
- Пользователь начинает процесс оплаты через Apple Pay в интернет-магазине;
- Интернет-магазин отправляет сведения о платеже в Apple;
- Apple присылает в ответ ссылку, на которую необходимо отправить данные продавца;
- Интернет-магазин отправляет данные продавца по ссылке через Two-Way TLS;
- Apple присылает данные, содержащие PaymentData;
- Интернет-магазин переадресует PaymentData в платежный шлюз и обрабатывает ответ;
Нас интересует 4ый пункт, так как обычным cURL запросом тут не обойтись.
Обзаводимся сертификатами
Для того, чтобы Apple поверила, что имеет дело лично с нами, сначала нужно завести сертификат Merchant Identify (не путать с Payment Processing, он нужен для платежного шлюза). Для начала сформируем запрос на сертификат по официальной инструкции. Полученный файл прикрепляем в Apple Pay Merchant Identity Certificate вашего Merchant ID.
В ответ получаем merchant_id.cer, который добавляем в связку. Генерируем на основе его закрытого ключа .p12-файл. Для этого вызываем контекстное меню закрытого ключа и выбираем «Экспортировать. «
Вытаскиваем ключ следующей командой (тот пароль, который запросит терминал, будет являться паролем для ключа, он нам понадобиться при соединение с Apple)
и перегоняем наш сертификат в pem
Теперь у нас есть все необходимые файлы, которыми будем доказывать яблочному серверу, что мы те, за кого себя выдаем.
Отправляем запрос
Опускаем момент получения ссылки на валидацию (подробнее читайте в другой статье на Хабре), переходим к тому моменту, когда скрипт на JS в Safari отправил нашему серверу просьбу на авторизацию в Apple.
Для этого мы используем PHP с cURL. Пример кода:
Из полученного ответа выдергиваем paymentData и отправляем нашему платежному шлюзу. Поздравляю, авторизация пройдена, можно грести деньги.
Примечание
Судьба не дала мне долго радоваться налаженному соединению, и Apple отдала мне следующий ответ:
Текст сообщения не достаточно очевиден, как хотелось бы. Информации в сети опять же нету. Как оказалось, скорее всего это означает, что в поле merchantIdentifier вы просто ввели неверное значение.
Буду рад услышать в комментариях предложения, советы или критику.
Надеюсь, что статья принесет пользу таким же заблудшим душам, как и я.
Источник