Table of Contents

Class Payment

Namespace
Dynamicweb.Ecommerce.Orders
Assembly
Dynamicweb.Ecommerce.dll
Represents information about a payment method
[Serializable]
public class Payment
Inheritance
Payment
Inherited Members

Constructors

Payment()

Initializes a new instance of the Payment class.
public Payment()

Payment(IDataReader)

Initializes a new instance of the Payment class from data reader.
[Obsolete("Use Services.Payments.GetPayment(String, String) instead.")]
public Payment(IDataReader dataReader)

Parameters

dataReader IDataReader
The data reader.

Payment(string)

Initializes a new instance of the Payment class from database by ID.
[Obsolete("Use Services.Payments.GetPayment(String, String) instead.")]
public Payment(string paymentId)

Parameters

paymentId string
The ID STR.

Payment(string, string)

Initializes a new instance of the Payment class from database by key.
[Obsolete("Use Services.Payments.GetPayment(String, String) instead.")]
public Payment(string paymentId, string theLanguageId)

Parameters

paymentId string
The ID STR.
theLanguageId string
The Language code.

Properties

Active

Gets or sets the value indicating whether instance is active.
public bool Active { get; set; }

Property Value

bool

AllowAnonymousUsers

Gets or sets a value indicating whether the Payment is available to anonymous users.
public bool AllowAnonymousUsers { get; set; }

Property Value

bool
true if payment is available to anonymous users; otherwise, false.

CaptureObject

Gets the capture object.
public IRemoteCapture CaptureObject { get; }

Property Value

IRemoteCapture
The capture object.

CheckoutParameters

Gets or sets the checkout parameters.
public string CheckoutParameters { get; set; }

Property Value

string
The checkout parameters.

CheckoutSystemName

Gets or sets the system name of the checkout addIn .
public string CheckoutSystemName { get; set; }

Property Value

string
The system name of the checkout addIn.

Code

Gets or sets the code.
public string Code { get; set; }

Property Value

string

CountryId

Gets or sets the country ID.
[Obsolete("Use CountryRelation instead.")]
public string CountryId { get; set; }

Property Value

string
The country ID.

CountryRelation

Gets or sets the country relation.
[Obsolete("Use Services.CountryRelations.GetCountryRelation instead.")]
public CountryRelation CountryRelation { get; set; }

Property Value

CountryRelation
The country relation.

Description

Gets or sets the description.
[Obsolete("Use GetDescription and SetDescription instead.")]
public string Description { get; set; }

Property Value

string

GatewayId

Gets or sets the gateway ID.
public string GatewayId { get; set; }

Property Value

string
The gateway ID.

GatewayParameters

Gets or sets the gateway parameters.
public string GatewayParameters { get; set; }

Property Value

string
The gateway parameters.

Icon

Gets or sets the icon file name.
public string Icon { get; set; }

Property Value

string
The icon.

IconImage

Gets the full path to icon image.
[Obsolete("Use Icon or IconOrderList instead.")]
public string IconImage { get; }

Property Value

string
The icon image.

IconOrderList

Gets or sets the icon file name for order list.
public string IconOrderList { get; set; }

Property Value

string
The icon order list.

Id

Gets or sets the ID.
public string Id { get; set; }

Property Value

string
The ID.

IsDefault

Gets or sets a value indicating whether this payment method is default.
[Obsolete("Use CountryRelation instead.")]
public bool IsDefault { get; set; }

Property Value

bool
true if this payment method is default; otherwise, false.

LanguageId

Gets or sets the language id.
[Obsolete("Use Translations instead.")]
public string LanguageId { get; set; }

Property Value

string

Name

Gets or sets the name.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }

Property Value

string

PaymentAddInType

Gets or sets the type of the addIn.
public PaymentAddInTypes PaymentAddInType { get; set; }

Property Value

PaymentAddInTypes
The type of the addIn.

Sorting

Sort order of current group inside parent group's children collection
public int Sorting { get; set; }

Property Value

int

TermsCode

Gets or sets the payment terms code.
public string TermsCode { get; set; }

Property Value

string

Translations

Gets the translations
public TranslationCollection<PaymentTranslation> Translations { get; }

Property Value

TranslationCollection<PaymentTranslation>

UserGroups

Gets or sets to whom user groups the payment is shown.
public IEnumerable<int> UserGroups { get; set; }

Property Value

IEnumerable<int>

Methods

ClearCache()

