diff --git a/mappings/cancel.jsonata b/mappings/cancel.jsonata index 1af3ce80f0120e491ed58db8e0db54945d64d1a3..064b939c636edbe6f61c0f425d3b2adfeba890e6 100644 --- a/mappings/cancel.jsonata +++ b/mappings/cancel.jsonata @@ -1,4 +1,4 @@ -{ +$.data.{ "context": $context(context, $action), "message": message -} +}[] diff --git a/mappings/on_cancel.jsonata b/mappings/on_cancel.jsonata index 9018d1999c5a8bf31510702e6d9785b0a8a2f886..35a9d8d6de83249dbd4018d0d758e4d251be2c59 100644 --- a/mappings/on_cancel.jsonata +++ b/mappings/on_cancel.jsonata @@ -28,7 +28,7 @@ "rateable": rateable, "time": time, "quantity": quantity - }, + }[], "fulfillments": message.order.fulfillments, "quote": message.order.quote, "billing": message.order.billing, diff --git a/src/gcl/gcl.service.ts b/src/gcl/gcl.service.ts index ba3372ae5f3c603c59ab7891255d9c2460fd3a4e..151c10de56a87d63f17ce12ae1a84e9b92b5ea0f 100644 --- a/src/gcl/gcl.service.ts +++ b/src/gcl/gcl.service.ts @@ -7,7 +7,7 @@ export class GCLService { constructor( @inject(TLService) private tlService: TLService, @inject(PSClientService) private psClientService: PSClientService - ) { } + ) {} async search(body: any) { const payload = await this.tlService.transform(body, "search"); @@ -59,7 +59,7 @@ export class GCLService { async cancel(body: any) { const payload = await this.tlService.transform(body, "cancel"); - const psResponse = await this.psClientService.post(payload); + const psResponse = await this.psClientService.postMany(payload); const response = await this.tlService.transform(psResponse, "on_cancel"); return response;