Initial project's source code check-in.

This commit is contained in:
ptsurbeleu 2011-07-13 16:07:32 -07:00
commit b03b0b373f
4573 changed files with 981205 additions and 0 deletions

View file

@ -0,0 +1,73 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="2CO_Payment.ascx.cs" Inherits="WebsitePanel.Ecommerce.Portal.PaymentMethods._CO_Payment" %>
<div class="FormButtonsBar">
<div class="FormSectionHeader"><asp:Localize runat="server" meta:resourcekey="lclOrderShippingInfo" /></div>
</div>
<div class="FormBody">
<table>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locFirstName" /></td>
<td width="100%"><asp:Literal runat="server" ID="litFirstName" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locLastName" /></td>
<td>
<asp:Literal runat="server" ID="litLastName" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locEmail" /></td>
<td>
<asp:Literal runat="server" ID="litEmail" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclCompanyName" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrCompany" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locAddress" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litAddress" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locPostalCode" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litPostalCode" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locCity" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litCity" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locCountry" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litCountry" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locCountryState" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litState" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locPhoneNumber" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litPhoneNumber" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locFaxNumber" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litFaxNumber" /></td>
</tr>
</table>
</div>

View file

@ -0,0 +1,125 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.Ecommerce.EnterpriseServer;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods
{
public partial class _CO_Payment : ecControlBase, IPaymentMethod
{
#region Public routines
public void CheckSupportedItems(string supportedItems)
{
// nothing to check...
}
public void LoadContractAccount(ContractAccount account)
{
litAddress.Text = account[ContractAccount.ADDRESS];
litCity.Text = account[ContractAccount.CITY];
ltrCompany.Text = account[ContractAccount.COMPANY_NAME];
litCountry.Text = account[ContractAccount.COUNTRY];
litEmail.Text = account[ContractAccount.EMAIL];
litFaxNumber.Text = account[ContractAccount.FAX_NUMBER];
litFirstName.Text = account[ContractAccount.FIRST_NAME];
litLastName.Text = account[ContractAccount.LAST_NAME];
litPhoneNumber.Text = account[ContractAccount.PHONE_NUMBER];
litPostalCode.Text = account[ContractAccount.ZIP];
litState.Text = account[ContractAccount.STATE];
}
public CheckoutDetails GetCheckoutDetails()
{
// nothing to get here...
return null;
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
//
RegisterClientScript();
//
Prepeare2COCheckoutParams();
}
private void RegisterClientScript()
{
// load type
Type typeOf = typeof(_CO_Payment);
// check before
if (!Page.ClientScript.IsClientScriptIncludeRegistered("EcommerceUtils"))
{
Page.ClientScript.RegisterClientScriptInclude("EcommerceUtils",
Page.ClientScript.GetWebResourceUrl(typeOf, "WebsitePanel.Ecommerce.Portal.Scripts.EcommerceUtils.js"));
}
}
private void Prepeare2COCheckoutParams()
{
// setup checkout options
KeyValueBunch options = new KeyValueBunch();
options["target_site"] = EcommerceSettings.AbsoluteAppPath;
// load checkout params
CheckoutFormParams fParams = StorefrontHelper.GetCheckoutFormParams(ecPanelRequest.ContractId,
ecPanelRequest.InvoiceId, ecPanelRequest.PaymentMethod, options);
// register all hidden fields
foreach (string keyName in fParams.GetAllKeys())
{
Page.ClientScript.RegisterHiddenField(keyName, fParams[keyName]);
}
// build bootstrap javascript
string bootstrapJs = String.Format(
"var checkout_form_method = '{0}', checkout_routine_url = '{1}';",
fParams.Method,
fParams.Action
);
// bootstrap checkout form
Page.ClientScript.RegisterStartupScript(
GetType(),
"BootStrapCheckoutForm",
bootstrapJs,
true
);
}
}
}

View file

@ -0,0 +1,121 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.312
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods {
/// <summary>
/// _CO_Payment class.
/// </summary>
/// <remarks>
/// Auto-generated class.
/// </remarks>
public partial class _CO_Payment {
/// <summary>
/// litFirstName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFirstName;
/// <summary>
/// litLastName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litLastName;
/// <summary>
/// litEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litEmail;
/// <summary>
/// ltrCompany control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrCompany;
/// <summary>
/// litAddress control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litAddress;
/// <summary>
/// litPostalCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litPostalCode;
/// <summary>
/// litCity control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litCity;
/// <summary>
/// litCountry control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litCountry;
/// <summary>
/// litState control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litState;
/// <summary>
/// litPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litPhoneNumber;
/// <summary>
/// litFaxNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFaxNumber;
}
}

