Account Service - PaySimple/PaySimpleSDK GitHub Wiki
Home | Account Service | Customer Service | Payment Service | Payment Schedule Service | PagedResult | Exceptions
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
Parameter Name | Type | Description | Notes |
---|---|---|---|
settings | IPaySimpleSdkSettings | SDK Settings |
var settings = new PaySimpleSettings("AoOtRylA63570WmH3eqChyFRqwhTnA2g0dnsV7zzQko4s4yKWdBorA1WiT7dK2H2xz06P562Hqv0heYBdfNamfQyxX50drtpL8s7", "AUserName");
var accountService = new AccountService(settings);
CreateAccountAsync is a convenience method that will create a new Ach or CreditCard Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
account | T | Account to create | T must be either Ach or CreditCard |
T
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 creates a new Ach Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
account | Ach | Ach Account to create |
Ach
var ach = new Ach
{
CustomerId = 123456,
RoutingNumber = "131111114",
AccountNumber = "751111111",
BankName = "PaySimple Bank",
IsCheckingAccount = true
};
var account = await accountService.CreateAchAccountAsync(ach);
CreateCreditCardAccountAsync creates a new CreditCard Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
account | CreditCard | Credit Card Account to create |
CreditCard
var creditCard = new CreditCard
{
CustomerId = 123456,
CreditCardNumber = "4111111111111111",
ExpirationDate = "12/2021",
Issuer = Issuer.Visa
};
var account = await accountService.CreateCreditCardAccountAsync(creditCard);
DeleteAchAccountAsync deletes an existing Ach Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
accountId | int | Id of the account to delete |
await accountService.DeleteAchAccountAsync(123456);
DeleteCreditCardAccountAsync deletes an existing Credit Card Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
accountId | int | Id of the account to delete |
await accountService.DeleteCreditCardAccountAsync(123456);
GetAchAccountAsync gets an existing Ach Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
accountId | int | Id of the account to get |
Ach
await accountService.GetAchAccountAsync(123456);
GetCreditCardAccountAsync gets an existing Credit Card Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
accountId | int | Id of the account to get |
CreditCard
await accountService.GetCreditCardAccountAsync(123456);
UpdateAchAccountAsync updates an existing Ach Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
account | Ach | Ach Account to update |
Ach
var ach = new Ach
{
Id = 123456,
CustomerId = 654321,
RoutingNumber = "131111114",
AccountNumber = "751111111",
BankName = "PaySimple Bank",
IsCheckingAccount = false
};
var account = await accountService.UpdateAchAccountAsync(ach);
UpdateCreditCardAccountAsync updates an existing CreditCard Account
Parameter Name | Type | Description | Notes |
---|---|---|---|
account | CreditCard | Credit Card Account to update |
CreditCard
var creditCard = new CreditCard
{
Id = 123456,
CustomerId = 123456,
CreditCardNumber = "4111111111111111",
ExpirationDate = "12/2024",
Issuer = Issuer.Visa
};
var account = await accountService.UpdateCreditCardAccountAsync(creditCard);