Reputation: 702
I can't seem to find an instructions for Omnipay\SagePay, and am struggling to complete the purchase when SagePay posts to my notification URL.
Can anyone provide info, or point me to where I can find out what actions and parameters are needed for the notification URL to complete the purchase please?
Upvotes: 0
Views: 1816
Reputation: 1064
Sagepay is tricky because the notification part is done by Sagepay and not by the client, so make sure you give an Internet accessible notification URL (that was my first mistake). Here's some example code (using Laravel) to process a Sagepay payment:
public function postProcess($transactionId)
{
//get the order details from somewhere
$order = $this->order->findByTransaction($transactionId);
$response = $this->gateway->completePurchase(array(
'transactionId' => $order->transaction,
'transactionReference' => $order->reference,
'amount' => $order->total,
'currency' => $order->currency,
))->send();
if ( ! $response->isSuccessful())
{
$response->invalid(URL::to('checkout/problem'));
die();
}
$response->confirm(URL::to('checkout/complete/'.$transactionId));
}
As you can see it's quite a bit different from the other examples as you need to call completePurchase() and then separately send a response to confirm.
Let me know if you need anymore help.
Cheers
Upvotes: 3
Reputation: 520
From here you can either read more about the integration methods or scroll to the bottom of the table to download the Server documents. Our kits are available for you to download.
Are you getting an error message when Sage Pay is trying to reach your NotificationURL? Or, are you getting notification that Sage Pay has contacted you via your NotificationURL but you are not able to redirect the shopper to the RedirectionURL, the landing page to tell the shopper about the status of the transaction?
Few points to check for a 5006 error (Unable to redirect to the vendors website. The vendor failed to provide a RedirectionURL).
Can you provide more information so we can help further?
Upvotes: 1