View file

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lclCompanyName.Text" xml:space="preserve">
<value>Company Name:</value>
</data>
<data name="lclOrderShippingInfo.Text" xml:space="preserve">
<value>Order Shipping Information</value>
</data>
<data name="locAddress.Text" xml:space="preserve">
<value>Address:</value>
</data>
<data name="locCity.Text" xml:space="preserve">
<value>City:</value>
</data>
<data name="locCountry.Text" xml:space="preserve">
<value>Country:</value>
</data>
<data name="locCountryState.Text" xml:space="preserve">
<value>State / Province:</value>
</data>
<data name="locEmail.Text" xml:space="preserve">
<value>E-mail:</value>
</data>
<data name="locFaxNumber.Text" xml:space="preserve">
<value>Fax Number:</value>
</data>
<data name="locFirstName.Text" xml:space="preserve">
<value>First Name:</value>
</data>
<data name="locLastName.Text" xml:space="preserve">
<value>Last Name:</value>
</data>
<data name="locPhoneNumber.Text" xml:space="preserve">
<value>Phone Number:</value>
</data>
<data name="locPostalCode.Text" xml:space="preserve">
<value>ZIP / Postal Code:</value>
</data>
</root>

View file

@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="chkSaveDetails.Text" xml:space="preserve">
<value>I would like to save my billing information</value>
</data>
<data name="lclCountriesLabel.Text" xml:space="preserve">
<value>-- Select Country --</value>
</data>
<data name="lclCreditCardInfo.Text" xml:space="preserve">
<value>Credit Card Information</value>
</data>
<data name="lclOrderShippingInfo.Text" xml:space="preserve">
<value>Order Shipping Information</value>
</data>
<data name="ListLabel.ddlCountry" xml:space="preserve">
<value>&lt;Select country&gt;</value>
</data>
<data name="locAddress.Text" xml:space="preserve">
<value>Address:</value>
</data>
<data name="locCardCode.Text" xml:space="preserve">
<value>CVV2/CVC2/CID:</value>
</data>
<data name="locCardNumber.Text" xml:space="preserve">
<value>Credit Card Number:</value>
</data>
<data name="locCardType.Text" xml:space="preserve">
<value>Credit Card Type:</value>
</data>
<data name="locCity.Text" xml:space="preserve">
<value>City:</value>
</data>
<data name="locCompany.Text" xml:space="preserve">
<value>Company:</value>
</data>
<data name="locCountry.Text" xml:space="preserve">
<value>Country:</value>
</data>
<data name="locEmail.Text" xml:space="preserve">
<value>Email:</value>
</data>
<data name="locExpireDate.Text" xml:space="preserve">
<value>Expiration Date:</value>
</data>
<data name="locFaxNumber.Text" xml:space="preserve">
<value>Fax Number:</value>
</data>
<data name="locFirstName.Text" xml:space="preserve">
<value>First Name:</value>
</data>
<data name="locIssueNumber.Text" xml:space="preserve">
<value>Issue Number:</value>
</data>
<data name="locLastName.Text" xml:space="preserve">
<value>Last Name:</value>
</data>
<data name="locPhoneNumber.Text" xml:space="preserve">
<value>Phone Number:</value>
</data>
<data name="locPostalCode.Text" xml:space="preserve">
<value>ZIP / Postal Code:</value>
</data>
<data name="locStartDate.Text" xml:space="preserve">
<value>Start Date:</value>
</data>
<data name="locState.Text" xml:space="preserve">
<value>State / Province:</value>
</data>
</root>

View file

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lclAddress.Text" xml:space="preserve">
<value>Address:</value>
</data>
<data name="lclCity.Text" xml:space="preserve">
<value>City:</value>
</data>
<data name="lclCompanyName.Text" xml:space="preserve">
<value>Company:</value>
</data>
<data name="lclCountry.Text" xml:space="preserve">
<value>Country:</value>
</data>
<data name="lclEmailAddress.Text" xml:space="preserve">
<value>E-mail:</value>
</data>
<data name="lclFaxNumber.Text" xml:space="preserve">
<value>Fax Number:</value>
</data>
<data name="lclFirstName.Text" xml:space="preserve">
<value>First Name:</value>
</data>
<data name="lclLastName.Text" xml:space="preserve">
<value>Last Name:</value>
</data>
<data name="lclOrderShippingInfo.Text" xml:space="preserve">
<value>Shipping Information</value>
</data>
<data name="lclPhoneNumber.Text" xml:space="preserve">
<value>Phone Number:</value>
</data>
<data name="lclPostalCode.Text" xml:space="preserve">
<value>Zip/Postal Code:</value>
</data>
<data name="lclState.Text" xml:space="preserve">
<value>State:</value>
</data>
</root>

