Adding Cart id for order number
This commit is contained in:
@@ -141,5 +141,5 @@ get '/pikpay/confirmation' do
|
|||||||
report_to_trello(cart)
|
report_to_trello(cart)
|
||||||
send_order_email(cart)
|
send_order_email(cart)
|
||||||
|
|
||||||
redirect "#{RibicaConfig.ROOT_ADDRESS}/hvala"
|
redirect "#{RibicaConfig::ROOT_ADDRESS}/hvala"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ var CheckoutPage = React.createClass({
|
|||||||
disabled={!this.state.isDeliveryDestinationValid}
|
disabled={!this.state.isDeliveryDestinationValid}
|
||||||
cashOnDeliveryDisabled={!this.state.isDeliveryDestinationValid || this.state.deliveryDestination.get('gift')}
|
cashOnDeliveryDisabled={!this.state.isDeliveryDestinationValid || this.state.deliveryDestination.get('gift')}
|
||||||
onCashClick={this._onOrderClick}
|
onCashClick={this._onOrderClick}
|
||||||
|
cartId={this.state.cart.get('id')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -33,13 +34,15 @@ var CheckoutPage = React.createClass({
|
|||||||
var last_used_payment;
|
var last_used_payment;
|
||||||
if(this.state.deliveryDestination.get('payment_method') == 'paypal') {
|
if(this.state.deliveryDestination.get('payment_method') == 'paypal') {
|
||||||
last_used_payment = (
|
last_used_payment = (
|
||||||
<PaypalButton disabled={!this.state.isDeliveryDestinationValid} onSubmitPaypal={this._handleOnSubmitPaypal} deliveryDestination={this.state.deliveryDestination} amount={CartStore.getAmount()} deliveryCost={CartStore.getDeliveryCost(false)} />
|
<PaypalButton disabled={!this.state.isDeliveryDestinationValid} onSubmitPaypal={this._handleOnSubmitPaypal} deliveryDestination={this.state.deliveryDestination} amount={CartStore.getAmount()} deliveryCost={CartStore.getDeliveryCost(false)} cartId={this.state.cart.get('id')}/>
|
||||||
);
|
);
|
||||||
} else if(this.state.deliveryDestination.get('payment_method') == 'pikpay') {
|
} else if(this.state.deliveryDestination.get('payment_method') == 'pikpay') {
|
||||||
<PikpayButton amount={CartStore.getAmount()} deliveryCost={CartStore.getDeliveryCost(false)} disabled={!this.state.isDeliveryDestinationValid} deliveryDestination={this.state.deliveryDestination}/>
|
last_used_payment = (
|
||||||
|
<PikpayButton amount={CartStore.getAmount()} deliveryCost={CartStore.getDeliveryCost(false)} disabled={!this.state.isDeliveryDestinationValid} deliveryDestination={this.state.deliveryDestination} cartId={this.state.cart.get('id')}/>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
last_used_payment = (
|
last_used_payment = (
|
||||||
<CashOnDeliveryButton onCashClick={this._onOrderClick} disabled={!this.state.isDeliveryDestinationValid || this.state.deliveryDestination.get('gift')}/>
|
<CashOnDeliveryButton onCashClick={this._onOrderClick} disabled={!this.state.isDeliveryDestinationValid || this.state.deliveryDestination.get('gift')} cartId={this.state.cart.get('id')}/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ var CashOnDeliveryButton = require('./cashOnDeliveryButton');
|
|||||||
|
|
||||||
var PaymentSelect = React.createClass({
|
var PaymentSelect = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
var cashOnDeliveryBtn = ( <CashOnDeliveryButton onCashClick={this.props.onCashClick} disabled={this.props.cashOnDeliveryDisabled}/> );
|
var cashOnDeliveryBtn = ( <CashOnDeliveryButton onCashClick={this.props.onCashClick} disabled={this.props.cashOnDeliveryDisabled} cartId={this.props.cartId}/> );
|
||||||
var pikpayBtn = ( <PikpaylButton amount={this.props.amount} deliveryCost={this.props.deliveryCost} disabled={this.props.disabled} deliveryDestination={this.props.deliveryDestination}/> );
|
var pikpayBtn = ( <PikpaylButton amount={this.props.amount} deliveryCost={this.props.deliveryCost} disabled={this.props.disabled} deliveryDestination={this.props.deliveryDestination} cartId={this.props.cartId}/> );
|
||||||
var paypalBtn = ( <PaypalButton disabled={this.props.disabled} deliveryDestination={this.props.deliveryDestination} amount={this.props.amount} deliveryCost={this.props.deliveryCost} /> );
|
var paypalBtn = ( <PaypalButton disabled={this.props.disabled} deliveryDestination={this.props.deliveryDestination} amount={this.props.amount} deliveryCost={this.props.deliveryCost} cartId={this.props.cartId}/> );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ var PaypalButton = React.createClass({
|
|||||||
<input type="hidden" name="business" value={Globals.PaypalId} />
|
<input type="hidden" name="business" value={Globals.PaypalId} />
|
||||||
<input type="hidden" name="lc" value="BA" />
|
<input type="hidden" name="lc" value="BA" />
|
||||||
<input type="hidden" name="item_name" value="Item" />
|
<input type="hidden" name="item_name" value="Item" />
|
||||||
<input type="hidden" name="item_number" value="555" />
|
<input type="hidden" name="item_number" value={this.props.cartId} />
|
||||||
<input type="hidden" name="amount" value={amount} />
|
<input type="hidden" name="amount" value={amount} />
|
||||||
<input type="hidden" name="currency_code" value="EUR" />
|
<input type="hidden" name="currency_code" value="EUR" />
|
||||||
<input type="hidden" name="button_subtype" value="services" />
|
<input type="hidden" name="button_subtype" value="services" />
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ var PikpayButton = React.createClass({
|
|||||||
var total = this.props.amount + this.props.deliveryCost;
|
var total = this.props.amount + this.props.deliveryCost;
|
||||||
total = total * 100;
|
total = total * 100;
|
||||||
var order_info = "Info";
|
var order_info = "Info";
|
||||||
var order_number = "4678678678229";
|
var order_number = this.props.cartId;
|
||||||
var key = "Ribica"
|
var key = Globals.PikpayKey;
|
||||||
var authenticity_token = Globals.PikpayAuthenticityToken;
|
var authenticity_token = Globals.PikpayAuthenticityToken;
|
||||||
var digest = sha1(key + order_number + total + "BAM");
|
var digest = sha1(key + order_number + total + "BAM");
|
||||||
var rebate_digest = sha1(key + order_number + total + total + "BAM");
|
var rebate_digest = sha1(key + order_number + total + total + "BAM");
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ module.exports = {
|
|||||||
PaypalId: "W7GKS2Q9ZGLGY",
|
PaypalId: "W7GKS2Q9ZGLGY",
|
||||||
PikpayFormUrl: "https://ipgtest.pikpay.ba/form",
|
PikpayFormUrl: "https://ipgtest.pikpay.ba/form",
|
||||||
PikpayAuthenticityToken: "1bb1eea16bd6492c01262636897c0c2e3291a1ab",
|
PikpayAuthenticityToken: "1bb1eea16bd6492c01262636897c0c2e3291a1ab",
|
||||||
|
PikpayKey: "Ribica",
|
||||||
|
|
||||||
Slugify: function(text) {
|
Slugify: function(text) {
|
||||||
return text.toString().toLowerCase()
|
return text.toString().toLowerCase()
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ var DeliveryDestination = require('../models/deliveryDestination');
|
|||||||
var OrderConfirmation = require('../models/orderConfirmation');
|
var OrderConfirmation = require('../models/orderConfirmation');
|
||||||
var Place = require('../models/place');
|
var Place = require('../models/place');
|
||||||
var Validation = require('../utils/validation');
|
var Validation = require('../utils/validation');
|
||||||
|
var Cart = require('../models/cart');
|
||||||
|
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
||||||
@@ -25,6 +26,8 @@ var _deliveryCosts = new Place({
|
|||||||
postalCode: _deliveryDestination.get('place')
|
postalCode: _deliveryDestination.get('place')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var _cart = new Cart();
|
||||||
|
|
||||||
var _addressColapsed = false;
|
var _addressColapsed = false;
|
||||||
|
|
||||||
var supportedPlaces = [{
|
var supportedPlaces = [{
|
||||||
@@ -2568,6 +2571,7 @@ var nameOfThePlace = function(code) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var loadCart = function() {
|
var loadCart = function() {
|
||||||
|
_cart.fetch({success: function() {
|
||||||
_itemsInCart.fetch({
|
_itemsInCart.fetch({
|
||||||
success: function() {
|
success: function() {
|
||||||
states = {}
|
states = {}
|
||||||
@@ -2591,6 +2595,7 @@ var loadCart = function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}});
|
||||||
|
|
||||||
_cartDataLoadCalled = true;
|
_cartDataLoadCalled = true;
|
||||||
};
|
};
|
||||||
@@ -2875,7 +2880,8 @@ var CartStore = _.extend({}, EventEmitter.prototype, {
|
|||||||
deliveryCosts: _deliveryCosts,
|
deliveryCosts: _deliveryCosts,
|
||||||
destinationValid: isDeliveryDestinationValid(),
|
destinationValid: isDeliveryDestinationValid(),
|
||||||
address_colapsed: _addressColapsed,
|
address_colapsed: _addressColapsed,
|
||||||
deliveryCostsTarget: getDeliveryCostTarget()
|
deliveryCostsTarget: getDeliveryCostTarget(),
|
||||||
|
cart: _cart
|
||||||
};
|
};
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user