/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (ProposalId != null) { hashCode = hashCode * 59 + ProposalId.GetHashCode(); } if (IssuerId != null) { hashCode = hashCode * 59 + IssuerId.GetHashCode(); } if (State != null) { hashCode = hashCode * 59 + State.GetHashCode(); } if (PrevProposalId != null) { hashCode = hashCode * 59 + PrevProposalId.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if Proposal instances are equal /// </summary> /// <param name="other">Instance of Proposal to be compared</param> /// <returns>Boolean</returns> public bool Equals(Proposal other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ProposalId == other.ProposalId || ProposalId != null && ProposalId.Equals(other.ProposalId) ) && ( IssuerId == other.IssuerId || IssuerId != null && IssuerId.Equals(other.IssuerId) ) && ( State == other.State || State != null && State.Equals(other.State) ) && ( PrevProposalId == other.PrevProposalId || PrevProposalId != null && PrevProposalId.Equals(other.PrevProposalId) )); }
public override string ToXml(ISignatureProvider signatureProvider) { XNamespace xmlNamespace = "http://www.idealdesk.com/ideal/messages/mer-acq/3.3.1"; var directoryRequestXmlMessage = new XDocument( new XDeclaration("1.0", "UTF-8", null), new XElement(xmlNamespace + "AcquirerTrxReq", new XAttribute("version", "3.3.1"), new XElement(xmlNamespace + "createDateTimestamp", createDateTimestamp), new XElement(xmlNamespace + "Issuer", new XElement(xmlNamespace + "issuerID", IssuerId.ToString().PadLeft(4, '0')) ), new XElement(xmlNamespace + "Merchant", new XElement(xmlNamespace + "merchantID", MerchantId.PadLeft(9, '0')), new XElement(xmlNamespace + "subID", "0"), new XElement(xmlNamespace + "merchantReturnURL", MerchantReturnUrl) ), new XElement(xmlNamespace + "Transaction", new XElement(xmlNamespace + "purchaseID", PurchaseId), new XElement(xmlNamespace + "amount", Amount), new XElement(xmlNamespace + "currency", "EUR"), new XElement(xmlNamespace + "expirationPeriod", "PT" + Convert.ToInt32(Math.Floor(ExpirationPeriod.Value.TotalSeconds)) + "S"), new XElement(xmlNamespace + "language", "nl"), new XElement(xmlNamespace + "description", Description), new XElement(xmlNamespace + "entranceCode", EntranceCode) ) ) ); return(signatureProvider.SignXml(directoryRequestXmlMessage)); }
public override string ToXml(ISignatureProvider signatureProvider) { XNamespace xmlNamespace = "http://www.idealdesk.com/Message"; var directoryRequestXmlMessage = new XDocument( new XDeclaration("1.0", "UTF-8", null), new XElement(xmlNamespace + "AcquirerTrxReq", new XAttribute("version", "1.1.0"), new XElement(xmlNamespace + "createDateTimeStamp", CreateDateTimeStamp), new XElement(xmlNamespace + "Issuer", new XElement(xmlNamespace + "issuerID", IssuerId.ToString().PadLeft(4, '0')) ), new XElement(xmlNamespace + "Merchant", new XElement(xmlNamespace + "merchantID", MerchantId.PadLeft(9, '0')), new XElement(xmlNamespace + "subID", MerchantSubId), new XElement(xmlNamespace + "authentication", "SHA1_RSA"), new XElement(xmlNamespace + "token", signatureProvider.GetThumbprintAcceptantCertificate()), new XElement(xmlNamespace + "tokenCode", signatureProvider.GetSignature(MessageDigest)), new XElement(xmlNamespace + "merchantReturnURL", MerchantReturnUrl) ), new XElement(xmlNamespace + "Transaction", new XElement(xmlNamespace + "purchaseID", PurchaseId), new XElement(xmlNamespace + "amount", Amount), new XElement(xmlNamespace + "currency", "EUR"), new XElement(xmlNamespace + "expirationPeriod", "PT" + Convert.ToInt32(Math.Floor(ExpirationPeriod.Value.TotalSeconds)) + "S"), new XElement(xmlNamespace + "language", "nl"), new XElement(xmlNamespace + "description", Description), new XElement(xmlNamespace + "entranceCode", EntranceCode) ) ) ); return(directoryRequestXmlMessage.Declaration + directoryRequestXmlMessage.ToString(SaveOptions.None)); }