View file

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lclCompanyName.Text" xml:space="preserve">
<value>Company Name:</value>
</data>
<data name="lclHTML.Text" xml:space="preserve">
<value>HTML</value>
</data>
<data name="lclMailFormat.Text" xml:space="preserve">
<value>Mail Format:</value>
</data>
<data name="lclPassword.Text" xml:space="preserve">
<value>Password:</value>
</data>
<data name="lclPlainText.Text" xml:space="preserve">
<value>Plain Text</value>
</data>
<data name="lclSecondaryEmail.Text" xml:space="preserve">
<value>Secondary E-mail:</value>
</data>
<data name="lclUsername.Text" xml:space="preserve">
<value>Username:</value>
</data>
<data name="locAddress.Text" xml:space="preserve">
<value>Address:</value>
</data>
<data name="locCity.Text" xml:space="preserve">
<value>City:</value>
</data>
<data name="locCountry.Text" xml:space="preserve">
<value>Country:</value>
</data>
<data name="locCountryState.Text" xml:space="preserve">
<value>State:</value>
</data>
<data name="locEmail.Text" xml:space="preserve">
<value>E-mail:</value>
</data>
<data name="locFaxNumber.Text" xml:space="preserve">
<value>Fax Number:</value>
</data>
<data name="locFirstName.Text" xml:space="preserve">
<value>First Name:</value>
</data>
<data name="locLastName.Text" xml:space="preserve">
<value>Last Name:</value>
</data>
<data name="locPhoneNumber.Text" xml:space="preserve">
<value>Phone Number:</value>
</data>
<data name="locPostalCode.Text" xml:space="preserve">
<value>ZIP/Postal Code:</value>
</data>
</root>

View file

