Skip to content

Commit

Permalink
CCAvenue payment gateway updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Development Team committed Mar 30, 2012
1 parent 3c22456 commit 039211c
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions bb-library/Payment/Adapter/Ccavenue.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,38 @@ public function recurrentPayment(Payment_Invoice $invoice)
public function getTransaction($data, Payment_Invoice $invoice)
{
$ipn = $data['post'];

$Order_Id = $ipn['Order_Id'];
$Amount = $ipn['Amount'];
$AuthDesc = $ipn['AuthDesc'];
$Merchant_Id = $ipn['Merchant_Id'];
$Checksum = $ipn['Checksum'];

//@todo
$response = new Payment_Transaction();
$response->setType(Payment_Transaction::TXTYPE_PAYMENT);
$response->setId(uniqid());
$response->setAmount($invoice->getTotalWithTax());
$response->setCurrency($invoice->getCurrency());
$response->setStatus(Payment_Transaction::STATUS_COMPLETE);
return $response;
$tx = new Payment_Transaction();
$tx->setType(Payment_Transaction::TXTYPE_PAYMENT);
$tx->setId($Checksum);
$tx->setAmount($Amount);
$tx->setCurrency($invoice->getCurrency());

if ($AuthDesc == 'Y') {
$tx->setStatus(Payment_Transaction::STATUS_COMPLETE);
}

return $tx;
}

public function isIpnValid($data, Payment_Invoice $invoice)
{
$ipn = $data['post'];
return true;

$WorkingKey = $this->getParam('workingkey');
$Merchant_Id = $ipn['Merchant_Id'];
$Amount = $ipn['Amount'];
$OrderId = $ipn['Order_Id'];
$AuthDesc = $ipn['AuthDesc'];
$CheckSum = $ipn['Checksum'];
$sum = getchecksum($Merchant_Id, $Amount, $OrderId, $AuthDesc, $WorkingKey);
return ($CheckSum == $sum);
}
}

Expand Down

1 comment on commit 039211c

@Harsh223
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to integrate it ??

Please sign in to comment.