phppaypalpayum

In Payum How can I check "correctly" the status "pending" in the payment?


In my actual Symfony2 project I use PayumBundle, with Payum 1.3.4, to make payments with paypal_express_checkout factory. I found a behavior that maybe it's ok, but I need to confirm with another person who know about Payum.

It's simply to explain:

  1. It was created an user in Paypal Sandbox to test the payments, and it was activated the Payment Review to force that all the payments stay in "pending" state.

  2. The Prepare stage passed OK, redirected to PayPal.

  3. The payment in PayPal fine too, redirected again to my site to the done stage.

  4. In the done stage occurs the following:

    public function doneAction(Request $request)
    {
        $token = $this->get('payum')->getHttpRequestVerifier()->verify($request);
    
        $gateway = $this->get('payum')->getGateway($token->getGatewayName());
    
        $gateway->execute($status = new GetHumanStatus($token));
    
        /** @var Payment $payment */
        $payment = $status->getFirstModel();
    
        ....
    }

At this point, $status->getValue() is equal to "captured". But in $payment->getDetails() I can see this (chunked for clarity):

details(
    "INVNUM" => "57dc5ce455d5a",
    ...
    "ACK" => "Success",
    ...
    "CHECKOUTSTATUS" => "PaymentActionCompleted"
    ...
    "PAYMENTINFO_0_PAYMENTSTATUS" => "Pending",
    "PAYMENTINFO_0_PENDINGREASON" => "paymentreview",
    ...
)

Payum says the status is Captured, but PayPal (which is ok) says the paymen is "Pending".

So, why Payum status is "captured" and not "pending"? It this right?

How can I check "correctly" the status "pending" in the payment?

I checked the examples in Payum Bundle Sandbox but there is nothing about the pending status.

Thanks in advance.


Solution

  • Check the issue thread in GitHub: https://github.com/Payum/Payum/issues/585

    It is opened at this time, but there I described a shortcut.