@ -0,0 +1,192 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CreditCard_Payment.ascx.cs" Inherits="WebsitePanel.Ecommerce.Portal.PaymentMethods.CreditCard_Payment" %>
<div class="FormButtonsBar">
<div class="FormSectionHeader"><asp:Localize runat="server" meta:resourcekey="lclCreditCardInfo" /></div>
</div>
<div class="FormBody">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locCardNumber" meta:resourcekey="locCardNumber" /></td>
<td width="100%">
<asp:TextBox runat="server" ID="txtCreditCard" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtCreditCard"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locCardCode" meta:resourcekey="locCardCode" /></td>
<td>
<asp:TextBox runat="server" ID="txtVerificationCode" Width="100px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtVerificationCode"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locCardType" meta:resourcekey="locCardType" /></td>
<td>
<asp:DropDownList runat="server" ID="ddlCardTypes" AutoPostBack="true"
OnSelectedIndexChanged="ddlCardTypes_SelectedIndexChanged" CssClass="NormalTextBox" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locExpireDate" meta:resourcekey="locExpireDate" /></td>
<td nowrap>
<asp:DropDownList runat="server" ID="ddlExpMonth" CssClass="NormalTextBox">
<asp:ListItem Text="01" Value="01" />
<asp:ListItem Text="02" Value="02" />
<asp:ListItem Text="03" Value="03" />
<asp:ListItem Text="04" Value="04" />
<asp:ListItem Text="05" Value="05" />
<asp:ListItem Text="06" Value="06" />
<asp:ListItem Text="07" Value="07" />
<asp:ListItem Text="08" Value="08" />
<asp:ListItem Text="09" Value="09" />
<asp:ListItem Text="10" Value="10" />
<asp:ListItem Text="11" Value="11" />
<asp:ListItem Text="12" Value="12" />
</asp:DropDownList>&nbsp;/&nbsp;
<asp:DropDownList runat="server" ID="ddlExpYear" CssClass="NormalTextBox" />
</td>
</tr>
<asp:PlaceHolder runat="server" ID="phCardExt" Visible="false">
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locIssueNumber" /></td>
<td nowrap>
<asp:TextBox runat="server" ID="txtIssueNumber" Width="150px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtIssueNumber"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td>
<asp:Localize runat="server" meta:resourcekey="locStartDate" /></td>
<td>
<asp:DropDownList runat="server" ID="ddlStartMonth" CssClass="NormalTextBox">
<asp:ListItem Text="01" Value="01" />
<asp:ListItem Text="02" Value="02" />
<asp:ListItem Text="03" Value="03" />
<asp:ListItem Text="04" Value="04" />
<asp:ListItem Text="05" Value="05" />
<asp:ListItem Text="06" Value="06" />
<asp:ListItem Text="07" Value="07" />
<asp:ListItem Text="08" Value="08" />
<asp:ListItem Text="09" Value="09" />
<asp:ListItem Text="10" Value="10" />
<asp:ListItem Text="11" Value="11" />
<asp:ListItem Text="12" Value="12" />
</asp:DropDownList>&nbsp;/&nbsp;
<asp:DropDownList runat="server" ID="ddlStartYear" CssClass="NormalTextBox" />
</td>
</tr>
</asp:PlaceHolder>
</table>
<br />
<asp:CheckBox runat="server" ID="chkSaveDetails" TextAlign="Right" meta:resourcekey="chkSaveDetails" />
</div>
<div class="FormButtonsBar">
<div class="FormSectionHeader"><asp:Localize runat="server" meta:resourcekey="lclOrderShippingInfo" /></div>
</div>
<div class="FormBody">
<table>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locFirstName" meta:resourcekey="locFirstName" /></td>
<td width="100%">
<asp:TextBox runat="server" ID="txtFirstName" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtFirstName"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locLastName" meta:resourcekey="locLastName" /></td>
<td>
<asp:TextBox runat="server" ID="txtLastName" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtLastName"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locEmail" meta:resourcekey="locEmail" /></td>
<td>
<asp:TextBox runat="server" ID="txtEmail" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtEmail"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locCompany" meta:resourcekey="locCompany" />&nbsp;</td>
<td>
<asp:TextBox runat="server" ID="txtCompany" Width="250px" CssClass="NormalTextBox" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locAddress" meta:resourcekey="locAddress" />&nbsp;</td>
<td>
<asp:TextBox runat="server" ID="txtAddress" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtAddress"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locCity" meta:resourcekey="locCity" />&nbsp;</td>
<td>
<asp:TextBox runat="server" ID="txtCity" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtCity"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locCountry" meta:resourcekey="locCountry" />&nbsp;</td>
<td>
<asp:DropDownList runat="server" ID="ddlCountry" Width="255px" CssClass="NormalTextBox" AutoPostBack="true" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged">
<asp:ListItem Value="" meta:resourcekey="lclCountriesLabel" />
</asp:DropDownList>
<asp:RequiredFieldValidator runat="server" ControlToValidate="ddlCountry"
Display="Dynamic" ErrorMessage="*" CssClass="NormalTextBox" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locState" meta:resourcekey="locState" />&nbsp;</td>
<td>
<asp:TextBox runat="server" ID="txtCountryState" Width="250px" />
<asp:DropDownList runat="server" ID="ddlCountryStates" DataTextField="Text" DataValueField="Value"
CssClass="NormalTextBox" Width="200px" />
<asp:RequiredFieldValidator runat="server" ID="reqCountryState" Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locPostalCode" meta:resourcekey="locPostalCode" />&nbsp;</td>
<td>
<asp:TextBox runat="server" ID="txtPostalCode" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtPostalCode"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locPhoneNumber" meta:resourcekey="locPhoneNumber" />&nbsp;</td>
<td>
<asp:TextBox runat="server" ID="txtPhoneNumber" Width="250px" CssClass="NormalTextBox" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtPhoneNumber"
Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" ID="locFaxNumber" meta:resourcekey="locFaxNumber" />&nbsp;</td>
<td>
<asp:TextBox runat="server" ID="txtFaxNumber" Width="250px" CssClass="NormalTextBox" /></td>
</tr>
</table>
</div>

View file

