/// <summary> /// Initializes a new instance of the <see cref="SafechargePaymentRequest"/> with the required parameters. /// </summary> /// <param name="merchantInfo">Merchant's data (E.g. secret key, the merchant id, the merchant site id, etc.)</param> /// <param name="checksumOrderMapping">Type of checksum.</param> /// <param name="sessionToken">The session identifier returned by /getSessionToken.</param> /// <param name="currency">The three character ISO currency code of the transaction.</param> /// <param name="amount">The transaction amount. (E.g. 1, 101.10 - decimal representation of the amount as <see cref="string"/>.</param> public SafechargePaymentRequest( MerchantInfo merchantInfo, ChecksumOrderMapping checksumOrderMapping, string sessionToken, string currency, string amount) : base(merchantInfo, checksumOrderMapping, sessionToken, currency, amount) { }
/// <summary> /// Initializes a new instance of the <see cref="SafechargeRequest"/> with the required parameters. /// </summary> /// <param name="merchantInfo">Merchant's data (E.g. secret key, the merchant id, the merchant site id, etc.)</param> /// <param name="checksumOrderMapping">Type of checksum.</param> /// <param name="sessionToken">The session identifier returned by /getSessionToken.</param> public SafechargeRequest( MerchantInfo merchantInfo, ChecksumOrderMapping checksumOrderMapping, string sessionToken = null) : base(merchantInfo, checksumOrderMapping, sessionToken) { this.MerchantId = merchantInfo.MerchantId; this.MerchantSiteId = merchantInfo.MerchantSiteId; }
/// <summary> /// Initializes a new instance of the <see cref="OrderRequestWithDetails"/> with the required parameters. /// </summary> /// <param name="merchantInfo">Merchant's data (E.g. secret key, the merchant id, the merchant site id, etc.)</param> /// <param name="checksumOrderMapping">Type of checksum.</param> /// <param name="sessionToken">The session identifier returned by /getSessionToken.</param> /// <param name="currency">The three character ISO currency code of the transaction.</param> /// <param name="amount">The transaction amount. (E.g. 1, 101.10 - decimal representation of the amount as <see cref="string"/>.</param> public OrderRequestWithDetails( MerchantInfo merchantInfo, ChecksumOrderMapping checksumOrderMapping, string sessionToken, string currency, string amount) : base(merchantInfo, checksumOrderMapping, sessionToken, currency, amount) { }
/// <summary> /// Initializes a new instance of the <see cref="SafechargeOrderDetailsRequest"/> with the required parameters. /// </summary> /// <param name="merchantInfo">Merchant's data (E.g. secret key, the merchant id, the merchant site id, etc.)</param> /// <param name="checksumOrderMapping">Type of checksum.</param> /// <param name="sessionToken">The session identifier returned by /getSessionToken.</param> /// <param name="currency">The three character ISO currency code of the transaction.</param> /// <param name="amount">The transaction amount. (E.g. 1, 101.10 - decimal representation of the amount as <see cref="string"/>.</param> public SafechargeOrderDetailsRequest( MerchantInfo merchantInfo, ChecksumOrderMapping checksumOrderMapping, string sessionToken, string currency, string amount) : base(merchantInfo, checksumOrderMapping, sessionToken) { this.Currency = currency; this.Amount = amount; }
/// <summary> /// Initializes a new instance of the <see cref="Authorize3dAndPaymentRequest"/> with the required parameters. /// </summary> /// <param name="merchantInfo">Merchant's data (E.g. secret key, the merchant id, the merchant site id, etc.)</param> /// <param name="checksumOrderMapping">Type of checksum.</param> /// <param name="sessionToken">The session identifier returned by /getSessionToken.</param> /// <param name="currency">The three character ISO currency code of the transaction.</param> /// <param name="amount">The transaction amount. (E.g. 1, 101.10 - decimal representation of the amount as <see cref="string"/>.</param> /// <param name="paymentOption">Details about the payment method.</param> public Authorize3dAndPaymentRequest( MerchantInfo merchantInfo, ChecksumOrderMapping checksumOrderMapping, string sessionToken, string currency, string amount, PaymentOption paymentOption) : base(merchantInfo, checksumOrderMapping, sessionToken, currency, amount) { this.PaymentOption = paymentOption; }
/// <summary> /// Initializes a new instance of the <see cref="SafechargeBaseRequest"/> with the required parameters. /// </summary> /// <param name="merchantInfo">Merchant's data (E.g. secret key, the merchant id, the merchant site id, etc.)</param> /// <param name="checksumOrderMapping">Type of checksum.</param> /// <param name="sessionToken">The session identifier returned by /getSessionToken.</param> public SafechargeBaseRequest( MerchantInfo merchantInfo, ChecksumOrderMapping checksumOrderMapping, string sessionToken) { this.ServerHost = merchantInfo.ServerHost; this.TimeStamp = DateTime.Now.ToString(Constants.TimeStampFormat); this.SessionToken = sessionToken; this.MerchantKey = merchantInfo.MerchantKey; this.HashAlgorithmType = merchantInfo.HashAlgorithm; this.ChecksumOrderMapping = checksumOrderMapping; }
/// <summary> /// Initializes a new instance of the <see cref="SafechargeTransactionRequest"/> with the required parameters. /// </summary> /// <param name="merchantInfo">Merchant's data (E.g. secret key, the merchant id, the merchant site id, etc.)</param> /// <param name="checksumOrderMapping">Type of checksum.</param> /// <param name="sessionToken">The session identifier returned by /getSessionToken.</param> /// <param name="currency">The three character ISO currency code of the transaction.</param> /// <param name="amount">The transaction amount. (E.g. 1, 101.10 - decimal representation of the amount as <see cref="string"/>.</param> /// <param name="relatedTransactionId"></param> public SafechargeTransactionRequest( MerchantInfo merchantInfo, ChecksumOrderMapping checksumOrderMapping, string sessionToken, string currency, string amount, string relatedTransactionId) : base(merchantInfo, checksumOrderMapping, sessionToken) { this.Currency = currency; this.Amount = amount; this.RelatedTransactionId = relatedTransactionId; }
private string CalculateChecksum(ChecksumOrderMapping checksumOrderMapping = ChecksumOrderMapping.ApiGenericChecksumMapping) { var checksum = new StringBuilder(); if (Constants.RequestChecksumParameters.ContainsKey(checksumOrderMapping)) { List <string> paramsOrder = Constants.RequestChecksumParameters[checksumOrderMapping]; foreach (string parameterName in paramsOrder) { checksum.Append(this.GetPropValue(parameterName)); } } checksum.Append(this.MerchantKey); return(this.GetHash(this.HashAlgorithmType, checksum.ToString())); }