File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
backend/src/services/billit Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,12 @@ export class ApiClient {
116116 /**
117117 * Updates the OrderStatus of an existing Billit order
118118 */
119- async patchOrderStatus ( billitOrderId : number , status : BillitOrderStatus ) : Promise < void > {
119+ async patchOrderStatus ( billitOrderId : number , status : 'ToPay' | 'Paid' ) : Promise < void > {
120+ const body = {
121+ Paid : status === 'Paid' ,
122+ PaidDate : status === 'Paid' ? new Date ( ) . toISOString ( ) : null ,
123+ } ;
124+
120125 const response : fetch . Response = await fetch ( `${ this . config . apiUrl } /orders/${ billitOrderId } ` , {
121126 method : 'PATCH' ,
122127 headers : {
@@ -125,7 +130,7 @@ export class ApiClient {
125130 PartyID : this . config . partyId ,
126131 ContextPartyID : this . config . contextPartyId ,
127132 } ,
128- body : JSON . stringify ( { OrderStatus : status } ) ,
133+ body : JSON . stringify ( body ) ,
129134 } ) ;
130135
131136 if ( ! response . ok ) {
You can’t perform that action at this time.
0 commit comments