Class PaymentCardService
- Namespace
- Dynamicweb.Ecommerce.Cart
- Assembly
- Dynamicweb.Ecommerce.dll
public class PaymentCardService
- Inheritance
-
PaymentCardService
- Inherited Members
Methods
CreatePaymentCard(int, string, string, string, string, string)
Save card token for specified user.
public PaymentCardToken CreatePaymentCard(int userId, string paymentId, string cardName, string cardType, string cardIdentifier, string cardToken)
Parameters
userId
int- The id of user
paymentId
string- The id of payment gateway
cardName
stringcardType
stringcardIdentifier
stringcardToken
string
Returns
CreatePaymentCard(int, string, string, string, string, string, string)
Save card token for specified user.
[Obsolete("Use the overload without languageId.")]
public PaymentCardToken CreatePaymentCard(int userId, string paymentId, string languageId, string cardName, string cardType, string cardIdentifier, string cardToken)
Parameters
userId
int- The id of user
paymentId
string- The id of payment gateway
languageId
string- The language id
cardName
stringcardType
stringcardIdentifier
stringcardToken
string
Returns
Delete(PaymentCardToken)
Deletes the paymentCard.
public void Delete(PaymentCardToken paymentCard)
Parameters
paymentCard
PaymentCardToken
GetByCustomerNumber(string)
Retrieve cards by user customer number
public IEnumerable<PaymentCardToken> GetByCustomerNumber(string customerNumber)
Parameters
customerNumber
string- The user customer number
Returns
GetById(int)
Retrieve payment card by id.
public PaymentCardToken GetById(int paymentCardId)
Parameters
paymentCardId
int- The id of payment card.
Returns
GetByUserId(int)
Retrieve cards for an user.
public IEnumerable<PaymentCardToken> GetByUserId(int userId)
Parameters
userId
int- The id of user.
Returns
GetByUserId(int, string)
Retrieve payment cards for an user for specified payment id.
public IEnumerable<PaymentCardToken> GetByUserId(int userId, string paymentId)
Parameters
Returns
GetByUserId(int, string, string)
Retrieve payment cards for an user for specified payment id and language id.
[Obsolete("Use the overload without languageId.")]
public IEnumerable<PaymentCardToken> GetByUserId(int userId, string paymentId, string languageId)
Parameters
userId
int- The id of the user.
paymentId
string- The id of the payment.
languageId
string- The language id.
Returns
Save(PaymentCardToken)
Saves current data to the database.
public void Save(PaymentCardToken paymentCard)
Parameters
paymentCard
PaymentCardToken
SetDefaultPaymentCard(int, int, bool)
mark\unmark payment card as default for the user.
public void SetDefaultPaymentCard(int userId, int paymentCardId, bool isDefault)
Parameters
userId
int- The id of user
paymentCardId
int- The id of payment card PaymentCardToken
isDefault
booltrue
if the token should be default;false
otherwise.