I'm currently implementing PayPal Plus inside a custom TYPO3 extension. Everything works fine, but I'm wondering which payment states PayPal could possibly return.
As of now, when a payment went though, I get the state "approved" and handle my code accordingly, as I figure the payment went just fine. The PayPal docs are such a mystery and they are all over the place and I don't really know where to look at and every time I work with their API it feels like the first time.
This is the part where I'm currently not sure about:
$pay = $this->payPalService->executePayment(paymentId, $payerId, $json->access_token);
if ($pay->state == 'approved') {
$this->orderService->update($paymentId);
$this->redirect('paymentSuccessful', 'Order');
}
The essential part I'm talking about is $pay->state == 'approved'
. Can I assume that approved means I can safely handle the order and treat it as successfully paid? The official PayPal Plus docs don't mention that.