Discussions

Ask a Question
Back to All

Processing Cash Payment after posting Batch

I'll explain my scenario here. What I'm looking to do is apply a payment to the batch and only apply the payment to the member's dues balance if the batch has been posted.

I created a batch using the /api/BatchSummary endpoint creating an empty batch.

Then in my /api/ComboOrder call I specify a cash amount in payments and list my newly created batch in the AdditionalAttributes section. The body of the ComboOrder goes like this.

{
"$type": "Asi.Soa.Commerce.DataContracts.ComboOrderData, Asi.Contracts",
"Currency": {
"$type": "Asi.Soa.Core.DataContracts.CurrencyData, Asi.Contracts",
"CurrencyCode": "USD",
"DecimalPositions": 2,
"ExtensionData": {
"$type": "System.Runtime.Serialization.ExtensionDataObject, System.Runtime.Serialization"
}
},
"Order":{},
"Invoices": {
"$type": "Asi.Soa.Commerce.DataContracts.InvoiceSummaryDataCollection, Asi.Contracts",
"$values": [] // InvoiceSummary Results go here.
},
"Payments": {
"$type": "Asi.Soa.Commerce.DataContracts.RemittanceDataCollection, Asi.Contracts",
"$values": [{
"$type": "Asi.Soa.Commerce.DataContracts.RemittanceData, Asi.Contracts",
"Amount": {
"$type": "Asi.Soa.Core.DataContracts.MonetaryAmountData, Asi.Contracts",
"Amount": 0, //Payment amount
"Currency": {
"$type": "Asi.Soa.Core.DataContracts.CurrencyData, Asi.Contracts",
"CurrencyCode": "USD",
"DecimalPositions": 2,
"ExtensionData": {
"$type": "System.Runtime.Serialization.ExtensionDataObject, System.Runtime.Serialization"
}
},
"IsAmountDefined": true
},
"PaymentToken": "",
"PaymentTokenSummary": "",
"PaymentMethod": {
"$type": "Asi.Soa.Commerce.DataContracts.PaymentMethodData, Asi.Contracts",
"Name": "Main Checking Account",
"PaymentMethodId": "CASH",
"PaymentType": "Cash",
"Message": "Cash"
},
"PayorParty": {
"$type": "Asi.Soa.Commerce.DataContracts.CustomerPartyData, Asi.Contracts",
"PartyId": "" // ID
},
"ReferenceNumber": "", // Comment Check number
"Message": "Cash",
"Note":"Sequence Number Goes Here"
}]
},
"AdditionalAttributes": {
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "BatchId",
"Value": $scope.DataStore.BatchNum
}
]
}
}

Once the POST ComboOrder has been called it inserts the member payment to the batch like I expect it would but it also marks the payment in the Dues balance on the member's record.

  1. Is there a way to apply the payment only to the batch in ComboOrder? OR
  2. Can I add payment entries into a Batch using one of the Batch endpoints?

Thanks, appreciate any advice.

Start typing markdown or type / to insert a block