Reputation: 12712
I am trying to simulate a payment using the paypal rest api. After calling execute I get a response object with the state "approved".
Does anyone know where there is a list of the possible states the api may return?
I presume there are a few others but I can not find the documentation that covers this.
paypal.payment.execute(payment_id, details, function (err, payment) {
if(err){
throw err;
}
if(payment.state === "approved"){
done(err, payment);
}else{
//handle other states
done(err, payment);
}
});;
Upvotes: 7
Views: 4670
Reputation: 20975
UPDATE: My previous answer is obsolete.
Looks like Paypal REST API have undergone some updates, and the state
assigned to the Response
are just 3.
Possible values: created
, approved
, failed
.
Source: Docs: Payments API > Payment > Create payment
According to the REST API Documentation for Create a payment, the state
assigned in the Response
can be any one of the following.
created
approved
failed
canceled
expired
Upvotes: 13