2.0.5 • Published 1 year ago
ka-receipt v2.0.5
Getting Started with this package
code example for use
//import the component
import {KaReceipt} from 'ka-receipt';
function App(props) {
const {
data, userAddress,userShippingAddress,merchantUrlData,merchantData,cartProductsReducer,
cartItemId,selectedShippingOptions
} = props;
const continueShopping = (val) => {
//if val is true redirect to product page.
console.log('val',val)
}
return (
<div className="App">
{/* use the component as below with the response funciton */}
<KaReceipt
data = {data}
userAddress = {userAddress}
userAddress = {userShippingAddress && userShippingAddress.addressLine1 ? userShippingAddress : userAddress}
checkoutData = {merchantUrlData}
pixelId={merchantData.pixelId} //Pixel Integration
merchantUrlData={merchantUrlData} //required for shopify only
merchantData={merchantData} //required for shopify only
cartProductsReducer={cartProductsReducer} //required for shopify only
cartItemId={cartItemId} //required for shopify only
selectedShippingOptions={selectedShippingOptions} //required for shopify only
continueShopping = {continueShopping}
/>
</div>
);
}
export default App;
Props
Common props you may want to specify include:
data
- order details ("urlOrderID", "urlOrderNo", "transactionID", "shipping", "tax", "total").useraddress
- User Billing Address ("addressLine1", "cityName", "countryId", "countryName", "countryCode","stateId", "stateName", "stateCode", "postalCode")userShippingAddress
- same as Billing Address.