Fixing
This commit is contained in:
@@ -2,27 +2,38 @@ 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(this.props.deliveryDestination);
|
||||
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 notifyUrl = Globals.ApiUrl + "/payment/confirmation";
|
||||
var root = location.protocol + '//' + location.host;
|
||||
var return_url = root + "/hvala_paypal";
|
||||
var cancel_return_url = root + "/odgodjeno";
|
||||
var return_url = root + "/hvala";
|
||||
var cancel_return_url = root + "/dostava";
|
||||
|
||||
return (
|
||||
<<<<<<< HEAD
|
||||
<div>
|
||||
<form onSubmit={this.props.onSubmitPaypal} action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
||||
=======
|
||||
<button onClick={this._onPaypalClick} disabled={this.props.disabled} type="button" className="btn mybutton payment-btn">Pay with paypal
|
||||
<form id="paypal_form" className="hidden" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
||||
>>>>>>> 7b2552c31c6f356bd24e3df0def6d3a021f6c138
|
||||
<input type="hidden" name="cmd" value="_xclick" />
|
||||
<input type="hidden" name="business" value={Globals.PaypalId} />
|
||||
<input type="hidden" name="lc" value="BA" />
|
||||
<input type="hidden" name="item_name" value="Item name" />
|
||||
<input type="hidden" name="item_name" value="Item" />
|
||||
<input type="hidden" name="item_number" value="555" />
|
||||
<input type="hidden" name="amount" value={amount} />
|
||||
<input type="hidden" name="currency_code" value="EUR" />
|
||||
@@ -40,8 +51,14 @@ var PaypalButton = React.createClass({
|
||||
<input name="notify_url" value={notifyUrl} type="hidden" />
|
||||
<input name="custom" value={deliveryDestination} type="hidden" />
|
||||
</form>
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
},
|
||||
_onPaypalClick: function(e) {
|
||||
CartActions.changeDeliveryDestinationProperty('payment_method', 'paypal');
|
||||
CartStore.saveDeliveryDestinationAnd(function() {
|
||||
$("#paypal_form").submit();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user