что такое sandbox paypal
Внедрение PayPal на сайт, работающий под ASP.NET
Намедни возникла задача внедрения PayPal на коммерческий сайт, работающий под ASP.NET. После детального изучения данного вопроса, выяснилось, что в рунете инфы по нему очень мало. Посему думаю, что будет уместно осветить данный вопрос. Начнем, как всегда, с постановки задачи.
Постановка задачи
Имеем интернет-магазин, на котором пользователь выбирает товар, вводит данные о своей кредитке и оплачивает его через инет. Инфа о кредитке вводится непосредственно на сайте. Транзакция на снятие денег должна проходить через PayPal.
Решение
Шаг 1. Регистрация в PayPal Sandbox
Чтобы иметь возможность тестирования необходимо зарегистрироваться в тестовой среде, которая называется Sandbox. Делается это следующим образом:
1. Заходим на developer.paypal.com там регистрируем новый аккаунт.
2. Логинимся на developer.paypal.com, заходим в закладку Test Accounts и создаем там новый тестовый аккаунт продавца. Во время создания выбираем опцию seller. В поле password будет стоять пароль, необходимый для того чтобы потом залогиниться в SandBox. После создания появится аккаунт с Email’ом типа blabla_1234567890_biz[at]email.com и паролем, который был в поле password. Используя их
3. Логинимся на www.sandbox.paypal.com. После залогинивания необходимо принять Billing Agreement.
Шаг 2. Интеграция в сайт
Подводные камни
1. Тестовая кредитка покупателя:
CreditCardType: Visa
CreditCardNumber: 4197058882575379
VerificationCode: 926
ExpirationDate 2010-10
2. Среда выполнения у нас тестовая, поэтому в качестве параметра Environment используем «sandbox», чтоб включить «реальный» PayPal, надо указать «live», но это надо уточнить в официальной доке.
3. Инфу для MerchantProfile брать в разделе API Credentials на developer.paypal.com
4. Данная обертка использует способ передачи между PayPal сервером и сайтом, которая называется 3-token, есть еще возможность это делать на основе сертификатов, но это мне показалось гиморным, поэтому я не разбирался с этим. RTFM.
5. Если вы получаете ошибку «Security header is not valid », значит неверно указаны параметры для MerchantProfile
6. Если вы получаете ошибку «This transaction cannot be processed due to an invalid merchant configuration», значит не было принято Billing Agreement. Смотри третий пункт раздела «Регистрация в PayPal Sandbox»
Предупреждаю сразу, что обертка не проходила усиленное тестирование и вы как всегда все юзаете на свой страх и риск. Но вроде бы там все должно работать. Если что, пишите сюда paradoxs.mail@gmail.com
Ссылочки
Центр Интеграции, Что такое Sandbox, Качнуть SDK под разные платформы
Оставаться в системе, чтобы оплачивать быстрее
Активируйте автоматический вход в систему PayPal для ускорения процесса оформления покупок. (Не рекомендуется для совместно используемых устройств.) Что это?
Привяжите свой аккаунт Google, чтобы оплачивать покупки быстрее на ваших устройствах
Автоматически входите в систему PayPal для более быстрого оформления заказов без ввода пароля с любого устройства, на котором выполнен вход в ваш аккаунт Google.Что это?
Зачем нужно привязывать свой аккаунт Google?
Привязка вашего аккаунта Google позволяет легко и быстро активировать функцию One Touch при оформлении заказов. Вы всегда можете отключить эту функцию в разделе «Настройки» на сайте PayPal.
Всякий раз, когда вы оформляете заказ с нового устройства и в браузере выполнен вход в ваш аккаунт Google, вы можете автоматически войти в систему PayPal при оформлении заказа, не вводя пароль.
Оставаться в системе, чтобы оплачивать быстрее
Пропускайте ввод пароля, оставаясь в системе на этом устройстве. Для обеспечения безопасности мы можем периодически просить вас войти в систему, в частности в тех случаях, когда вы обновляете личную или финансовую информацию. Мы не рекомендуем использовать функцию One Touch на совместно используемых устройствах. Вы можете отключить ее в своих настройках PayPal в любое время.
Войдите в свой счет PayPal
Вы уже настроили номер вашего мобильного телефона для входа в систему? Введите его ниже. Или нажмите ссылку, чтобы войти с помощью электронного адреса.
Функция One Touch™ от PayPal работает только при совершении оплаты. Войдите в систему с помощью адреса эл. почты.
Войдите в систему, указав адрес электронной почты и пароль.
Возникла проблема с нашей стороны. Войдите в систему, указав адрес электронной почты и пароль.
Откройте приложение PayPal
Откройте приложение PayPal, нажмите «Да» в диалоговом окне, а затем нажмите
Откройте приложение PayPal и нажмите «Да» в диалоговом окне, чтобы войти в систему.
К сожалению, нам не удалось подтвердить, что это вы
Нам не удалось подтвердить вашу личность, так как мы не получили от вас ответа.
К сожалению, нам не удалось подтвердить, что это вы
Выполняется проверка вашей информации.
Выполняется защищенный вход в систему.
Эта операция может занять несколько секунд.
Нам удалось распознать это устройство. Выполняется безопасный вход в систему.
Нам удалось распознать это устройство, поэтому вам не нужно вводить пароль для совершения покупок.
Нам удалось распознать ваше устройство, поэтому вы можете пропустить вход в систему.
Управляйте этой настройкой в вашем профиле.
Выполняется переход в PayPal Checkout для завершения оплаты.
PayPal sandbox
The PayPal sandbox is a self-contained, virtual testing environment that simulates the live PayPal production environment. The sandbox provides a shielded space where you can initiate and watch while your apps process PayPal API requests without touching any live PayPal accounts.
While some PayPal features do not apply to the sandbox, such as closing an account, issuing monthly statements, and storing shipping preferences, the sandbox has the same PayPal API feature set as the live environment.
When you test a transaction through a sandbox account, PayPal creates a mock transaction that behaves exactly like a transaction in the live environment. By using fictitious sandbox accounts with their associated authentication credentials in your PayPal API calls, you can test and debug your apps without referencing any real PayPal users or live PayPal accounts.
The sandbox has these components:
Component | Access through |
---|---|
Sandbox API base URL | https://api-m.sandbox.paypal.com/ |
Sandbox test site | https://www.sandbox.paypal.com/. You use the personal and business credentials you find on the Sandbox > Accounts page in the Developer Dashboard to log into the sandbox as either a buyer (personal) or seller (business). |
Sandbox API URLs
Sandbox test site
Get sandbox test site login
Confirm an action in the sandbox test site
After you complete an action that affects a PayPal account, such as making a purchase using the PayPal balance or creating an invoice, you can confirm that the action completed as you expected by logging into the sandbox test site.
Use the sandbox account email IDs and passwords to log in as either a buyer (personal) or as a merchant (business).
Sandbox accounts
Use sandbox accounts to generate mock transactions to test your app
Overview
The PayPal sandbox supports these account types:
Account type | Represents |
---|---|
Personal | The customer in a transaction. |
Business | The merchant in a transaction. |
To test a typical PayPal transaction, you must use both types of accounts.
When you register as a PayPal developer on the developer site, the PayPal sandbox creates these sandbox accounts:
You can create additional sandbox accounts on the developer site or directly on the sandbox site, https://www.sandbox.paypal.com.
Some PayPal transactions require more than one buyer-and-seller pair. For example, parallel payment calls and Adaptive calls each require two different business accounts but for different reasons. In these cases, you must create additional sandbox business accounts to play the roles of the entities in your transactions.
For information about sandbox account roles, see plan your sandbox accounts.
Create and manage sandbox accounts
Tip: To simplify the creation of multiple accounts, do one of the following:
Create a personal sandbox account
When you create a sandbox account, an email and password are generated. You use the email address to reference the sandbox account in your test API calls. You also use the email and password values to log in to the sandbox accounts page to view and configure the sandbox account.
To create an additional personal sandbox account:
A personal account with default values for balances and other information is created for you. If you need more customization of the test values, click Create Custom Account in the Create Sandbox Account dialog.
Create a business sandbox account
To create an additional business sandbox account:
A business account with default values for balances and other information is created for you. If you need more customization of the test values, click Create Custom Account in the Create Sandbox Account dialog.
Manage sandbox accounts
On the developer site sandbox accounts page, you can:
Change a sandbox account password
To change the account password:
Delete a sandbox account
To delete an account:
Link a sandbox account to your developer account
To link a pre-existing sandbox account to your developer account:
Note: If your sandbox account is already linked to another developer account, you cannot link it to your developer account.
Duplicate a sandbox account
If you have an existing Business or Personal test account, you can clone that account to create a new account of the same type. This can be helpful if you’re trying to model several merchants or customers that have slightly varying properties. By creating multiple sandbox accounts, you can test various payment flows and error scenarios.
After you clone an account, you can edit the PayPal balance, first name, last name, and email address. You must also set a password for the new account, the password is not cloned.
To duplicate a sandbox account:
Note: When you duplicate a sandbox account, the Pro status is disabled by default and any flags that have been set up by your Account Manager are not duplicated to the new account.
Some sandbox accounts have cloning disabled for the following reasons:
PayPal sandbox testing guide
Overview
The PayPal sandbox is a self-contained, virtual testing environment that simulates the live PayPal production environment. The sandbox provides a shielded space where you can initiate and watch while your apps process PayPal API requests without touching any live PayPal accounts.
The PayPal sandbox mirrors the features on the PayPal production servers. While some PayPal features do not apply to the sandbox, such as closing an account, issuing monthly statements, storing shipping preferences, and PayPal Shops support, the sandbox has the same PayPal API feature set as the live environment. You can test your PayPal processes in the sandbox. Processes behave the same in the sandbox environment as they do on production servers.
When you initiate a transaction through a sandbox account, PayPal creates a mock transaction that behaves exactly like a transaction in the live environment. By using fictitious sandbox accounts with their associated authentication credentials in your PayPal API calls, you can test and debug your apps without referencing any real PayPal users or live PayPal accounts.
The sandbox lets you operate your application in a safe environment and provides a way to fine-tune your PayPal routines before you move your product into production.
The PayPal sandbox is made up of these components:
Component | Access through |
---|---|
Sandbox test site | https://www.sandbox.paypal.com/ |
Sandbox > Accounts page | https://developer.paypal.com/developer/accounts |
Just as you track live transactions on the PayPal live site, you track your sandbox transactions on the sandbox test site.
During the test phase, use the sandbox endpoints and your sandbox account details in each PayPal API request that you make. Create and manage your set of sandbox accounts from the sandbox Accounts page. Use the Sandbox test site to review the transactions associated with the calls you make using your sandbox accounts.
Tip: To review the status of the mock transactions associated with a sandbox account, log in to the sandbox test site with the credentials from any of your sandbox accounts.
The testing process
Test your application by creating a sandbox account for each user entity represented in your PayPal transactions. When testing, use the sandbox accounts in place of all the live accounts you will use while processing live transactions.
Tips on creating your PayPal developer account
When you create your developer account, PayPal does a verification check by sending an email to the address you specified. Enable your account by responding to PayPal’s email. If you don’t receive the verification email within a few minutes after signing up, check to see that it hasn’t been blocked or diverted to a spam folder.
Once your account is enabled, access the sandbox functionality by logging in to the PayPal Developer website using your developer account credentials.
When creating your PayPal developer account, consider creating an account that you don’t mind sharing with others on your development team. This way, you can share your sandbox accounts without compromising the security of your personal PayPal account.
Important: When coding your PayPal application, make sure that it behaves in accordance with the PayPal application policies and guidelines.