POST | /sales/member/{MemberId}/payment/profile | Add Payment Profile for a Member |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ApiResponse(Description="", ResponseType=AddPaymentProfileResponse.class, StatusCode=200)
public static class AddPaymentAccount extends AddPaymentProfileRequest implements IRestrictedApiRequest
{
/**
* Api Authentication Key
*/
@ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")
public String ApiKey = null;
/**
* Id of the store for the user
*/
@ApiMember(Description="Id of the store for the user", IsRequired=true, ParameterType="query")
public Integer StoreId = null;
/**
* Member Id of the user to update their Payment Profile
*/
@ApiMember(Description="Member Id of the user to update their Payment Profile", IsRequired=true, ParameterType="path")
public Integer MemberId = null;
/**
* The AcctToken provided by creating a Payment Profile with the Vault Api
*/
@ApiMember(Description="The AcctToken provided by creating a Payment Profile with the Vault Api", IsRequired=true)
public String AcctToken = null;
/**
* Last 4 digits of the Payment Profile
*/
@ApiMember(Description="Last 4 digits of the Payment Profile")
public String Last4 = null;
/**
* 2 digit expiration month **Required for Credit Card**
*/
@ApiMember(Description="2 digit expiration month \n**Required for Credit Card**")
public Integer ExpMonth = null;
/**
* 2 digit expiration year **Required for Credit Card**
*/
@ApiMember(Description="2 digit expiration year \n**Required for Credit Card**")
public Integer ExpYear = null;
/**
* The Account Type of the Payment Profile **Required when adding Gift Card**<details><summary>Common Values</summary><table> <thead> <tr><th>Text</th><th>Numerical</th><th>Account Type</th></tr> </thead> <tbody> <tr><td>VISA</td><td>1</td><td>Visa</td></tr> <tr><td>MC</td><td>2</td><td>MasterCard</td></tr> <tr><td>Disc</td><td>3</td><td>Discover</td></tr> <tr><td>Amex</td><td>4</td><td>American Express</td></tr> <tr><td>PC</td><td>11</td><td>Personal Checking</td></tr> <tr><td>PS</td><td>12</td><td>Personal Savings</td></tr> <tr><td>BC</td><td>13</td><td>Business Checking</td></tr> <tr><td>Factor4</td><td>42</td><td>Factor4 Gift Card</td></tr> </tbody></table><p>You may use the Text or the Numerical value.</p></details>
*/
@ApiMember(Description="\r\nThe Account Type of the Payment Profile \r\n**Required when adding Gift Card**\r\n\r\n<details>\r\n<summary>Common Values</summary>\r\n<table>\r\n <thead>\r\n <tr><th>Text</th><th>Numerical</th><th>Account Type</th></tr>\r\n </thead>\r\n <tbody>\r\n <tr><td>VISA</td><td>1</td><td>Visa</td></tr>\r\n <tr><td>MC</td><td>2</td><td>MasterCard</td></tr>\r\n <tr><td>Disc</td><td>3</td><td>Discover</td></tr>\r\n <tr><td>Amex</td><td>4</td><td>American Express</td></tr>\r\n <tr><td>PC</td><td>11</td><td>Personal Checking</td></tr>\r\n <tr><td>PS</td><td>12</td><td>Personal Savings</td></tr>\r\n <tr><td>BC</td><td>13</td><td>Business Checking</td></tr>\r\n <tr><td>Factor4</td><td>42</td><td>Factor4 Gift Card</td></tr>\r\n </tbody>\r\n</table>\r\n<p>You may use the Text or the Numerical value.</p>\r\n</details>")
public AcctType AcctType = null;
/**
* Bank Routing Number **Required for Bank Accounts**
*/
@ApiMember(Description="Bank Routing Number \n**Required for Bank Accounts**")
public Integer BnkRoute = null;
/**
* Set to `true` to not set the user's Payment Type Preference when adding an on-file profile
*/
@ApiMember(Description="Set to `true` to not set the user's Payment Type Preference when adding an on-file profile")
public Boolean DoNotUpdatePaymentTypePreference = null;
/**
* Whether the Payment Profile is Temporary (One time transactions and Gift Cards are IsTemp = `true`)
*/
@ApiMember(Description="Whether the Payment Profile is Temporary (One time transactions and Gift Cards are IsTemp = `true`)")
public Boolean IsTemp = null;
public Integer RestrictedId = null;
public RestrictedResourceType RestrictedResourceType = null;
public String getApiKey() { return ApiKey; }
public AddPaymentAccount setApiKey(String value) { this.ApiKey = value; return this; }
public Integer getStoreId() { return StoreId; }
public AddPaymentAccount setStoreId(Integer value) { this.StoreId = value; return this; }
public Integer getMemberId() { return MemberId; }
public AddPaymentAccount setMemberId(Integer value) { this.MemberId = value; return this; }
public String getAcctToken() { return AcctToken; }
public AddPaymentAccount setAcctToken(String value) { this.AcctToken = value; return this; }
public String getLast4() { return Last4; }
public AddPaymentAccount setLast4(String value) { this.Last4 = value; return this; }
public Integer getExpMonth() { return ExpMonth; }
public AddPaymentAccount setExpMonth(Integer value) { this.ExpMonth = value; return this; }
public Integer getExpYear() { return ExpYear; }
public AddPaymentAccount setExpYear(Integer value) { this.ExpYear = value; return this; }
public AcctType getAcctType() { return AcctType; }
public AddPaymentAccount setAcctType(AcctType value) { this.AcctType = value; return this; }
public Integer getBnkRoute() { return BnkRoute; }
public AddPaymentAccount setBnkRoute(Integer value) { this.BnkRoute = value; return this; }
public Boolean isDoNotUpdatePaymentTypePreference() { return DoNotUpdatePaymentTypePreference; }
public AddPaymentAccount setDoNotUpdatePaymentTypePreference(Boolean value) { this.DoNotUpdatePaymentTypePreference = value; return this; }
public Boolean getIsTemp() { return IsTemp; }
public AddPaymentAccount setIsTemp(Boolean value) { this.IsTemp = value; return this; }
public Integer getRestrictedId() { return RestrictedId; }
public AddPaymentAccount setRestrictedId(Integer value) { this.RestrictedId = value; return this; }
public RestrictedResourceType getRestrictedResourceType() { return RestrictedResourceType; }
public AddPaymentAccount setRestrictedResourceType(RestrictedResourceType value) { this.RestrictedResourceType = value; return this; }
}
public static class AddPaymentProfileRequest extends ApiDtoBase
{
public Integer UserId = null;
public String AcctToken = null;
public String Last4 = null;
public Integer ExpMonth = null;
public Integer ExpYear = null;
public AcctType AcctType = null;
public Integer BnkRoute = null;
public String FirstName = null;
public String MiddleName = null;
public String LastName = null;
public String Address1 = null;
public String Address2 = null;
public String City = null;
public String State = null;
public String PostalCode = null;
public String CountryCode = null;
public String Urbanization = null;
public Boolean DoNotUpdatePaymentTypePreference = null;
public Boolean IsTemp = null;
public Integer getUserId() { return UserId; }
public AddPaymentProfileRequest setUserId(Integer value) { this.UserId = value; return this; }
public String getAcctToken() { return AcctToken; }
public AddPaymentProfileRequest setAcctToken(String value) { this.AcctToken = value; return this; }
public String getLast4() { return Last4; }
public AddPaymentProfileRequest setLast4(String value) { this.Last4 = value; return this; }
public Integer getExpMonth() { return ExpMonth; }
public AddPaymentProfileRequest setExpMonth(Integer value) { this.ExpMonth = value; return this; }
public Integer getExpYear() { return ExpYear; }
public AddPaymentProfileRequest setExpYear(Integer value) { this.ExpYear = value; return this; }
public AcctType getAcctType() { return AcctType; }
public AddPaymentProfileRequest setAcctType(AcctType value) { this.AcctType = value; return this; }
public Integer getBnkRoute() { return BnkRoute; }
public AddPaymentProfileRequest setBnkRoute(Integer value) { this.BnkRoute = value; return this; }
public String getFirstName() { return FirstName; }
public AddPaymentProfileRequest setFirstName(String value) { this.FirstName = value; return this; }
public String getMiddleName() { return MiddleName; }
public AddPaymentProfileRequest setMiddleName(String value) { this.MiddleName = value; return this; }
public String getLastName() { return LastName; }
public AddPaymentProfileRequest setLastName(String value) { this.LastName = value; return this; }
public String getAddress1() { return Address1; }
public AddPaymentProfileRequest setAddress1(String value) { this.Address1 = value; return this; }
public String getAddress2() { return Address2; }
public AddPaymentProfileRequest setAddress2(String value) { this.Address2 = value; return this; }
public String getCity() { return City; }
public AddPaymentProfileRequest setCity(String value) { this.City = value; return this; }
public String getState() { return State; }
public AddPaymentProfileRequest setState(String value) { this.State = value; return this; }
public String getPostalCode() { return PostalCode; }
public AddPaymentProfileRequest setPostalCode(String value) { this.PostalCode = value; return this; }
public String getCountryCode() { return CountryCode; }
public AddPaymentProfileRequest setCountryCode(String value) { this.CountryCode = value; return this; }
public String getUrbanization() { return Urbanization; }
public AddPaymentProfileRequest setUrbanization(String value) { this.Urbanization = value; return this; }
public Boolean isDoNotUpdatePaymentTypePreference() { return DoNotUpdatePaymentTypePreference; }
public AddPaymentProfileRequest setDoNotUpdatePaymentTypePreference(Boolean value) { this.DoNotUpdatePaymentTypePreference = value; return this; }
public Boolean getIsTemp() { return IsTemp; }
public AddPaymentProfileRequest setIsTemp(Boolean value) { this.IsTemp = value; return this; }
}
public static class ApiDtoBase
{
public String ApiKey = null;
public Integer StoreId = null;
public Integer ChainId = null;
public String getApiKey() { return ApiKey; }
public ApiDtoBase setApiKey(String value) { this.ApiKey = value; return this; }
public Integer getStoreId() { return StoreId; }
public ApiDtoBase setStoreId(Integer value) { this.StoreId = value; return this; }
public Integer getChainId() { return ChainId; }
public ApiDtoBase setChainId(Integer value) { this.ChainId = value; return this; }
}
@DataContract
public static enum AcctType
{
Uninitialized(0),
Visa(1),
Mc(2),
Disc(3),
Amex(4),
Diners(5),
Jcb(6),
EnRoute(7),
PayPal(8),
BillMe(9),
Pc(11),
Ps(12),
Bc(13),
Bs(14),
Becs(15),
Bacs(16),
Maestro(20),
Solo(21),
VisaElectron(22),
Cibc(23),
RoyalBankCa(24),
TdCaTrust(25),
Scotia(26),
Bmo(27),
HsbcCa(28),
UnionPay(29),
InterPayment(30),
Laser(31),
UnknownCredit(40),
TransArmor(41),
Factor4(42),
XPass(43),
ConnectedAccount(44),
UnknownBank(45),
Error(-1);
private final int value;
AcctType(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined;
}
public static class AddPaymentProfileResponse
{
public String Success = null;
public String Message = null;
public String getSuccess() { return Success; }
public AddPaymentProfileResponse setSuccess(String value) { this.Success = value; return this; }
public String getMessage() { return Message; }
public AddPaymentProfileResponse setMessage(String value) { this.Message = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /sales/member/{MemberId}/payment/profile HTTP/1.1
Host: clubready.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ApiKey":"String","StoreId":0,"MemberId":0,"AcctToken":"String","AuthToken":"String","Last4":"String","ExpMonth":0,"ExpYear":0,"AcctType":"Uninitialized","CardType":0,"BnkRoute":0,"DoNotUpdatePaymentTypePreference":false,"IsTemp":false,"RestrictedId":0,"RestrictedResourceType":"Chain","UserId":0,"FirstName":"String","MiddleName":"String","LastName":"String","Address1":"String","Address2":"String","City":"String","State":"String","PostalCode":"String","CountryCode":"String","Urbanization":"String","ChainId":0}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Success":"String","Message":"String"}