Connecting Bubble to the Paypal api: java.lang.nullpointerexception error

Calling the Paypal rest api and get this java.lang.nullpointerexception error:

When initialising the call on Postman - it works fine
Where would this error be? In the body?

Here’s my body:

{
“intent”:“sale”,
“payer”:{
“payment_method”:“credit_card”,
“funding_instruments”:[
{
“credit_card”:{
“number”:“4532325401406798”,
“type”:“visa”,
“expire_month”:11,
“expire_year”:2018,
“cvv2”:“874”,
“first_name”:“Joe”,
“last_name”:“Shopper”,
“billing_address”:{
“line1”:“52 N Main ST”,
“city”:“Johnstown”,
“country_code”:“US”,
“postal_code”:“43210”,
“state”:“OH”
}
}
}
]
},
“transactions”:[
{
“amount”:{
“total”:“7.47”,
“currency”:“USD”,
“details”:{
“subtotal”:“7.41”,
“tax”:“0.03”,
“shipping”:“0.03”
}
},
“description”:“This is the payment transaction description.”
}
]
}

Seems to be a paypal error message from their code, that means the data you’re sending is probably not correct.

Generally speaking, I don’t think using PayPal with the API connector will work because of a lot of server side stuff.

hmmm what data? and if so why would it work on outside of Bubble on Postman?

I managed to call paypal.com/v1/oauth2/token fine

1 Like

I can’t tell, the error is a Java error, and we don’t use Java… Some format for the data may be different as sent by Bubble. Ask Paypal for more info here. Do they have a log?

General note: it is a NOT a good idea to send a credit card number like this, non encrypted. If users get their cards stolen, you’ll be responsible.

1 Like