I have successfully integrated PayPal express into my website. Now, I want to use PayPal Pro so users can input their card number on the site. I have my sandbox to accept PayPal Pro payments but the process seems different.
In PayPal Express I use purchase()
to redirect the user to PayPal to make the payment. Once they return I use completePurchase()
to actually take the money from them.
What's the difference in PayPal Pro? Looking at the ProGateway.php
file there is no completePurchase()
method available. Looks like in it's place (compared to ExpressGateway.php
is capture.php
and when I call that it's telling me the The transactionReference parameter is required
. So, not sure if that's what I should be calling
Here is the entire ProGateway.php
file for anyone that may can tell me which methods I use.
public function getDefaultParameters()
{
return array(
'username' => '',
'password' => '',
'signature' => '',
'testMode' => false,
);
}
public function getUsername()
{
return $this->getParameter('username');
}
public function setUsername($value)
{
return $this->setParameter('username', $value);
}
public function getPassword()
{
return $this->getParameter('password');
}
public function setPassword($value)
{
return $this->setParameter('password', $value);
}
public function getSignature()
{
return $this->getParameter('signature');
}
public function setSignature($value)
{
return $this->setParameter('signature', $value);
}
public function authorize(array $parameters = array())
{
return $this->createRequest('\Omnipay\PayPal\Message\ProAuthorizeRequest', $parameters);
}
public function purchase(array $parameters = array())
{
return $this->createRequest('\Omnipay\PayPal\Message\ProPurchaseRequest', $parameters);
}
public function capture(array $parameters = array())
{
return $this->createRequest('\Omnipay\PayPal\Message\CaptureRequest', $parameters);
}
public function refund(array $parameters = array())
{
return $this->createRequest('\Omnipay\PayPal\Message\RefundRequest', $parameters);
}
public function fetchTransaction(array $parameters = array())
{
return $this->createRequest('\Omnipay\PayPal\Message\FetchTransactionRequest', $parameters);
}
} `