@ -0,0 +1,317 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.Portal;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Ecommerce.EnterpriseServer;
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods
{
public partial class CreditCard_Payment : ecControlBase, IPaymentMethod
{
#region Public routines
public bool SaveDetailsEnabled
{
get
{
EnsureChildControls();
//
return chkSaveDetails.Visible;
}
set
{
EnsureChildControls();
//
chkSaveDetails.Visible = value;
}
}
public void CheckSupportedItems(string supportedItems)
{
// split
string[] pairs = supportedItems.Split(',');
// format and process
foreach (string pair in pairs)
{
string[] inpair = pair.Split('=');
if (inpair.Length == 2)
ddlCardTypes.Items.Add(new ListItem(inpair[0].Trim(), inpair[1].Trim()));
else
ddlCardTypes.Items.Add(pair.Trim());
}
}
public void LoadContractAccount(ContractAccount account)
{
txtAddress.Text = account[ContractAccount.ADDRESS];
//
txtCity.Text = account[ContractAccount.CITY];
//
txtCompany.Text = account[ContractAccount.COMPANY_NAME];
//
EnsureCountriesLoaded();
//
ecUtils.SelectListItem(ddlCountry, account[ContractAccount.COUNTRY]);
//
EnsureCountryStatesLoad();
//
if (ddlCountryStates.Items.Count > 0)
ecUtils.SelectListItem(ddlCountryStates, account[ContractAccount.STATE]);
else
txtCountryState.Text = account[ContractAccount.STATE];
//
txtEmail.Text = account[ContractAccount.EMAIL];
//
txtPhoneNumber.Text = account[ContractAccount.PHONE_NUMBER];
//
txtFaxNumber.Text = account[ContractAccount.FAX_NUMBER];
//
txtFirstName.Text = account[ContractAccount.FIRST_NAME];
//
txtLastName.Text = account[ContractAccount.LAST_NAME];
//
txtPostalCode.Text = account[ContractAccount.ZIP];
}
public void SetCheckoutDetails(CheckoutDetails details)
{
// setup controls first
EnsureYearsLoaded(ddlExpYear);
//
EnsureCountriesLoaded();
//
EnsureCountryStatesLoad();
// skip display values
if (details == null)
details = new CheckoutDetails();
//
txtCreditCard.Text = details[CheckoutKeys.CardNumber];
//
Utils.SelectListItem(ddlCardTypes, details[CheckoutKeys.CardType]);
//
txtVerificationCode.Text = details[CheckoutKeys.VerificationCode];
//
Utils.SelectListItem(ddlExpYear, details[CheckoutKeys.ExpireYear]);
//
Utils.SelectListItem(ddlExpMonth, details[CheckoutKeys.ExpireMonth]);
//
txtFirstName.Text = details[CheckoutKeys.FirstName];
//
txtLastName.Text = details[CheckoutKeys.LastName];
//
txtEmail.Text = details[CheckoutKeys.CustomerEmail];
//
txtCompany.Text = details[CheckoutKeys.CompanyName];
//
txtAddress.Text = details[CheckoutKeys.Address];
//
txtPostalCode.Text = details[CheckoutKeys.Zip];
//
txtCity.Text = details[CheckoutKeys.City];
//
Utils.SelectListItem(ddlCountry, details[CheckoutKeys.Country]);
//
if (ddlCountryStates.Visible)
Utils.SelectListItem(ddlCountryStates, details[CheckoutKeys.State]);
else
txtCountryState.Text = details[CheckoutKeys.State];
//
txtPhoneNumber.Text = details[CheckoutKeys.Phone];
//
txtFaxNumber.Text = details[CheckoutKeys.Fax];
//
if (phCardExt.Visible)
{
//
EnsureYearsLoaded(ddlStartYear);
//
Utils.SelectListItem(ddlStartYear, details[CheckoutKeys.StartYear]);
//
Utils.SelectListItem(ddlStartMonth, details[CheckoutKeys.StartMonth]);
//
txtIssueNumber.Text = details[CheckoutKeys.IssueNumber];
}
}
public CheckoutDetails GetCheckoutDetails()
{
CheckoutDetails info = new CheckoutDetails();
//
info.Persistent = chkSaveDetails.Checked;
//
info[CheckoutKeys.IPAddress] = Request.UserHostAddress;
//
info[CheckoutKeys.CardNumber] = txtCreditCard.Text.Trim();
//
info[CheckoutKeys.CardType] = ddlCardTypes.SelectedValue;
//
info[CheckoutKeys.VerificationCode] = txtVerificationCode.Text.Trim();
//
info[CheckoutKeys.ExpireMonth] = ddlExpMonth.SelectedValue.Trim();
//
info[CheckoutKeys.ExpireYear] = ddlExpYear.SelectedValue.Trim();
//
info[CheckoutKeys.FirstName] = txtFirstName.Text.Trim();
//
info[CheckoutKeys.LastName] = txtLastName.Text.Trim();
//
info[CheckoutKeys.CustomerEmail] = txtEmail.Text.Trim();
//
info[CheckoutKeys.CompanyName] = txtCompany.Text.Trim();
//
info[CheckoutKeys.Address] = txtAddress.Text.Trim();
//
info[CheckoutKeys.Zip] = txtPostalCode.Text.Trim();
//
info[CheckoutKeys.City] = txtCity.Text.Trim();
//
if (ddlCountryStates.Visible)
info[CheckoutKeys.State] = ddlCountryStates.Text.Trim();
else
info[CheckoutKeys.State] = txtCountryState.Text.Trim();
//
info[CheckoutKeys.Country] = ddlCountry.SelectedValue.Trim();
//
info[CheckoutKeys.Phone] = txtPhoneNumber.Text.Trim();
//
info[CheckoutKeys.Fax] = txtFaxNumber.Text.Trim();
//
if (phCardExt.Visible)
{
//
info[CheckoutKeys.StartMonth] = ddlStartMonth.SelectedValue;
//
info[CheckoutKeys.StartYear] = ddlStartYear.SelectedValue;
//
info[CheckoutKeys.IssueNumber] = txtIssueNumber.Text.Trim();
}
//
return info;
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
// ensure cc payments use SSL
((ecModuleBase)HostModule).EnsurePageIsSecured();
//
if (!IsPostBack)
EnsureYearsLoaded(ddlExpYear);
}
protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
{
LoadCountryStates(ddlCountry.SelectedValue);
}
protected void ddlCardTypes_SelectedIndexChanged(object sender, EventArgs e)
{
ShowExtendedCardFields();
}
private void EnsureCountriesLoaded()
{
if (ddlCountry.Items.Count == 1)
LoadCountries();
}
private void EnsureYearsLoaded(DropDownList list)
{
if (list.Items.Count == 0)
LoadYears(list);
}
private void EnsureCountryStatesLoad()
{
LoadCountryStates(ddlCountry.SelectedValue);
}
private void ShowExtendedCardFields()
{
string cardType = ddlCardTypes.SelectedValue;
if (cardType == "Solo" || cardType == "Switch")
{
// load years
if (ddlStartYear.Items.Count == 0)
LoadYears(ddlStartYear);
//
phCardExt.Visible = true;
}
}
private void LoadYears(DropDownList ctl)
{
int year = DateTime.Now.Year;
for (int i = year; i < year + 5; i++)
ctl.Items.Add(new ListItem(i.ToString(), i.ToString()));
}
private void LoadCountryStates(string countryCode)
{
PortalUtils.LoadStatesDropDownList(ddlCountryStates, countryCode);
//
if (ddlCountryStates.Items.Count > 0)
{
txtCountryState.Visible = false;
ddlCountryStates.Visible = true;
reqCountryState.ControlToValidate = ddlCountryStates.ID;
}
else
{
txtCountryState.Visible = true;
ddlCountryStates.Visible = false;
reqCountryState.ControlToValidate = txtCountryState.ID;
}
}
private void LoadCountries()
{
PortalUtils.LoadCountriesDropDownList(ddlCountry, "");
}
}
}

