Prerequisites
- A PayPal Business account
- A PayPal app with a Client ID created in the PayPal Developer Dashboard
- The PayPal payment method enabled for the target currency in the Doss admin panel
Configuration
Create a PayPal app
In the PayPal Developer Dashboard, create a new REST app under My Apps & Credentials. Note the Client ID for both the Sandbox and Live environments.
Enter credentials in the admin panel
In Doss, navigate to Payment Methods → PayPal. Enter the Client ID (
client_id) for the target currency. This value is stored in the currency_payment_methods.method_data JSON column.Activate PayPal for deposit
Enable the method for the deposit transaction type on each currency where PayPal should be available. The
activated_for field must include deposit.Payment flow
- Confirm page — The user selects an amount and PayPal as the payment method on the deposit confirmation screen.
- PayPal checkout view —
POST /deposit(thestoreaction inDepositController) resolves the currency code and client ID, then rendersuser.deposit.paypal. The PayPal JS SDK is initialised with theclientIdand thetotalAmount(amount + fees) formatted to two decimal places. - User approves in PayPal — The PayPal hosted checkout handles authentication and authorization entirely. On success, PayPal returns a transaction details object with
status: "COMPLETED". - Server-side confirmation — The client posts the PayPal response to the server. The handler (
DepositController@paypalDepositPaymentSuccess) verifies the session, createsDepositandTransactionrecords with statusSuccess, updates the wallet balance, and sends a deposit notification to the admin. - Success view — The user is redirected to
user.deposit.success.
Routes
| Method | Route | Description |
|---|---|---|
GET | /deposit/payment_success | PayPal redirect on approval |
GET | /deposit/paypal-payment/success/{amount} | PayPal deposit confirmation handler |
GET | /deposit/payment/cancel | Cancellation handler — clears session and returns error |
Api\DepositMoneyController@paypalPaymentStore handles the confirmation. It checks that the PayPal response details.status equals COMPLETED before creating records.
Sandbox vs production
PayPal sandbox and live environments use different Client IDs:| Environment | Client ID prefix | Behavior |
|---|---|---|
| Sandbox | Starts with A (sandbox) | Test transactions, no real money |
| Live | Starts with A (live) | Real transactions |
PayPal transactions are captured immediately on user approval. There is no separate authorization-and-capture step in this integration.