Skip to content

Commit

Permalink
get basic transactions working
Browse files Browse the repository at this point in the history
  • Loading branch information
slogsdon committed Sep 17, 2020
1 parent d269836 commit 043a074
Show file tree
Hide file tree
Showing 13 changed files with 789 additions and 1,423 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## TransIT Magento Payment Gateway

This extension allows Magento to use the Heartland Payment Systems Gateway. All card data is tokenized using Heartland's TransIT product.
This extension allows Magento to use the Heartland Payment Systems Gateway. All card data is tokenized using Heartland's single-use tokenization solution.

## Installation

Expand All @@ -22,10 +22,6 @@ Example OpenMage LTS `composer.json`:
}
```

## Usage

Download the contents and extract to the root of your Magento install folder.

## Contributing

1. Fork it
Expand Down
41 changes: 0 additions & 41 deletions app/code/community/Hps/Transit/Block/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,6 @@ protected function _construct()
$this->setTemplate('transit/form.phtml');
}

public function getCca()
{
if (!$this->getConfig('enable_threedsecure')) {
return false;
}

if (null !== $this->cca) {
return $this->cca;
}

$helper = Mage::helper('hps_transit/jwt');
$orderNumber = str_shuffle('abcdefghijklmnopqrstuvwxyz');
$data = array(
'jti' => str_shuffle('abcdefghijklmnopqrstuvwxyz'),
'iat' => time(),
'iss' => $this->getConfig('threedsecure_api_identifier'),
'OrgUnitId' => $this->getConfig('threedsecure_org_unit_id'),
'Payload' => array(
'OrderDetails' => array(
'OrderNumber' => $orderNumber,
// Centinel requires amounts in pennies
'Amount' => 100 * Mage::getSingleton('checkout/cart')
->getQuote()
->getGrandTotal(),
'CurrencyCode' => '840',
),
),
);
error_log(print_r($data, true));
$jwt = $helper::encode(
$this->getConfig('threedsecure_api_key'),
$data
);
$this->cca = array(
'jwt' => $jwt,
'orderNumber' => $orderNumber,
);

return $this->cca;
}

protected function getConfig($key)
{
return Mage::getStoreConfig(sprintf('payment/hps_transit/%s', $key));
Expand Down
Loading

0 comments on commit 043a074

Please sign in to comment.