コード例 #1
0
        /// <summary>
        /// Creates some general payza button
        /// </summary>
        /// <param name="itemName">Name describing the item or service. Max Length: 50 characters</param>
        /// <param name="amount">The price or cost of the product or service. The value for
        /// amount must be positive. Null or negative numbers are not allowed.</param>
        /// <param name="command">Describes how handler should handle IPN request.
        /// Stored in field apc_1. Max Length: 100 characters</param>
        /// <param name="args">
        /// Custom values you can pass along with the payment button.
        /// The values are not displayed to the payer on our Pay Process page.
        /// Payza returns these fields back in the IPN.
        /// Used by IIpnHandler ('command')
        /// Stored in fields apc_2 - apc_6. Max Length: 100 characters
        /// </param>
        /// <returns>Http address where member should be redirected after clicking button.</returns>
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            if (args.Length > MaxArgsCount)
            {
                throw new ArgumentException("MaxArgsCount exceeded. Expected max " + MaxArgsCount + ", found " + args.Length);
            }

            NVPStringBuilder nvps = new NVPStringBuilder();

            nvps.Append("ap_merchant", account.Username)
            .Append("ap_purchasetype", "service")
            .Append("ap_itemname", itemName.Substring(0, Math.Min(itemName.Length, ItemNameMaxLength)))
            .Append("ap_amount", amount.ToShortClearString())
            .Append("ap_currency", AppSettings.Site.CurrencyCode)
            .Append("ap_alerturl", AppSettings.Site.Url + "Handlers/Payza.ashx")
            .Append("ap_returnurl", ButtonGenerationStrategy.SUCCESS_URL)
            .Append("ap_cancelurl", ButtonGenerationStrategy.FAILURE_URL)
            .Append("ap_ipnversion", 2)
            .Append("apc_1", command);

            for (int i = 0; i < args.Length; ++i)
            {
                nvps.Append("apc_" + (i + 2), Convert.ToString(args[i]));
            }

            return(Handler + '?' + nvps.Build());
        }
コード例 #2
0
    protected override string generate(string itemName, Money amount, string command, object[] args)
    {
        string AmountString = amount.ToClearString();
        string CurrencyCode = AppSettings.Site.CurrencyCode;

        if (amount is CryptocurrencyMoney)
        {
            //We have direct BTC -> BTC Wallet transfer
            AmountString = ((CryptocurrencyMoney)amount).ToClearString();
            CurrencyCode = ((CryptocurrencyMoney)amount).cryptocurrencyType.ToString();
        }

        NVPStringBuilder nvps = new NVPStringBuilder();

        nvps.Append("cmd", "_pay_simple")
        .Append("reset", "1")
        .Append("merchant", AppSettings.Cryptocurrencies.CoinPaymentsYourMerchantID)
        .Append("currency", CurrencyCode)
        .Append("amountf", AmountString)
        .Append("item_name", itemName)
        .Append("invoice", String.Join(ArgsDelimeter + "", args)) //invoice	- This is a passthru variable for your own use. [not visible to buyer]
        .Append("custom", command)                                //custom - This is a 2nd passthru variable for your own use. [not visible to buyer]
        .Append("success_url", SUCCESS_URL)
        .Append("cancel_url", FAILURE_URL);
        //.Append("ipn_url", AppSettings.Site.Url + "Handlers/CoinPayments.ashx") //If not set or blank defaults to the IPN URL in your settings.

        return(Handler + '?' + nvps.Build());
    }
コード例 #3
0
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            NVPStringBuilder nvps = new NVPStringBuilder();

            string orderId = HashingManager.GenerateMD5(AppSettings.Site.Name + DateTime.Now).ToLower();

            orderId = orderId.Substring(0, Math.Min(orderId.Length, 31));

            string description = command + "#" + String.Join(ArgsDelimeter + "", args);

            description = itemName + " **" + description;

            string toHash = account.MerchantID + ":" + orderId + ":" + amount.ToShortClearString() + ":" + AppSettings.Site.CurrencyCode
                            + ":" + HashingManager.Base64Encode(description) + ":" + account.SecretKey;
            string hash = HashingManager.SHA256(toHash).ToUpper();

            nvps.Append("m_shop", account.MerchantID)
            .Append("m_orderid", orderId)
            .Append("m_amount", amount.ToShortClearString())
            .Append("m_curr", AppSettings.Site.CurrencyCode)
            .Append("m_desc", HashingManager.Base64Encode(description))
            .Append("m_sign", hash);

            return(HandlerUrl + '?' + nvps.Build());
        }
