#Paypal tranfer failed

1 messages · Page 1 of 1 (latest)

cyan quail
#

my whole project working fine but when admin try to send money to freelancer it get failed
this is the issue i am getting in console error

Console Error

## Error Message
PayPal error: {}


    at handlePayPalPayout (src/app/dashboard/admin/page.tsx:155:17)

## Code Frame
  153 |       if (!res.ok) {
  154 |         alert("❌ PayPal transfer failed. Check logs.");
> 155 |         console.error("PayPal error:", data);
      |                 ^
  156 |         setLoading(false);
  157 |         return;
  158 |       }

Next.js version: 15.5.2 (Turbopack)

and this is the format i follow in .env.local file
CLIENT_ID=
CLIENT_SECRET=
PAYPAL_API_BASE=https://api-m.sandbox.paypal.com

PAYPAL_ENV=sandbox

mighty plinthBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

cyan quail
#

here is the admin code

light mica
# cyan quail

@cyan quail I believe it’d because their a mismatch if I’m reading this correct between env and route your missing the PAYPAL_ prefix for client and secret so either remove prefix from route or add it to env

cyan quail
#

before creating this form i tried other possibilities in .env file like changing file name from .env to .env.local

#

like as i said in starting when client want to deposit certain amount it work so let's say if their an issue in .env file it won't submit to admit account

rustic beacon
#

It says "failed to fetch paypal token" so its an internal error of paypal, you need to check your token from their dashboard first

cyan quail
#

now i get the issue

#

it won't allow in india

rustic beacon
#

as i remember razorpay was working in india

cyan quail
rustic beacon
#

its a very common issue, recently i am looking for a payment integration and couldnt find any proper one among many options

#

one doesnt work for X country, one doesnt have proper payment API, one are chasing fraud with fake payments, most of them asking for your detailed company info etc...

rustic beacon
#

so i recommend searching it in depth before buying one solution

rustic beacon
#