@@ -237,14 +237,14 @@ export async function deleteCart(reference: string) {
237237 await moltin . Cart ( reference ) . Delete ( ) ;
238238}
239239
240- export async function addToCart ( reference : string , productId : string ) : Promise < void > {
241- const moltin = MoltinGateway ( { host : config . endpointURL , client_id : config . clientId } ) ;
240+ export async function addToCart ( reference : string , productId : string , language : string , currency : string ) : Promise < void > {
241+ const moltin = MoltinGateway ( { host : config . endpointURL , client_id : config . clientId , language , currency } ) ;
242242 const quantity = 1 ;
243243 await moltin . Cart ( reference ) . AddProduct ( productId , quantity ) ;
244244}
245245
246- export async function bulkAdd ( reference : string , data : moltin . CartItemObject [ ] ) : Promise < moltin . CartItemsResponse > {
247- const moltin = MoltinGateway ( { host : config . endpointURL , client_id : config . clientId } ) ;
246+ export async function bulkAdd ( reference : string , data : moltin . CartItemObject [ ] , language : string , currency : string ) : Promise < moltin . CartItemsResponse > {
247+ const moltin = MoltinGateway ( { host : config . endpointURL , client_id : config . clientId , language , currency } ) ;
248248 const result = await moltin . Cart ( reference ) . BulkAdd ( data ) ;
249249
250250 return result ;
@@ -270,8 +270,8 @@ export async function updateCartItem(reference: string, productId: string, quant
270270 await moltin . Cart ( reference ) . UpdateItem ( productId , quantity ) ;
271271}
272272
273- export async function checkout ( reference : string , customer : any , billing : any , shipping : any ) : Promise < { data : moltin . Order } > {
274- const moltin = MoltinGateway ( { host : config . endpointURL , client_id : config . clientId } ) ;
273+ export async function checkout ( reference : string , customer : any , billing : any , shipping : any , language : string , currency : string ) : Promise < { data : moltin . Order } > {
274+ const moltin = MoltinGateway ( { host : config . endpointURL , client_id : config . clientId , language , currency } ) ;
275275 const checkoutRes = await moltin . Cart ( reference ) . Checkout ( customer , billing , shipping ) ;
276276
277277 return checkoutRes ;
0 commit comments