Esempio n. 1
0
        private dynamic GetHashData(dynamic arg)
        {
            var para = arg.body.Value as JObject;

            if (para == null)
            {
                return(404);
            }

            var settings         = this.CurrentSite.pg2c2p;
            var parametersString = para.Value <string>("parameters");

            if (string.IsNullOrEmpty(parametersString))
            {
                return(404);
            }

            return(Pg2c2pEncryption.GetHmacSha256HexText(parametersString, (string)settings.authSercretKey));
        }
Esempio n. 2
0
        public bool VerifyHash(string merchantId, string authSecretKey)
        {
            if (this.merchant_id != merchantId)
            {
                return(false);
            }
            var message = version + request_timestamp + merchant_id + order_id +
                          invoice_no + currency + amount + transaction_ref + approval_code +
                          eci + transaction_datetime + payment_channel + payment_status +
                          channel_response_code + channel_response_desc + masked_pan +
                          stored_card_unique_id + backend_invoice + paid_channel + paid_agent +
                          recurring_unique_id + user_defined_1 + user_defined_2 + user_defined_3 +
                          user_defined_4 + user_defined_5 + browser_info + ippPeriod +
                          ippInterestType + ippInterestRate + ippMerchantAbsorbRate + payment_scheme +
                          process_by + sub_merchant_list;
            var newCypher = Pg2c2pEncryption.GetHmacSha256HexText(message, authSecretKey);

            return(hash_value.ToLower() == newCypher);
        }