@@ -178,6 +178,7 @@ export class EinsteinAPI {
178178 namespace : 'useEinstein.einsteinFetch' ,
179179 additionalProperties : { error : error }
180180 } )
181+ return { }
181182 }
182183
183184 if ( ! response ?. ok ) {
@@ -342,15 +343,16 @@ export class EinsteinAPI {
342343 /**
343344 * Tells the Einstein engine when a user starts the checkout process.
344345 **/
345- async sendBeginCheckout ( basket , args ) {
346+ async sendBeginCheckout ( basket , args = { } ) {
346347 const endpoint = `/activities/${ this . siteId } /beginCheckout`
347348 const method = 'POST'
348349 const products = basket . productItems . map ( ( item ) => this . _constructEinsteinItem ( item ) )
349350 const subTotal = basket . productSubTotal
350351 const body = {
351352 products : products ,
352353 amount : subTotal ,
353- ...args
354+ checkoutType : 'traditional' , // Default to traditional for backward compatibility
355+ ...args // Allow override (e.g., checkoutType: 'one-click')
354356 }
355357
356358 return this . einsteinFetch ( endpoint , method , body )
@@ -360,14 +362,15 @@ export class EinsteinAPI {
360362 * Tells the Einstein engine when a user reaches the given step during checkout.
361363 * https://developer.salesforce.com/docs/commerce/einstein-api/references#einstein-recommendations:Summary
362364 **/
363- async sendCheckoutStep ( stepName , stepNumber , basket , args ) {
365+ async sendCheckoutStep ( stepName , stepNumber , basket , args = { } ) {
364366 const endpoint = `/activities/${ this . siteId } /checkoutStep`
365367 const method = 'POST'
366368 const body = {
367369 stepName,
368370 stepNumber,
369371 basketId : basket . basketId ,
370- ...args
372+ checkoutType : 'traditional' , // Default to traditional for backward compatibility
373+ ...args // Allow override (e.g., checkoutType: 'one-click')
371374 }
372375
373376 return this . einsteinFetch ( endpoint , method , body )
0 commit comments