View file

@ -0,0 +1,357 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods {
public partial class CreditCard_Payment {
/// <summary>
/// locCardNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locCardNumber;
/// <summary>
/// txtCreditCard control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtCreditCard;
/// <summary>
/// locCardCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locCardCode;
/// <summary>
/// txtVerificationCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtVerificationCode;
/// <summary>
/// locCardType control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locCardType;
/// <summary>
/// ddlCardTypes control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlCardTypes;
/// <summary>
/// locExpireDate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locExpireDate;
/// <summary>
/// ddlExpMonth control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlExpMonth;
/// <summary>
/// ddlExpYear control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlExpYear;
/// <summary>
/// phCardExt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.PlaceHolder phCardExt;
/// <summary>
/// txtIssueNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtIssueNumber;
/// <summary>
/// ddlStartMonth control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlStartMonth;
/// <summary>
/// ddlStartYear control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlStartYear;
/// <summary>
/// chkSaveDetails control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkSaveDetails;
/// <summary>
/// locFirstName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locFirstName;
/// <summary>
/// txtFirstName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFirstName;
/// <summary>
/// locLastName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locLastName;
/// <summary>
/// txtLastName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtLastName;
/// <summary>
/// locEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locEmail;
/// <summary>
/// txtEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtEmail;
/// <summary>
/// locCompany control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locCompany;
/// <summary>
/// txtCompany control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtCompany;
/// <summary>
/// locAddress control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locAddress;
/// <summary>
/// txtAddress control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtAddress;
/// <summary>
/// locCity control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locCity;
/// <summary>
/// txtCity control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtCity;
/// <summary>
/// locCountry control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locCountry;
/// <summary>
/// ddlCountry control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlCountry;
/// <summary>
/// locState control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locState;
/// <summary>
/// txtCountryState control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtCountryState;
/// <summary>
/// ddlCountryStates control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlCountryStates;
/// <summary>
/// reqCountryState control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator reqCountryState;
/// <summary>
/// locPostalCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locPostalCode;
/// <summary>
/// txtPostalCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPostalCode;
/// <summary>
/// locPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locPhoneNumber;
/// <summary>
/// txtPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPhoneNumber;
/// <summary>
/// locFaxNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locFaxNumber;
/// <summary>
/// txtFaxNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFaxNumber;
}
}

