/// <summary> /// Settlement /// </summary> /// <param name="settlement">Settlement</param> /// <returns>Settlement</returns> public Settlement settlement(Settlement settle) { settle.setRequiredFields(new List <string> { CardPaymentsConstants.authorizationId }); settle.checkRequiredFields(); settle.setRequiredFields(new List <string> { CardPaymentsConstants.merchantRefNum }); settle.setOptionalFields(new List <string> { CardPaymentsConstants.amount, CardPaymentsConstants.dupCheck }); Request request = new Request( method: RequestType.POST, uri: this.prepareURI("/auths/" + settle.authorizationId() + "/settlements"), body: settle ); dynamic response = this.client.processRequest(request); return(new Settlement(response)); }
/// <summary> /// Get the Settlement /// </summary> /// <param name="settlement">Settlement</param> /// <returns>Settlement</returns> public Settlement get(Settlement settlement) { settlement.setRequiredFields(new List <string> { CardPaymentsConstants.id }); settlement.checkRequiredFields(); Request request = new Request( method: RequestType.GET, uri: this.prepareURI("/settlements/" + settlement.id()) ); dynamic response = this.client.processRequest(request); return(new Settlement(response)); }
/// <summary> /// Cancel Settlement /// </summary> /// <param name="settlement">Settlement</param> /// <returns>Settlement</returns> public Settlement cancelSettlement(Settlement settle) { settle.setRequiredFields(new List <string> { CardPaymentsConstants.id }); settle.checkRequiredFields(); Settlement tmpSettlement = new Settlement(); tmpSettlement.status("CANCELLED"); Request request = new Request( method: RequestType.PUT, uri: this.prepareURI("/settlements/" + settle.id()), body: tmpSettlement ); dynamic response = this.client.processRequest(request); return(new Settlement(response)); }