Clear cached payments
[Obsolete("Use Services.Payments.ClearCache() instead.")]
public static void ClearCache()

Clone()

Clones this instance.
public Payment Clone()

Returns

Payment

Copy()

Copies this instance.
[Obsolete("This method is not used")]
public Payment Copy()

Returns

Payment

Examples

class MyPage : System.Web.UI.Page
{
private Payment payment;
public Payment DoSave()
{
Payment thePayment = new Payment();
thePayment = payment.Copy();
return thePayment;
}
}

Delete()

Deletes this payment.
[Obsolete("Use Services.Payments.Delete(String, String) instead.")]
public void Delete()

Examples

Delete line with payment method on the page
class MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");

if(CMD == "DeletePaymentLine")
{
String  paymentID = Converter.ToString(HttpContext.Current.Request.QueryString("PaymentID"));
Payment thePayment = new Payment(paymentID);
thePayment.Delete();
}
}
}

Delete(string)

Deletes the payment with specified ID.
[Obsolete("Use Services.Payments.Delete(String, String) instead.")]
public void Delete(string paymentId)

Parameters

paymentId string
The payment ID.

Examples

Delete line with payment method on the page
class MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");

if(CMD == "DeletePaymentLine")
{
String  paymentID = Converter.ToString(HttpContext.Current.Request.QueryString("PaymentID"));
Payment thePayment = new Payment();
thePayment.Delete(paymentID);
}
}
}

Delete(string, string)

Deletes the payment with specified ID and language
[Obsolete("Use Services.Payments.Delete(String, String) instead.")]
public void Delete(string paymentId, string theLanguageId)

Parameters

paymentId string
The payment ID.
theLanguageId string
The language id.

Examples

Delete line with payment method on the page
class MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");

if(CMD == "DeletePaymentLine")
{
String  paymentID = Converter.ToString(HttpContext.Current.Request.QueryString("PaymentID"));
Payment thePayment = new Payment();
thePayment.Delete(paymentID, "DK");
}
}
}

DeleteByLanguage(string)

Deletes items by language.
[Obsolete("This method is not used")]
public void DeleteByLanguage(string theLanguageId)

Parameters

theLanguageId string
The language ID.

Examples

Delete line with payment method on the page
class MyPage : System.Web.UI.Page
{
private void Page_Load(System.Object sender, System.EventArgs e)
{
String CMD = HttpContext.Current.Request.QueryString("CMD");

if(CMD == "DeletePayments")
{
String  languageID = Converter.ToString(HttpContext.Current.Request.QueryString("LanguageID"));
Payment thePayment = new Payment();
thePayment.Delete(languageID);
}
}
}

get_CountryRelation(string)

Gets or sets the country relation.
[Obsolete("Use GetCountryRelation instead.")]
public CountryRelation get_CountryRelation(string theCountryId)

Parameters

theCountryId string

Returns

CountryRelation
The country relation.

GetCountryRelation(string)

Gets the country relation.
[Obsolete("Use Services.CountryRelations.GetCountryRelation instead.")]
public CountryRelation GetCountryRelation(string theCountryId)

Parameters

theCountryId string
The country id

Returns

CountryRelation

GetDefaultPaymentMethod(string)

Gets the default payment method.
[Obsolete("Use Services.Payments.GetDefaultPaymentMethod(String, String) instead.")]
public static Payment GetDefaultPaymentMethod(string countryCode)

Parameters

countryCode string
The country code.

Returns

Payment

GetDescription(string)

Gets the description of the payment for the given language.
public string GetDescription(string languageId)

Parameters

languageId string

Returns

string

GetName(string)

Gets the name of the payment for the given language.
public string GetName(string languageId)

Parameters

languageId string

Returns

string

GetPaymentMethods()

Gets the payment methods that has relation to any country.
[Obsolete("Use Services.Payments.GetPayments(String) instead.")]
public static PaymentCollection GetPaymentMethods()

Returns

PaymentCollection

Examples

public String GetPaymentData()
{
PaymentCollection dwPay = Payment.getPaymethods();

return GetPaymentData( dwPay );
}

GetPaymentMethods(bool)

Gets the payment methods that has relation to any country, if joinCountryRelations parameter is true. Otherwise gets all pay methods.
[Obsolete("Use Services.Payments.GetPayments(String) or Services.Payments.GetPaymentsWithoutRegions(String) instead.")]
public static PaymentCollection GetPaymentMethods(bool joinCountryRelations)

Parameters