View file

@ -0,0 +1,73 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Offline_Payment.ascx.cs" Inherits="WebsitePanel.Ecommerce.Portal.PaymentMethods.Offline_Payment" %>
<div class="FormButtonsBar">
<div class="FormSectionHeader"><asp:Localize runat="server" meta:resourcekey="lclOrderShippingInfo" /></div>
</div>
<div class="FormBody">
<table>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclFirstName" /></td>
<td width="100%"><asp:Literal runat="server" ID="ltrFirstName" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclLastName" /></td>
<td>
<asp:Literal runat="server" ID="ltrLastName" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclEmailAddress" /></td>
<td>
<asp:Literal runat="server" ID="ltrEmail" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclCompanyName" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrCompany" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclAddress" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrAddress" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclPostalCode" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrPostalCode" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclCity" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrCity" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclCountry" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrCountry" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclState" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrState" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclPhoneNumber" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrPhoneNumber" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclFaxNumber" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrFaxNumber" /></td>
</tr>
</table>
</div>

View file

@ -0,0 +1,81 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Ecommerce.EnterpriseServer;
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods
{
public partial class Offline_Payment : ecControlBase, IPaymentMethod
{
protected void Page_Load(object sender, EventArgs e)
{
}
#region IPaymentMethod Members
public void CheckSupportedItems(string supportedItems)
{
// do nothing
}
public void LoadContractAccount(ContractAccount account)
{
ltrFirstName.Text = account[ContractAccount.FIRST_NAME];
ltrLastName.Text = account[ContractAccount.LAST_NAME];
ltrEmail.Text = account[ContractAccount.EMAIL];
ltrCompany.Text = account[ContractAccount.COMPANY_NAME];
ltrAddress.Text = account[ContractAccount.ADDRESS];
ltrPostalCode.Text = account[ContractAccount.ZIP];
ltrCity.Text = account[ContractAccount.CITY];
ltrState.Text = account[ContractAccount.STATE];
ltrCountry.Text = account[ContractAccount.COUNTRY];
ltrPhoneNumber.Text = account[ContractAccount.PHONE_NUMBER];
ltrFaxNumber.Text = account[ContractAccount.FAX_NUMBER];
}
public CheckoutDetails GetCheckoutDetails()
{
return new CheckoutDetails();
}
#endregion
}
}

View file

@ -0,0 +1,121 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.312
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods {
/// <summary>
/// Offline_Payment class.
/// </summary>
/// <remarks>
/// Auto-generated class.
/// </remarks>
public partial class Offline_Payment {
/// <summary>
/// ltrFirstName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrFirstName;
/// <summary>
/// ltrLastName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrLastName;
/// <summary>
/// ltrEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrEmail;
/// <summary>
/// ltrCompany control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrCompany;
/// <summary>
/// ltrAddress control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrAddress;
/// <summary>
/// ltrPostalCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrPostalCode;
/// <summary>
/// ltrCity control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrCity;
/// <summary>
/// ltrCountry control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrCountry;
/// <summary>
/// ltrState control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrState;
/// <summary>
/// ltrPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrPhoneNumber;
/// <summary>
/// ltrFaxNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrFaxNumber;
}
}

View file

