paypal


Why does the PayPal API sandbox environment return different states for create payment?


When creating a payment using the PayPal REST API's Sandbox environment, the response includes a state property of either: created or approved. This is true even with the same request payload, using the same test credit card.
Whereas in the Live environment, the response's state property is consistently approved on success.
The endpoint being used is POST /v1/payments/payment.
Since we're using the PayPal REST API to process credit cards directly, and never sending users to paypal.com, the state property should always return approved or failed per the documentation.
According to PayPal's technical support:
I have consult our senior engineer and below are the justification.
The reason why you are seeing sometime state = created or approved because that is the nature of a sandbox. In Live account, the state result constantly show as approve because it is already validate by the bank. Whereby, in sandbox it is not validate because we are using a fake credit card and that is the reason why we are responding inconsistence result of created or approved. This is to cater the result of both situation from the Live account. This happen since the fake credit card was not been approved in by the bank due to testing purposes. I hope this justify the issue.
In a nutshell: PayPal's Sandbox environment intentionally returns a random value for state, even though the value may not make sense for your app's payment flow.

Related Links

Paypal API - Can we transfer money to multiple accounts in a transaction?
Paypal Button JS plugin : Testing in sandbox
Paypal payment is successufly completed in prestashop however the result message says error
How to create a PayPal developer account for ebay testshop (Germany)
PayPal - OAuth2 API Access?
Auto-Return to Site After Payment
Credit card payment without address line 1, city, and state?
Paypal sandbox redirect to homepage for Safari
I can't pay with Paypal through WooCommerce
Custom Payment IPN notify_url
Do I need IPN for processing preapproved payments?
How do I take 10% fee of paypal trasaction
PayPal Auto Return not working
PayPal ipn notification request not sending
Can Paypal Payments Standard accept a value and pass it along to the webpage users are redirected to after successful payment?
How to enable internet banking payment method for my PayPal sandbox account?

Categories

HOME
sql-server
converter
ibm-watson-cognitive
udp
redis
puzzle
websphere
blockchain
webrtc
google-tag-manager
playframework
phaser-framework
getorgchart
dryioc
store
alfresco-share
aptana
jogl
attask
thumbnails
boolean-expression
google-ima
onsen-ui
csh
iis-10
scalajs-react
dss
pitest
backup-strategies
geo
threshold
declare
equivalence
ical-dotnet
rich-text-editor
automator
ti-basic
spell-checking
barcode-printing
xib
icefaces
slam-algorithm
visible
try-finally
multiple-file-upload
windows-nt
uwp-maps
coordinate-transformation
dac
asp.net-mvc-2
self-hosting
data-import
base32
twython
mdm-zinc
ticket-system
android-search
adcolony
grunt-contrib-concat
mov
alpha-transparency
planetary.js
level
data-generation
lov
arangodb-php
asp.net-mvc-scaffolding
multiple-login
stagefright
vmware-server
argb
mstsc
shortcuts
dynamic-data
sunspot-rails
jpf
userid
visual-web-gui
viewdidload
ubuntu-11.04
hinstance
mysql-error-1045
hashalgorithm
objectbrowser
tcxgrid
printing-web-page
goliath
squeel
open-graph-beta
quick-search
surefire
camtasia
kpi
internals
dirty-data
usergroups

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App