Recharging credit via PayPal
Another way of recharging credit in MyQ is to let users directly buy the credit via PayPal on their accounts on the MyQ Web interface.
A PayPal Business account is required to receive the payments.
The currency used on the PayPal account of the paying users has to match the currency set on the MyQ server. In case someone pays in a different currency, the payment does not go through and stays in the pending transactions of the receiving PayPal account. In order to receive the payment, the administrator
has to approve the transaction on the PayPal account. After this, the credit must be manually recharged on the MyQ server as the information about the payment is not sent to MyQ.
Setting up the PayPal payment option
To set up PayPal as a payment option, you have to create a new App to link your company's PayPal business account with MyQ, and then set up the PayPal payment option on the MyQ Web Interface.
Create a new REST API app in the PayPal Developer environment
Log in to the PayPal Developer environment (https://developer.paypal.com/) with your PayPal Business account's credentials, and then open the Dashboard.
On the Dashboard, under MyApps & Credentials, create a new REST API app. The new app's settings tab opens.
Select Live at the upper-right corner of the tab, and remember (copy) the app's Client ID and Secret. The credentials will be used to connect the account to MyQ.
Set up the PayPal payment option on the MyQ Web Interface
Open the Credit settings tab (MyQ, Settings, Credit).
On the tab, under Payment providers, double-click the PayPal payment provider. The PayPal properties panel opens on the right side of the tab.
The value of the Currency setting corresponds to the currency set on the General settings tab on the MyQ Web Interface.
Type the minimal amount that users will have to pay when they buy credit.
Enter the Client ID of the REST API app into the Client ID text box on the PayPal properties panel and the Secret into the Security key text box below it.
Make sure that the LIVE Mode is selected, and then click Save. (The SANDBOX mode is used only for testing purposes).
Recharging credit via PayPal on the user's account on the MyQ Web Interface
First of all, the user needs to log in to their account on the MyQ Web Interface. To recharge the credit there, the user has to click Recharge credit under Credit. The Recharge credit dialog appears.
![Opening the Recharge Credit dialog box on the MyQ Web UI](../../../__attachments/1262387501/UserUICredit.png?inst-v=f576f6b0-eb9f-4035-8724-3dad44b7106e)
In the dialog box, the user has to select the PayPal payment provider, enter the amount of credit that they want to buy, and then click Recharge Credit.
![Recharging credit via PayPal options](../../../__attachments/1262387501/PayPalRecharge.png?inst-v=f576f6b0-eb9f-4035-8724-3dad44b7106e)
A window with the PayPal payment options opens in the web browser; the rest of the steps correspond to the standard PayPal payment process.
After the payment is successfully sent to MyQ, the Payment successful dialog box appears.
PayPal tries to connect to the MyQ server via the hostname or IP address that is set on the Network settings tab of the MyQ Web Interface. In case a hostname is set on the tab and paying users receive the "This site can’t be reached / XYZ’s server DNS address could not be found. / DNS_ PROBE_FINISHED_NXDOMAIN” message, try to replace the hostname with the IP address of your server.