@ -0,0 +1,73 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PPAccount_Payment.ascx.cs" Inherits="WebsitePanel.Ecommerce.Portal.PaymentMethods.PPAccount_Payment" %>
<div class="FormButtonsBar">
<div class="FormSectionHeader"><asp:Localize runat="server" meta:resourcekey="lclOrderShippingInfo" /></div>
</div>
<div class="FormBody">
<table>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locFirstName" /></td>
<td width="100%"><asp:Literal runat="server" ID="litFirstName" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locLastName" /></td>
<td>
<asp:Literal runat="server" ID="litLastName" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locEmail" /></td>
<td>
<asp:Literal runat="server" ID="litEmail" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="lclCompanyName" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="ltrCompany" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locAddress" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litAddress" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locPostalCode" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litPostalCode" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locCity" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litCity" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locCountry" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litCountry" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locCountryState" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litState" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locPhoneNumber" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litPhoneNumber" /></td>
</tr>
<tr>
<td nowrap>
<asp:Localize runat="server" meta:resourcekey="locFaxNumber" />&nbsp;</td>
<td>
<asp:Literal runat="server" ID="litFaxNumber" /></td>
</tr>
</table>
</div>

View file

@ -0,0 +1,125 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.Ecommerce.EnterpriseServer;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods
{
public partial class PPAccount_Payment : ecControlBase, IPaymentMethod
{
#region IPaymentMethod Members
public void CheckSupportedItems(string supportedItems)
{
// nothing to check...
}
public void LoadContractAccount(ContractAccount account)
{
litAddress.Text = account[ContractAccount.ADDRESS];
litCity.Text = account[ContractAccount.CITY];
ltrCompany.Text = account[ContractAccount.COMPANY_NAME];
litCountry.Text = account[ContractAccount.COUNTRY];
litEmail.Text = account[ContractAccount.EMAIL];
litFaxNumber.Text = account[ContractAccount.FAX_NUMBER];
litFirstName.Text = account[ContractAccount.FIRST_NAME];
litLastName.Text = account[ContractAccount.LAST_NAME];
litPhoneNumber.Text = account[ContractAccount.PHONE_NUMBER];
litPostalCode.Text = account[ContractAccount.ZIP];
litState.Text = account[ContractAccount.STATE];
}
public CheckoutDetails GetCheckoutDetails()
{
// nothing to get here...
return null;
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
//
RegisterClientScript();
//
PrepearePayPalCheckoutParams();
}
private void RegisterClientScript()
{
// load type
Type typeOf = typeof(PPAccount_Payment);
// check before
if (!Page.ClientScript.IsClientScriptIncludeRegistered("EcommerceUtils"))
{
Page.ClientScript.RegisterClientScriptInclude("EcommerceUtils",
Page.ClientScript.GetWebResourceUrl(typeOf, "WebsitePanel.Ecommerce.Portal.Scripts.EcommerceUtils.js"));
}
}
private void PrepearePayPalCheckoutParams()
{
// setup checkout options
KeyValueBunch options = new KeyValueBunch();
options["target_site"] = EcommerceSettings.AbsoluteAppPath;
// load checkout params
CheckoutFormParams fParams = StorefrontHelper.GetCheckoutFormParams(ecPanelRequest.ContractId,
ecPanelRequest.InvoiceId, ecPanelRequest.PaymentMethod, options);
// register all hidden fields
foreach (string keyName in fParams.GetAllKeys())
{
Page.ClientScript.RegisterHiddenField(keyName, fParams[keyName]);
}
// build bootstrap javascript
string bootstrapJs = String.Format(
"var checkout_form_method = '{0}', checkout_routine_url = '{1}';",
fParams.Method,
fParams.Action
);
// bootstrap checkout form
Page.ClientScript.RegisterStartupScript(
GetType(),
"BootStrapCheckoutForm",
bootstrapJs,
true
);
}
}
}

View file

@ -0,0 +1,121 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.312
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Ecommerce.Portal.PaymentMethods {
/// <summary>
/// PPAccount_Payment class.
/// </summary>
/// <remarks>
/// Auto-generated class.
/// </remarks>
public partial class PPAccount_Payment {
/// <summary>
/// litFirstName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFirstName;
/// <summary>
/// litLastName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litLastName;
/// <summary>
/// litEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litEmail;
/// <summary>
/// ltrCompany control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal ltrCompany;
/// <summary>
/// litAddress control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litAddress;
/// <summary>
/// litPostalCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litPostalCode;
/// <summary>
/// litCity control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litCity;
/// <summary>
/// litCountry control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litCountry;
/// <summary>
/// litState control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litState;
/// <summary>
/// litPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litPhoneNumber;
/// <summary>
/// litFaxNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFaxNumber;
}
}