Skip to content

Latest commit

 

History

History
241 lines (148 loc) · 5.79 KB

batchgateway.md

File metadata and controls

241 lines (148 loc) · 5.79 KB

Trolley JavaScript SDK > BatchGateway

Class: BatchGateway

Gateway class for batcheso class: BatchGateway

Hierarchy

BatchGateway

Index

Methods


Methods

all

all(): Promise<Batch[]>

Defined in BatchGateway.ts:52

Fetch batch all batches with an Iterator

Returns: Promise<Batch[]>


create

create(batch: BatchInput, payments?: PaymentInput[]): Promise<Batch>

Defined in BatchGateway.ts:95

Creates a batch with optional payments. This is the interface that is provide by the Create Batch API

const batch = await client.batch.create({
    description: "My Batch",
    sourceCurrency: "USD",
  }, [
    {
      recipient: {
        email: "[email protected]",
      },
      sourceAmount: "10.20",
    },
  ]);

Parameters:

Param Type Description
batch BatchInput -
Optional payments PaymentInput[] (optional)

Returns: Promise<Batch>


find

find(batchId: string): Promise<Batch>

Defined in BatchGateway.ts:67

Retrieves a batch based on the batch id

const batch = await client.batch.find('B-xx999bb');

Parameters:

Param Type Description
batchId string Trolley payment id (e.g. "B-xx999bb")

Returns: Promise<Batch>


generateQuote

generateQuote(batchId: string): Promise<Batch>

Defined in BatchGateway.ts:182

Generate a FX quote for this batch

Parameters:

Param Type Description
batchId string Trolley payment id (e.g. "B-xx999bb")

Returns: Promise<Batch>


paymentList

paymentList(batchId: string, page?: number, pageSize?: number): Promise<Payment[]>

Defined in BatchGateway.ts:166

Return a paginated list of payments for this batch

Parameters:

Param Type Default value Description
batchId string - Trolley payment id (e.g. "B-xx999bb")
Default value page number 1 starting a 1
Default value pageSize number 10 in the range 0...1000

Returns: Promise<Payment[]>


remove

remove(batchId: string): Promise<boolean>

Defined in BatchGateway.ts:132

Delete the given batch

const success = client.batch.remove('B-xx999bb');

Parameters:

Param Type Description
batchId string Trolley payment id (e.g. "B-xx999bb")

Returns: Promise<boolean>


search

search(page?: number, pageSize?: number, term?: string): Promise<Batch[]>

Defined in BatchGateway.ts:146

Search for a batch matching the given term

Parameters:

Param Type Default value Description
Default value page number 1 -
Default value pageSize number 10 -
Default value term string "" string search term

Returns: Promise<Batch[]>


startProcessing

startProcessing(batchId: string): Promise<Batch>

Defined in BatchGateway.ts:194

Start processing this batch

Parameters:

Param Type Description
batchId string Trolley payment id (e.g. "B-xx999bb")

Returns: Promise<Batch>


summary

summary(batchId: string): Promise<BatchSummary>

Defined in BatchGateway.ts:206

Get a transaction totaled summary for this batch

Parameters:

Param Type Description
batchId string Trolley payment id (e.g. "B-xx999bb")

Returns: Promise<BatchSummary>


update

update(batchId: string, body: BatchInput): Promise<boolean>

Defined in BatchGateway.ts:117

Update the batch data, note you can only update the information of a batch not the payments via this API

const batch = await client.batch.create({
    description: "My Batch for Wednesday",
});

Parameters:

Param Type Description
batchId string Trolley payment id (e.g. "B-xx999bb")
body BatchInput

Returns: Promise<boolean>