joinCountryRelations bool
if set to true [join country relations].

Returns

PaymentCollection

Examples

public String GetAllShippingData()
{
PaymentCollection dwPay = Payment.getPaymethods(false);

return GetPaymentData( dwPay );
}

GetPaymentMethods(string)

Gets the payment methods with the suitable country code.
[Obsolete("Use Services.Payments.GetPayments(String, String) instead.")]
public static PaymentCollection GetPaymentMethods(string countryCode)

Parameters

countryCode string
The country code.

Returns

PaymentCollection

Examples

public String GetPaymentMethodsForOrder(Order order)
{
PaymentCollection dwPay = Payment.getPaymethods( order.FeeCountryCode("PAY") );

return GetPaymentData( dwPay );
}

GetPaymentMethods(string, string)

Gets the payment methods with the suitable country code and pay method ID.
[Obsolete("Use Services.Payments.GetPayments(String, String, String) instead.")]
public static PaymentCollection GetPaymentMethods(string countryCode, string paymentIds)

Parameters

countryCode string
The country code.
paymentIds string
The pay methods ID, separated by comma.

Returns

PaymentCollection

Examples

public String GetPaymentMethodsForOrder(Order order)
{
PaymentCollection dwPay = Payment.getPaymethods( order.FeeCountryCode("PAY"), order.PaymentMethodID );

return GetPaymentData( dwPay );
}

GetPaymentMethods(string, string, string)

Gets the payment methods with the suitable country code, region code and pay method ID.
[Obsolete("Use Services.Payments.GetPayments(String, String, String) instead.")]
public static PaymentCollection GetPaymentMethods(string countryCode, string regionCode, string paymentIds)

Parameters

countryCode string
The country code.
regionCode string
The region/state code.
paymentIds string
The pay methods ID, separated by comma.

Returns

PaymentCollection

Examples

public String GetPaymentMethodsForOrder(Order order)
{
PaymentCollection dwPay = Payment.getPaymethods( order.FeeCountryCode("PAY"), order.PaymentMethodID );

return GetPaymentData( dwPay );
}

GetPaymethodsByRegion(string, string)

Gets the payment methods with the suitable country code AND region code.
[Obsolete("Use Services.Payments.GetPayments(String, String, String) instead.")]
public static PaymentCollection GetPaymethodsByRegion(string countryCode, string regionCode)

Parameters

countryCode string
The country code.
regionCode string
The region/state code.

Returns

PaymentCollection

Examples

public String GetPaymentMethodsForOrder(Order order)
{
PaymentCollection dwPay = Payment.getPaymethodsByRegion( order.FeeCountryCode("PAY"), order.FeeRegionCode("PAY", order.FeeCountryCode("PAY")) );

return GetPaymentData( dwPay );
}

GetTermsDescription(string)

Gets the terms description of the payment for the given language.
public string GetTermsDescription(string languageId)

Parameters

languageId string

Returns

string

Save(string)

Saves payment. If payment with specified ID is exist, it will be overwritten
[Obsolete("Use Services.Payments.Save(Payment) instead.")]
public void Save(string paymentId)

Parameters

paymentId string
The payment id.

Examples

public void SaveDefaultPaymentData()
{
Payment pay = new Payment();
pay.SetProperties();
pay.Save( pay.ID );
}

set_CountryRelation(string, CountryRelation)

[Obsolete("Use SetCountryRelation instead.")]
public void set_CountryRelation(string theCountryId, CountryRelation value)

Parameters

theCountryId string
value CountryRelation

SetCountryRelation(CountryRelation)

Sets the country relation
[Obsolete("Do not use this.")]
public void SetCountryRelation(CountryRelation countryRelation)

Parameters

countryRelation CountryRelation
The country relation value

SetDescription(string, string)

Sets the description of the payment for the given language.
public void SetDescription(string languageId, string description)

Parameters

languageId string
description string

SetName(string, string)

Sets the name of the payment for the given language.
public void SetName(string languageId, string name)

Parameters

languageId string
name string

SetProperties()

Sets the default properties.
[Obsolete("This method is needed only for old API")]
public void SetProperties()

Examples

public void SaveDefaultPaymentData()
{
Payment paym = new Payment();
paym.SetProperties();
paym.Save( paym.ID );
}

SetTermsDescription(string, string)

Sets the terms description of the payment for the given language.
public void SetTermsDescription(string languageId, string termsDescription)

Parameters

languageId string
termsDescription string
To top