);
return (
diff --git a/front-ui/app/components/payment/paypalButton.js b/front-ui/app/components/payment/paypalButton.js
index a26c298..cfcc7f9 100644
--- a/front-ui/app/components/payment/paypalButton.js
+++ b/front-ui/app/components/payment/paypalButton.js
@@ -29,7 +29,7 @@ var PaypalButton = React.createClass({
-
+
diff --git a/front-ui/app/components/payment/pikpayButton.js b/front-ui/app/components/payment/pikpayButton.js
index 033ce64..6a6b240 100644
--- a/front-ui/app/components/payment/pikpayButton.js
+++ b/front-ui/app/components/payment/pikpayButton.js
@@ -14,8 +14,8 @@ var PikpayButton = React.createClass({
var total = this.props.amount + this.props.deliveryCost;
total = total * 100;
var order_info = "Info";
- var order_number = "4678678678229";
- var key = "Ribica"
+ var order_number = this.props.cartId;
+ var key = Globals.PikpayKey;
var authenticity_token = Globals.PikpayAuthenticityToken;
var digest = sha1(key + order_number + total + "BAM");
var rebate_digest = sha1(key + order_number + total + total + "BAM");
diff --git a/front-ui/app/globals.js b/front-ui/app/globals.js
index 4d677ae..90d697f 100644
--- a/front-ui/app/globals.js
+++ b/front-ui/app/globals.js
@@ -22,6 +22,7 @@ module.exports = {
PaypalId: "W7GKS2Q9ZGLGY",
PikpayFormUrl: "https://ipgtest.pikpay.ba/form",
PikpayAuthenticityToken: "1bb1eea16bd6492c01262636897c0c2e3291a1ab",
+ PikpayKey: "Ribica",
Slugify: function(text) {
return text.toString().toLowerCase()
diff --git a/front-ui/app/stores/cartStore.js b/front-ui/app/stores/cartStore.js
index 7a5088c..ad22b17 100644
--- a/front-ui/app/stores/cartStore.js
+++ b/front-ui/app/stores/cartStore.js
@@ -10,6 +10,7 @@ var DeliveryDestination = require('../models/deliveryDestination');
var OrderConfirmation = require('../models/orderConfirmation');
var Place = require('../models/place');
var Validation = require('../utils/validation');
+var Cart = require('../models/cart');
var _ = require('underscore');
@@ -25,6 +26,8 @@ var _deliveryCosts = new Place({
postalCode: _deliveryDestination.get('place')
});
+var _cart = new Cart();
+
var _addressColapsed = false;
var supportedPlaces = [{
@@ -2568,29 +2571,31 @@ var nameOfThePlace = function(code) {
}
var loadCart = function() {
- _itemsInCart.fetch({
- success: function() {
- states = {}
- for (var i = 0; i < _itemsInCart.models.length; i++) {
- var itemInCart = _itemsInCart.models[i];
- states[itemInCart.get('item_id')] = itemInCart;
- }
- _itemsForDisplay.fetch({
- success: function() {
- CartActions.dataLoaded();
+ _cart.fetch({success: function() {
+ _itemsInCart.fetch({
+ success: function() {
+ states = {}
+ for (var i = 0; i < _itemsInCart.models.length; i++) {
+ var itemInCart = _itemsInCart.models[i];
+ states[itemInCart.get('item_id')] = itemInCart;
+ }
+ _itemsForDisplay.fetch({
+ success: function() {
+ CartActions.dataLoaded();
- _deliveryDestination.fetch({
- success: function() {
- validateDeliveryDestinationForm();
- collapseAddressIfNeeded();
- fetchPlace();
- CartActions.dataLoaded();
- }
- });
- }
- });
- }
- });
+ _deliveryDestination.fetch({
+ success: function() {
+ validateDeliveryDestinationForm();
+ collapseAddressIfNeeded();
+ fetchPlace();
+ CartActions.dataLoaded();
+ }
+ });
+ }
+ });
+ }
+ });
+ }});
_cartDataLoadCalled = true;
};
@@ -2875,7 +2880,8 @@ var CartStore = _.extend({}, EventEmitter.prototype, {
deliveryCosts: _deliveryCosts,
destinationValid: isDeliveryDestinationValid(),
address_colapsed: _addressColapsed,
- deliveryCostsTarget: getDeliveryCostTarget()
+ deliveryCostsTarget: getDeliveryCostTarget(),
+ cart: _cart
};
return state;
},