Skip to content

Commit

Permalink
Add correct prices in basket array
Browse files Browse the repository at this point in the history
  • Loading branch information
RBech committed Aug 28, 2017
1 parent f43fe6b commit e9fe36f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
6 changes: 5 additions & 1 deletion app/code/community/Quickpay/Payment/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,17 @@ public function qpCreatePayment(Mage_Sales_Model_Order $order)
'qty' => (int) $item->getQtyOrdered(),
'item_no' => $item->getSku(),
'item_name' => $item->getName(),
'item_price' => (int) $item->getBasePriceInclTax(),
'item_price' => (int) ($item->getBasePriceInclTax() * 100),
'vat_rate' => $item->getTaxPercent() / 100,
);

$postArray['basket'][] = $product;
}

//Send shipping amount
$postArray['shipping']['method'] = 'pick_up_point';
$postArray['shipping']['amount'] = (int) ($order->getShippingInclTax() * 100);

$storeId = Mage::app()->getStore()->getStoreId();
$this->apiKey = Mage::getStoreConfig('payment/quickpaypayment_payment/apikey', $storeId);
$result = $this->request('payments', $postArray, '');
Expand Down
36 changes: 35 additions & 1 deletion app/code/community/Quickpay/Payment/Model/Method/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,31 @@ abstract class Quickpay_Payment_Model_Method_Abstract extends Mage_Payment_Model
'YUM', 'ZAR', 'ZMK', 'ZWD'
);

/**
* Get checkout session
*
* @return Mage_Checkout_Model_Session
*/
public function getCheckout()
{
return Mage::getSingleton('checkout/session');
}

/**
* Get redirect url
*
* @return string
*/
public function getOrderPlaceRedirectUrl()
{
return Mage::getUrl('quickpaypayment/payment/redirect');
}

/**
* Get active quote
*
* @return Mage_Sales_Model_Quote
*/
public function getQuote()
{
return $this->getCheckout()->getQuote();
Expand All @@ -53,7 +68,11 @@ public function canUseInternal()
return false;
}

/*validate the currency code is avaialable to use for Quickpay or not*/
/**
* Validate if the currency code is avaialable to use for Quickpay or not
*
* @return $this
*/
public function validate()
{
parent::validate();
Expand All @@ -73,6 +92,10 @@ public function validate()
return $this;
}

/**
* @param $lan
* @return mixed
*/
public function calcLanguage($lan)
{
$map_codes = array(
Expand Down Expand Up @@ -136,6 +159,14 @@ public function capture(Varien_Object $payment, $amount)
return $this;
}

/**
* Refund payment
*
* @param Varien_Object $payment
* @param float $amount
*
* @return $this
*/
public function refund(Varien_Object $payment, $amount)
{
try {
Expand Down Expand Up @@ -178,6 +209,9 @@ public function cancel(Varien_Object $payment)
return $this->void($payment);
}

/**
* @return mixed|string
*/
public function getTitle()
{
// Tilføjer max beløb hvis vi er ved at ændre en order.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Når du opretter ordren vil kunden få tilsendt et betalingslink
<p>Når du opretter ordren vil kunden få tilsendt et betalingslink</p>
1 change: 0 additions & 1 deletion app/locale/da_DK/Quickpay_Payment.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"Alle betalingsmetoder","Alle betalingsmetoder"
"Alle kreditkort","Alle kreditkort"
"Vælg specifikke betalingsmetoder","Vælg specifikke betalingsmetoder"

"American Express","American Express"
"American Express (udstedt i Danmark)","American Express (udstedt i Danmark)"
"Dankort","Dankort"
Expand Down

0 comments on commit e9fe36f

Please sign in to comment.