Set billing details for the InLine Checkout
Overview
Pre-set the billing details for the InLine checkout.
Use case
Add an HTML link or button in your page like the one below.
Create a JavaScript click handler to execute the Inline client desired methods.
Use the
TwoCoInlineCart.products.add({code, quantity, options})method to prepare your catalog product.Call any of the following methods to pre-set the billing details:
TwoCoInlineCart.billing.setName('John Snow'); TwoCoInlineCart.billing.setEmail('john.snow@2checkout.com'); TwoCoInlineCart.billing.setPhone('+33 892 70 12 39'); TwoCoInlineCart.billing.setCountry('FR'); TwoCoInlineCart.billing.setCity('Paris'); TwoCoInlineCart.billing.setState(''); TwoCoInlineCart.billing.setZip('75007'); TwoCoInlineCart.billing.setAddress('Champ de Mars'); TwoCoInlineCart.billing.setAddress2('5 Avenue Anatole');If you want to reset the billing details, call the
TwoCoInlineCart.billing.reset()method.Use the
TwoCoInlineCart.cart.checkout()method to display the cart on your page.
Sample request
HTML
JavaScript
Demo
After setting the billing details for the InLine cart using the above methods, your cart should look like this:
Last updated
Was this helpful?