Custom field with deliveryDestination object added to paypal button

This commit is contained in:
adam.harbas@a-net.ba
2016-01-07 08:58:37 +01:00
parent f092719ac7
commit e49b6b93d6
3 changed files with 6 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ var CheckoutPage = React.createClass({
var choosePayment = ( var choosePayment = (
<div className="payment-btn"> <div className="payment-btn">
<PaymentSelect /> <PaymentSelect deliveryDestination={this.state.deliveryDestination} />
</div> </div>
); );

View File

@@ -11,7 +11,7 @@ var PaymentSelect = React.createClass({
render: function() { render: function() {
return ( return (
<div className="payment_select"> <div className="payment_select">
<PaypalButton /> <PaypalButton deliveryDestination={this.props.deliveryDestination} />
</div>); </div>);
} }
}); });

View File

@@ -8,7 +8,9 @@ var Router = require('react-router');
var PaypalButton = React.createClass({ var PaypalButton = React.createClass({
render: function() { render: function() {
return ( var deliveryDestination = JSON.stringify(this.props.deliveryDestination);
return (
<div> <div>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="cmd" value="_xclick" />
@@ -30,6 +32,7 @@ var PaypalButton = React.createClass({
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" /> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" /> <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" />
<input name="notify_url" value="https://ribica.ba/api/payment_confirmation" type="hidden" /> <input name="notify_url" value="https://ribica.ba/api/payment_confirmation" type="hidden" />
<input name="custom" value={deliveryDestination} type="hidden" />
</form> </form>
</div> </div>
); );