var React = require('react'); var ItemActions = require('../../actions/itemActions'); var NavigationActions = require('../../actions/navigationActions'); var NavigationStore = require('../../stores/navigationStore'); var CartStore = require('../../stores/cartStore'); var CartActions = require('../../actions/cartActions'); var Globals = require('../../globals'); var Router = require('react-router'); var PaypalButton = React.createClass({ render: function() { var deliveryDestination = JSON.stringify( { 'anonymous_id_string': this.props.deliveryDestination.get('anonymous_id_string'), 'user_id': this.props.deliveryDestination.get('user_id') }); var amount = Globals.ConvertToEuro(this.props.amount); var deliveryCost = Globals.ConvertToEuro(this.props.deliveryCost); var root = location.protocol + '//' + location.host; var return_url = root + "/hvala"; var cancel_return_url = root + "/dostava"; var notifyUrl = Globals.IsUrlAbsolute(Globals.ApiUrl) ? Globals.ApiUrl : root + Globals.ApiUrl; notifyUrl += "/payment/confirmation"; return ( ); }, _onPaypalClick: function(e) { CartActions.changeDeliveryDestinationProperty('payment_method', 'paypal'); CartStore.saveDeliveryDestinationAnd(function() { $("#paypal_form").submit(); }); } }); module.exports = PaypalButton;