1

After I purchase on my return url I get this success message:

Array ( [TOKEN] => EC-55E14916SE342401J [TIMESTAMP] => 2016-02-12T16:59:00Z [CORRELATIONID] => 5d020c7d4479b [ACK] => Success [VERSION] => 119.0 [BUILD] => 18308778 )

But on the sandbox account still nothing changed...

Here is my code:

$gateway = Omnipay::create('PayPal_Express');

        // Initialise the gateway
        $gateway->initialize(array(
            'username' => 'user',
            'password' => 'pass',
            'signature' => 'sig',
            'testMode' => true, // Or false when you are ready for live transactions
        ));

        // Do an authorisation transaction on the gateway
        $transaction = $gateway->purchase(array(
            'returnUrl' => 'http://client.com/api/return',
            'cancelUrl' => 'http://localhost:8000/cancel',
            'amount' => '10.00',
            'currency' => 'USD',
            'description' => 'This is a test authorize transaction.',
                // 'card'          => $card,
        ));

        $this->response = $transaction->send();
        if ($this->response->isRedirect()) {
            // Yes it's a redirect.  Redirect the customer to this URL:
            $redirectUrl = $this->response->getRedirectUrl();

            return redirect($redirectUrl);
        }

Anyone know what is problem?

Vladimir Djukic
  • 2,042
  • 7
  • 29
  • 60

1 Answers1

0
  1. I recommend you switch from the PayPal Express API to the Paypal REST API. The REST API is newer, better documented, and more complete.
  2. I recommend that you provide a unique return and cancel URL for each transaction. An example of doing this is in the omnipay-paypal docblocks for the REST API. Basically you need to store the transaction data and a transaction ID before you call purchase() and use that ID as part of the returnUrl. Then the code in the returnUrl will know which transaction this is for.
  3. In your returnUrl code you need to call completePurchase() and check the response from that. Before you call completePurchase() your transaction is not complete and no money will have changed hands. You also won't see the transaction on your dashboard.
delatbabel
  • 3,601
  • 24
  • 29