From 7624a438b6fe766074bd162cb9bf525ab4877732 Mon Sep 17 00:00:00 2001
From: "adam.harbas@a-net.ba"
Date: Fri, 8 Jan 2016 10:21:33 +0100
Subject: [PATCH] Last used button added
---
front-ui/app/components/cart/checkoutPage.js | 31 +++++++++++++------
.../app/components/payment/paypalButton.js | 4 +--
front-ui/app/models/deliveryDestination.js | 4 +--
3 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/front-ui/app/components/cart/checkoutPage.js b/front-ui/app/components/cart/checkoutPage.js
index b4a00d0..5198444 100644
--- a/front-ui/app/components/cart/checkoutPage.js
+++ b/front-ui/app/components/cart/checkoutPage.js
@@ -8,25 +8,33 @@ var React = require('react'),
CartTotal = require('./cartTotal'),
LinkBanner = require('../linkBanner/linkBanner'),
PaymentSelect = require('../payment/paymentSelect'),
- RibicaFormError = require('../shared/ribicaFormError');
+ RibicaFormError = require('../shared/ribicaFormError'),
+ PaypalButton = require('../payment/paypalButton');
var Router = require('react-router');
var CheckoutPage = React.createClass({
-
render: function() {
-
var choosePayment = (
);
- var last_used_payment = (
-
- );
+ var last_used_payment;
+ if(this.state.deliveryDestination.get('payment_method') == 'paypal' || true) {
+ last_used_payment = (
+
+ );
+ } else if(this.state.deliveryDestination.get('payment_method') == 'pikpay') {
+
+ } else {
+ last_used_payment = (
+
+ );
+ }
var supportedPlaceOptions = CartStore.getSupportedPlaces().map ( function (p) { return ()});
@@ -129,9 +137,7 @@ var CheckoutPage = React.createClass({
Ukupno:
-
- {last_used_payment} ili
-
+ {last_used_payment}
ili
@@ -175,6 +181,11 @@ var CheckoutPage = React.createClass({
CartActions.setAddressColapsed(false);
},
+ _handleOnSubmitPaypal: function(event) {
+ CartActions.changeDeliveryDestinationProperty('payment_method', 'paypal');
+ return false;
+ },
+
getInitialState: function () {
return CartStore.getWholeCartState();
}
diff --git a/front-ui/app/components/payment/paypalButton.js b/front-ui/app/components/payment/paypalButton.js
index 3c30630..5d40447 100644
--- a/front-ui/app/components/payment/paypalButton.js
+++ b/front-ui/app/components/payment/paypalButton.js
@@ -17,8 +17,8 @@ var PaypalButton = React.createClass({
var cancel_return_url = root + "/odgodjeno";
return (
-