C# Class SaasEcom.Core.Infrastructure.PaymentProcessor.Stripe.CardProvider

Implementation for CRUD related to credit cards with Stripe and also saves the details in the database.
Inheritance: ICardProvider
Mostrar archivo Open project: pedropaf/saas-ecom

Public Methods

Method Description
AddAsync ( SaasEcom.Core.Models.SaasEcomUser user, CreditCard card ) : System.Threading.Tasks.Task

Adds the credit card asynchronous.

CardBelongToUser ( int cardId, string userId ) : Task

Check if the Card belong to user.

CardProvider ( string apiKey, ICardDataService cardDataService ) : System.Collections.Generic

Initializes a new instance of the CardProvider class.

DeleteAsync ( string customerId, string custStripeId, int cardId ) : System.Threading.Tasks.Task

Deletes the credit card asynchronous.

FindAsync ( string customerId, int cardId ) : Task

Finds the credit card asynchronous.

GetAllAsync ( string customerId ) : Task>

Gets all the credit cards asynchronous.

UpdateAsync ( SaasEcom.Core.Models.SaasEcomUser user, CreditCard creditcard ) : System.Threading.Tasks.Task

Updates the credit card asynchronous.

Private Methods

Method Description
AddCardToStripe ( CreditCard card, string stripeCustomerId ) : StripeCard

Method Details

AddAsync() public method

Adds the credit card asynchronous.
public AddAsync ( SaasEcom.Core.Models.SaasEcomUser user, CreditCard card ) : System.Threading.Tasks.Task
user SaasEcom.Core.Models.SaasEcomUser The user.
card CreditCard The card.
return System.Threading.Tasks.Task

CardBelongToUser() public method

Check if the Card belong to user.
public CardBelongToUser ( int cardId, string userId ) : Task
cardId int The card identifier.
userId string The user identifier.
return Task

CardProvider() public method

Initializes a new instance of the CardProvider class.
public CardProvider ( string apiKey, ICardDataService cardDataService ) : System.Collections.Generic
apiKey string The API key.
cardDataService ICardDataService The card data service.
return System.Collections.Generic

DeleteAsync() public method

Deletes the credit card asynchronous.
public DeleteAsync ( string customerId, string custStripeId, int cardId ) : System.Threading.Tasks.Task
customerId string The customer identifier.
custStripeId string The customer stripe identifier.
cardId int The Card identifier.
return System.Threading.Tasks.Task

FindAsync() public method

Finds the credit card asynchronous.
public FindAsync ( string customerId, int cardId ) : Task
customerId string The customer identifier.
cardId int The card identifier.
return Task

GetAllAsync() public method

Gets all the credit cards asynchronous.
public GetAllAsync ( string customerId ) : Task>
customerId string The customer identifier.
return Task>

UpdateAsync() public method

Updates the credit card asynchronous.
public UpdateAsync ( SaasEcom.Core.Models.SaasEcomUser user, CreditCard creditcard ) : System.Threading.Tasks.Task
user SaasEcom.Core.Models.SaasEcomUser The user.
creditcard CreditCard The creditcard.
return System.Threading.Tasks.Task