コード例 #4
0
        /// <summary>
        /// Creates some general payza button
        /// </summary>
        /// <param name="itemName">Name describing the item or service. Max Length: 50 characters</param>
        /// <param name="amount">The price or cost of the product or service. The value for
        /// amount must be positive. Null or negative numbers are not allowed.</param>
        /// <param name="command">Describes how handler should handle IPN request.
        /// Stored in field apc_1. Max Length: 100 characters</param>
        /// <param name="args">
        /// Custom values you can pass along with the payment button.
        /// The values are not displayed to the payer on our Pay Process page.
        /// Payza returns these fields back in the IPN.
        /// Used by IIpnHandler ('command')
        /// Stored in fields apc_2 - apc_6. Max Length: 100 characters
        /// </param>
        /// <returns>Http address where member should be redirected after clicking button.</returns>
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            string orderId = HashingManager.GenerateMD5(AppSettings.Site.Name + DateTime.Now).ToLower();

            string signature = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", account.AccountEmail,
                                             account.SCIName, amount.ToShortClearString(), AppSettings.Site.CurrencyCode,
                                             AdvCashAccount.APIPassword, orderId);

            signature = HashingManager.SHA256(signature).ToLower();

            NVPStringBuilder nvps = new NVPStringBuilder();

            nvps.Append("ac_account_email", account.AccountEmail)
            .Append("ac_sci_name", account.SCIName)
            .Append("ac_comments", itemName.Substring(0, Math.Min(itemName.Length, ItemNameMaxLength)))
            .Append("ac_amount", amount.ToShortClearString())
            .Append("ac_currency", AppSettings.Site.CurrencyCode)

            .Append("ac_status_url", AppSettings.Site.Url + "Handlers/Payment/AdvCash.ashx")
            .Append("ac_success_url ", ButtonGenerationStrategy.SUCCESS_URL)
            .Append("ac_fail_url", ButtonGenerationStrategy.FAILURE_URL)

            .Append("ac_sign", signature)
            .Append("ac_order_id", orderId)
            .Append("acm_command", command)
            .Append("acm_args", String.Join(ArgsDelimeter + "", args));

            return(Handler + '?' + nvps.Build());
        }
コード例 #5
0
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            NVPStringBuilder nvps = new NVPStringBuilder();

            nvps.Append("netellerItemName", itemName.Substring(0, Math.Min(itemName.Length, ItemNameMaxLength)))
            .Append("netellerAmount", amount.ToShortClearString())
            .Append("netellerCommand", command)
            .Append("netellerArgs", String.Join(ArgsDelimeter + "", args));

            return(Handler + '?' + nvps.Build());
        }
コード例 #6
0
        /// <summary>
        /// Creates some general paypal button
        /// </summary>
        /// <param name="itemName">Name describing the item or service. Max Length: 127 characters</param>
        /// <param name="amount">The price or cost of the product or service.</param>
        /// <param name="command">Describes how handler should handle IPN request.
        /// Stored in field custom. Max Length: 100 characters</param>
        /// <param name="args"></param>
        /// <returns>Http address where members should be redirected after clicking button</returns>
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            NVPStringBuilder nvps = new NVPStringBuilder();

            nvps.Append("cmd", "_xclick")
            .Append("business", account.Username)
            .Append("item_name", itemName.Substring(0, Math.Min(itemName.Length, ItemNameMaxLength)))
            .Append("custom", command)
            .Append("invoice", String.Join(ArgsDelimeter + "", args))
            .Append("amount", amount.ToShortClearString())
            .Append("currency_code", AppSettings.Site.CurrencyCode)
            .Append("button_subtype", "services")
            .Append("no_shipping", "1")
            .Append("notify_url", AppSettings.Site.Url + "Handlers/PayPal.ashx");

            return(Handler + '?' + nvps.Build());
        }
