Account Service - PaySimple/PaySimpleSDK GitHub Wiki

Home | Account Service | Customer Service | Payment Service | Payment Schedule Service | PagedResult | Exceptions

Account Service

The Account Service is used to create, get, update and delete Payment Accounts. The SDK provides the following methods:

  • CreateAccountAsync
  • CreateAchAccountAsync
  • CreateCreditCardAccountAsync
  • DeleteAchAccountAsync
  • DeleteCreditCardAccountAsync
  • GetAchAccountAsync
  • GetCreditCardAccountAsync
  • UpdateAchAccountAsync
  • UpdateCreditCardAccountAsync

Constructor

Parameters:

Parameter Name Type Description Notes
settings IPaySimpleSdkSettings SDK Settings

Example:

var settings = new PaySimpleSettings("AoOtRylA63570WmH3eqChyFRqwhTnA2g0dnsV7zzQko4s4yKWdBorA1WiT7dK2H2xz06P562Hqv0heYBdfNamfQyxX50drtpL8s7", "AUserName");
var accountService = new AccountService(settings);

Service Methods


CreateAccountAsync

CreateAccountAsync is a convenience method that will create a new Ach or CreditCard Account

Parameters:

Parameter Name Type Description Notes
account T Account to create T must be either Ach or CreditCard

Returns:

T

Example:

var creditCard = new CreditCard
{
	CustomerId = 123456,
	CreditCardNumber = "4111111111111111",
	ExpirationDate = "12/2021",
	Issuer = Issuer.Visa
};

var account = await accountService.CreateAccountAsync<CreditCard>(creditCard);

// -- OR --

var ach = new Ach
{
	CustomerId = 123456,
	RoutingNumber = "131111114",
	AccountNumber = "751111111",
	BankName = "PaySimple Bank",
	IsCheckingAccount = true
};

var account = await accountService.CreateAccountAsync<Ach>(ach);

CreateAchAccountAsync

CreateAchAccountAsync creates a new Ach Account

Parameters:

Parameter Name Type Description Notes
account Ach Ach Account to create

Returns:

Ach

Example:

var ach = new Ach
{
	CustomerId = 123456,
	RoutingNumber = "131111114",
	AccountNumber = "751111111",
	BankName = "PaySimple Bank",
	IsCheckingAccount = true
};

var account = await accountService.CreateAchAccountAsync(ach);

CreateCreditCardAccountAsync

CreateCreditCardAccountAsync creates a new CreditCard Account

Parameters:

Parameter Name Type Description Notes
account CreditCard Credit Card Account to create

Returns:

CreditCard

Example:

var creditCard = new CreditCard
{
	CustomerId = 123456,
	CreditCardNumber = "4111111111111111",
	ExpirationDate = "12/2021",
	Issuer = Issuer.Visa
};

var account = await accountService.CreateCreditCardAccountAsync(creditCard);

DeleteAchAccountAsync

DeleteAchAccountAsync deletes an existing Ach Account

Parameters:

Parameter Name Type Description Notes
accountId int Id of the account to delete

Example:

await accountService.DeleteAchAccountAsync(123456);

DeleteCreditCardAccountAsync

DeleteCreditCardAccountAsync deletes an existing Credit Card Account

Parameters:

Parameter Name Type Description Notes
accountId int Id of the account to delete

Example:

await accountService.DeleteCreditCardAccountAsync(123456);

GetAchAccountAsync

GetAchAccountAsync gets an existing Ach Account

Parameters:

Parameter Name Type Description Notes
accountId int Id of the account to get

Returns:

Ach

Example:

await accountService.GetAchAccountAsync(123456);

GetCreditCardAccountAsync

GetCreditCardAccountAsync gets an existing Credit Card Account

Parameters:

Parameter Name Type Description Notes
accountId int Id of the account to get

Returns:

CreditCard

Example:

await accountService.GetCreditCardAccountAsync(123456);

UpdateAchAccountAsync

UpdateAchAccountAsync updates an existing Ach Account

Parameters:

Parameter Name Type Description Notes
account Ach Ach Account to update

Returns:

Ach

Example:

var ach = new Ach
{
	Id = 123456,
	CustomerId = 654321,
	RoutingNumber = "131111114",
	AccountNumber = "751111111",
	BankName = "PaySimple Bank",
	IsCheckingAccount = false
};

var account = await accountService.UpdateAchAccountAsync(ach);

UpdateCreditCardAccountAsync

UpdateCreditCardAccountAsync updates an existing CreditCard Account

Parameters:

Parameter Name Type Description Notes
account CreditCard Credit Card Account to update

Returns:

CreditCard

Example:

var creditCard = new CreditCard
{
	Id = 123456,
	CustomerId = 123456,
	CreditCardNumber = "4111111111111111",
	ExpirationDate = "12/2024",
	Issuer = Issuer.Visa
};

var account = await accountService.UpdateCreditCardAccountAsync(creditCard);
⚠️ **GitHub.com Fallback** ⚠️