Skip to main content
Skip to main content

upsertPaymentCollections - Payment Module Reference

This documentation provides a reference to the upsertPaymentCollections method. This belongs to the Payment Module.

upsertPaymentCollections(data, sharedContext?): Promise<PaymentCollectionDTO[]>

This method updates or creates payment collections if they don't exist.

Example

const paymentCollections =
await paymentModuleService.upsertPaymentCollections([
{
id: "pay_col_123",
region_id: "reg_123",
},
{
region_id: "reg_123",
currency_code: "usd",
amount: 3000,
},
])

Parameters

The attributes in the payment collections to be created or updated. If the object includes the id field, then the payment collection is updated. Otherise, it's created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<PaymentCollectionDTO[]>Required
The created or updated payment collections.

upsertPaymentCollections(data, sharedContext?): Promise<PaymentCollectionDTO>

This method updates or creates a payment collection if it doesn't exist.

Example

const paymentCollection =
await paymentModuleService.upsertPaymentCollections({
id: "pay_col_123",
region_id: "reg_123",
})

Parameters

The attributes in the payment collection to be created or updated. If the id field is included, the payment collection is updated. Otherwise, it's created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<PaymentCollectionDTO>Required
The created or updated payment collection.
Was this section helpful?