コード例 #7
0
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            NVPStringBuilder nvps = new NVPStringBuilder();

            nvps.Append("merchantAccount", account.Username)
            .Append("sci_name", account.PaymentButtonName)
            .Append("item_id", itemName)
            .Append("amount", amount.ToShortClearString())
            .Append("user1", command)
            .Append("user2", String.Join(ArgsDelimeter.ToString(), args))
            .Append("PAYMENT_AMOUNT", amount.ToShortClearString())
            .Append("PAYMENT_UNITS", AppSettings.Site.CurrencyCode)
            .Append("return_url", ButtonGenerationStrategy.SUCCESS_URL)
            .Append("cancel_url", ButtonGenerationStrategy.FAILURE_URL)
            .Append("notify_url", AppSettings.Site.Url + "Handlers/SolidTrustPay.ashx")
            .Append("pp", "SolidTrustPay");     //Automatic submit on status.aspx

            return(Handler + '?' + nvps.Build());
        }
コード例 #8
0
        /// <summary>
        /// Creates some general payza button
        /// </summary>
        /// <param name="itemName">Name describing the item or service. Max Length: 50 characters</param>
        /// <param name="amount">The price or cost of the product or service. The value for
        /// amount must be positive. Null or negative numbers are not allowed.</param>
        /// <param name="command">Describes how handler should handle IPN request.
        /// Stored in field apc_1. Max Length: 100 characters</param>
        /// <param name="args">
        /// Custom values you can pass along with the payment button.
        /// The values are not displayed to the payer on our Pay Process page.
        /// Payza returns these fields back in the IPN.
        /// Used by IIpnHandler ('command')
        /// Stored in fields apc_2 - apc_6. Max Length: 100 characters
        /// </param>
        /// <returns>Http address where member should be redirected after clicking button.</returns>
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            string orderId = HashingManager.GenerateMD5(AppSettings.Site.Name + DateTime.Now).ToLower();

            NVPStringBuilder nvps = new NVPStringBuilder();

            nvps.Append("ok_receiver", account.Username)
            .Append("ok_item_1_name", itemName)
            .Append("ok_item_1_price", amount.ToShortClearString())
            .Append("ok_currency", AppSettings.Site.CurrencyCode)
            .Append("ok_fees", "1")
            .Append("ok_invoice", orderId)
            .Append("ok_item_1_custom_1_title", "command")
            .Append("ok_item_1_custom_1_value", command)
            .Append("ok_item_1_custom_2_title", "args")
            .Append("ok_item_1_custom_2_value", HashingManager.Base64Encode(String.Join(ArgsDelimeter + "", args)));

            return(Handler + '?' + nvps.Build());
        }
コード例 #9
0
        protected override string generate(string itemName, Money amount, string command, object[] args)
        {
            NVPStringBuilder nvps = new NVPStringBuilder();

            nvps.Append("PAYEE_ACCOUNT", account.AccountNumber)
            .Append("PAYEE_NAME", account.DisplayName)
            .Append("PAYMENT_METHOD", "PerfectMoney account")
            .Append("BAGGAGE_FIELDS", "ITEM_NAME ITEM_COMMAND ITEM_ARGS")
            .Append("ITEM_NAME", itemName.Substring(0, Math.Min(itemName.Length, ItemNameMaxLength)))
            .Append("ITEM_COMMAND", command)
            .Append("ITEM_ARGS", String.Join(ArgsDelimeter + "", args))
            .Append("PAYMENT_AMOUNT", amount.ToShortClearString())
            .Append("PAYMENT_UNITS", AppSettings.Site.CurrencyCode)
            .Append("PAYMENT_URL", ButtonGenerationStrategy.SUCCESS_URL)
            .Append("NOPAYMENT_URL", ButtonGenerationStrategy.FAILURE_URL)
            .Append("STATUS_URL", AppSettings.Site.Url + "Handlers/PerfectMoney.ashx")
            .Append("pp", "PerfectMoney");     //Automatic submit on status.aspx

            return(Handler + '?' + nvps.Build());
        }