Beispiel #1
0
        public String calculateSignature()
        {
            String userAndPass = new StringBuilder(userId).Append(password).ToString();

            Console.WriteLine("raw " + userAndPass);
            Console.WriteLine("md5 = " + DiggestUtils.md5(userAndPass));
            return(DiggestUtils.sha1(DiggestUtils.md5(userAndPass)));
        }
        public String getSignature()
        {
            StringBuilder sb = new StringBuilder();


            signature = sb.Append("##").Append(usr.getMerchantId().ToUpper()).Append("##").Append(usr.getPass().ToUpper()).Append("##").Append(getMerchant_tranid()).Append("##").Append((getAmount().ToString("0.00"))).Append("##0##").ToString();

            return(DiggestUtils.sha1(signature));
        }
Beispiel #3
0
        public FaspayPaymentRequestWrapper(
            FaspayConfig mFaspayConfig,
            FaspayPaymentRequestBillData billing,
            FaspayPaymentChannel mFaspayPaymentChannel,
            FaspayPaymentRequestUserData userData,
            FaspayPaymentRequestShippingData mShippingData
            )
        {
            merchant_id   = (mFaspayConfig.user.merchantId);
            merchant      = (mFaspayConfig.user.merchantName);
            bill_no       = (billing.bill_no);
            bill_reff     = (billing.bill_reff);
            bill_date     = (billing.bill_date);
            bill_expired  = (billing.bill_expired);
            bill_desc     = (billing.bill_expired);
            bill_currency = (billing.bill_currency);
            bill_gross    = (billing.bill_gross);

            bill_miscfee = (billing.bill_miscfee);

            bill_total                    = (billing.bill_total);
            cust_no                       = (userData.custNo);
            cust_name                     = (userData.custName);
            payment_channel               = (mFaspayPaymentChannel.pg_code);
            bank_userid                   = (userData.bank_userid);
            msisdn                        = (userData.msisdn);
            email                         = (userData.email);
            terminal                      = (userData.terminal);
            billing_name                  = (billing.billing_name);
            billing_lastname              = (billing.billing_lastname);
            billing_address               = (billing.billing_address);
            billing_address_city          = (billing.billing_address_city);
            billing_address_region        = (billing.billing_address_region);
            billing_address_state         = (billing.billing_address_state);
            billing_address_poscode       = (billing.billing_address_poscode);
            billing_msisdn                = (billing.billing_msisdn);
            billing_address_country_code  = (billing.billing_address_country_code);
            receiver_name_for_shipping    = (mShippingData.receiver_name_for_shipping);
            shipping_lastname             = (mShippingData.shipping_lastname);
            shipping_address              = (mShippingData.shipping_address);
            shipping_address_city         = (mShippingData.shipping_address_city);
            shipping_address_region       = (mShippingData.shipping_address_region);
            shipping_address_state        = (mShippingData.shipping_address_state);
            shipping_address_poscode      = (mShippingData.shipping_address_poscode);
            shipping_msisdn               = (mShippingData.shipping_msisdn);
            shipping_address_country_code = (mShippingData.shipping_address_country_code);
            item     = (billing.item);
            reserve1 = ("");
            reserve2 = ("");
            request  = ("");
            pay_type = billing.pay_type;

            String userAndPass = new StringBuilder(mFaspayConfig.user.userId).Append(mFaspayConfig.user.password).Append(bill_no).ToString();

            signature = (DiggestUtils.sha1(DiggestUtils.md5(userAndPass)));
        }
Beispiel #4
0
        public FaspayPaymentStatusRequestWrapper(string request, String trxId, String bill_no, FaspayConfig mFaspayConfig)
        {
            String userAndPass = new StringBuilder(mFaspayConfig.user.userId).Append(mFaspayConfig.user.password).Append(bill_no).ToString();

            base.request     = request;
            base.trx_id      = trxId;
            base.bill_no     = bill_no;
            base.merchant_id = mFaspayConfig.user.merchantId;
            base.signature   = DiggestUtils.sha1(DiggestUtils.md5(userAndPass));
        }
        public FaspayCancelPaymentRequestWrapper(String trxId, String billNo, String paymentCancel, FaspayConfig mFaspayConfig)
        {
            this.trx_id         = trxId;
            this.bill_no        = billNo;
            this.payment_cancel = paymentCancel;
            this.merchant       = mFaspayConfig.user.merchantName;
            this.merchant_id    = mFaspayConfig.user.merchantId;

            String userAndPass = new StringBuilder(mFaspayConfig.user.userId).Append(mFaspayConfig.user.password).Append(billNo).ToString();

            this.signature = DiggestUtils.sha1(DiggestUtils.md5(userAndPass));
        }
Beispiel #6
0
        public CaptureRequestWrapperProd(FaspayUserCredit user, String MERCHANT_TRANID, String TRANSACTIONID, long AMOUNT, String CUSTNAME, String CUSTEMAIL, String DESCRIPTION, String RETURN_URL)
        {
            this.merchantid      = user.getMerchantId();
            this.merchant_tranid = MERCHANT_TRANID;
            this.transactionid   = TRANSACTIONID;

            this.amount      = AMOUNT + ".00";
            this.custname    = CUSTNAME;
            this.custemail   = CUSTEMAIL;
            this.description = DESCRIPTION;
            this.return_url  = RETURN_URL;
            String raw = new StringBuilder().Append("##").Append(user.getMerchantId().ToUpper()).Append("##").Append(user.getPass().ToUpper()).Append("##").Append(merchant_tranid).Append("##").Append(getAmount()).Append("##").Append(TRANSACTIONID).Append("##").ToString();

            this.signature = DiggestUtils.sha1(raw);
        }
Beispiel #7
0
        public InquiryRequestCreditWrapper(FaspayConfigCredit configCredit, FaspayUserCredit user, String MERCHANT_TRANID, long amount) : base(configCredit)
        {
            this.user = user;

            this.merchant_tranid = MERCHANT_TRANID;
            this.amount          = amount.ToString("0.00", CultureInfo.InvariantCulture);

            setTransactiontype("4");
            setResponse_type("3");
            setMerchantid(user.getMerchantId());
            setPayment_method("1");
            String rawsig = new StringBuilder("##").Append(user.getMerchantId().ToUpper()).Append("##").Append(user.getPass().ToUpper()).Append("##").Append(MERCHANT_TRANID).Append("##").Append(getAmount()).Append("##0##").ToString();

            this.signature = DiggestUtils.sha1(rawsig);
        }