Class CommissionMerchantBase
Namespace: DirectScale.Disco.Extension
Assembly: DirectScale.Disco.Extension.Abstractions.dll
Syntax
public abstract class CommissionMerchantBase : Object
Constructors
CommissionMerchantBase()
Declaration
protected CommissionMerchantBase()
Methods
PayCommissions(Int32, CommissionPayment[])
This is used to define the custom logic to integrate with a merchant and process commission payments. Usually processes complete batches all together.
Declaration
public abstract Task<CommissionPaymentResult[]> PayCommissions(int batchId, CommissionPayment[] payments)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | batchId | This is the batch number being paid. |
CommissionPayment[] | payments | This is the list of payments being paid. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<CommissionPaymentResult[]> | A list of the results of every payment. |
Remarks
Warning! Be careful here! We process the whole batch at once, so you have to provide the error handling so the statuses are correctly saved. If half of the payments succeeded, but then an exception were thrown, disco would not receive the CommissionPaymentResults and would be unaware that any of the payments went out. Try - catch handling is necessary
ProvisionAccount(Int32)
This is used to provision a user account the first time this merchant is used for that associate.
Declaration
public virtual Task<Dictionary<string, string>> ProvisionAccount(int associateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateId | This is the associate id of that account that needs to be provisioned. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String, System.String>> |