Created
February 10, 2016 19:37
-
-
Save rsolomakhin/d329fddab88cfcf54835 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!checkoutDetails.finished) | |
checkout.continue().then(finishCheckout); | |
else | |
checkout.finish(...); | |
var checkout = new Checkout(); | |
checkout | |
.onEvent('shippingOptionChange', recalculateLineItems) | |
.show() | |
.then(finishCheckout); | |
// Returns line items with updated price/tax/etc based on the options that the user has selected in checkoutDetails. | |
function recalculateLineItems(checkoutDetails) { | |
... | |
} | |
// Requests the payment from the browser. | |
function finishCheckout(checkoutDetails) { | |
checkout.finish(...); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment