VlocityDCUpdateBillingAddress

VlocityDCUpdateBillingAddress

VlocityDCUpdateBillingAddress is the component update billing and shipping address.

VlocityDCUpdateBillingAddress methods
1. saveBillingDetails - Method to save billing and shipping details to the account.
2. checkValidationErrors() - Method to validate the form input fields.
3. handleBillingAddressChange - Method to save billing address change.
4. handleShippingAddressChange - Method to save shipping address change.
5. handleSameShippingAddress - Method to copy same billing address to shipping address.
6. routeToCheckout - Method to fire event to the parent.
7. saveBillingDetailsGetInput - filling the input payload for the SDK call.
8. saveBillingDetailsPreHook - prehook of SDK call.
9. saveBillingDetailsPostHook - posthook of SDK call.
10. saveBillingDetailsProcessResponse - This function is used to process saveBillingDetails response.
11. handleSaveBillingDetailsFailure - handle SDK failures.
12. saveBillingDetailsPreSDKCalls - function is used to do any changes prior to sdk calls.
13. saveBillingDetailsSDKCall - function is used to do actual sdk calls.
Features
1. Update shipping address.
2. Update Billing address.

Constructor

new VlocityDCUpdateBillingAddress()

Example
Sample Usage -

Include the component in your template by adding <vlocity-dc-update-billing-address> custom tag
   
<vlocity-dc-update-billing-address></vlocity-dc-update-billing-address>

KEY INFO -

 events fired : "vlocity-dc-checkout-success"

 events registered : 
    | Event Name                       | Event source component      | Callback Function    | Description                             |
    |----------------------------------|-----------------------------|----------------------|-----------------------------------------|
    | vlocity-dc-save-billing-address  | vlocity-dc-checkout         | saveBillingDetails() | Event triggered on click on next button |

 Dependency - vlocity-dc-update-billing-address is an independent component and has no dependency on any parent component.

Sample with slots -

<vlocity-dc-update-billing-address>
   <span slot="{slot_name}">
     Custom HTML elements goes here
   </span>
</vlocity-dc-update-billing-address>

List of available slots -

| Slot names            | Dynamic   | Description                   | Impact                    |
|-----------------------|-----------|-------------------------------|---------------------------|
| dc-billing-address    | -         | Wrapper for billing address   | Replaces billing address  |
| dc-shipping-address   | -         | Wrapper for shipping address  | Replaces shipping address |
| dc-title              | -         | Wrapper for header title      | Replaces header title     |

Extends

  • LitElement

Methods

(static) checkValidationErrors()

Method to validate the shipping and billing address forms.

(static) handleBillingAddressChange(Object)

Method to save the billing address.
Parameters:
Name Type Description
Object event

(static) handleSameShippingAddress()

Method to copy billing address to the shipping address.

(static) handleSaveBillingDetailsFailure()

A custom function to be used by customers for handling api failures

(static) handleShippingAddressChange(Object)

Method to save the shipping address.
Parameters:
Name Type Description
Object event

(static) routeToCheckout(Object)

Method to trigger pubsub event to the parent
Parameters:
Name Type Description
Object payload

(async, static) saveBillingDetails()

Method to save the billing 7 shipping address.

(static) saveBillingDetailsGetInput()

Function to fetch the sign in user sdk call inputs

(static) saveBillingDetailsPostHook()

A custom function to be used by customers for customisation, any custom action after fetch offers call can be written here

(static) saveBillingDetailsPreHook()

A custom function to be used by customers for customisation, any custom action prior to fetch offers call can be written here

(static) saveBillingDetailsPreSDKCalls()

This function is used to do any changes prior to sdk calls

(static) saveBillingDetailsProcessResponse(response)

This function is used to process saveBillingDetails response
Parameters:
Name Type Description
response object Response Object from SDK call.

(static) saveBillingDetailsSDKCall()

This function is used to do actual sdk calls