POST | /sales/paymentprofile/import | Import a Payment Method (using ProfileToken) | After a Payment Method is created in the Vault API (www.clubreadygateway.com), the information has to be imported into the ClubReady system. The Vault API will return a ProfileToken and AcctToken. This endpoint will import a ProfileToken as a separate step. If the ProfileToken is sent to any other endpoints, those endpoints will import the ProfileToken and this endpoint is not needed. ### ProfileToken * JSON Web Token (JWT) * Length is variable, but generally around 1,000 to 4,000 characters * Contains non-PCI information about the Payment Method * Signed by the Vault API, preventing modification * Must be sent to ClubReady API within 5 minutes of creation * Can only be used once (though retrying is allowed) * You can parse and read the JWT, but the format is subject to change without notice * You cannot validate the signature in the JWT as the public key is not available ### AcctToken * A short string that is used to reference the Payment Method in the ClubReady system * Usually around 60 to 80 characters * Should not be stored for long-term use as it can change |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ApiResponse(Description="", ResponseType=PaymentProfileImportResponse.class, StatusCode=200)
public static class PaymentProfileImportEndpoint extends PaymentProfileImportRequest implements IApiKeyEndpoint
{
/**
* API Authentication Key
*/
@ApiMember(Description="API Authentication Key", IsRequired=true, ParameterType="query")
public String ApiKey = null;
/**
* The ProfileToken JWT to import (see description above)
*/
@ApiMember(Description="The ProfileToken JWT to import (see description above)", IsRequired=true)
public String ProfileToken = null;
/**
* When adding a PaymentMethod that is 'on-file' (`IsTemp == true`), the default behavior is toset this PaymentMethod as the preferred method. If you do not wish this to be the preferredmethod, you can set `DoNotUpdatePaymentTypePreference` to `true`. Otherwise, this can beomitted or `false`.For non 'on-file' PaymentMethods, this setting is ignored.
*/
@ApiMember(Description="When adding a PaymentMethod that is 'on-file' (`IsTemp == true`), the default behavior is to\r\nset this PaymentMethod as the preferred method. If you do not wish this to be the preferred\r\nmethod, you can set `DoNotUpdatePaymentTypePreference` to `true`. Otherwise, this can be\r\nomitted or `false`.\r\n\r\nFor non 'on-file' PaymentMethods, this setting is ignored.")
public Boolean DoNotUpdatePaymentTypePreference = null;
/**
* **Conditionally Required** When importing a ProfileToken with an OwnerType of `TempStUser`, the ownership will be changed toOwnerType of `User` with the userId of the supplied `NewOwnerId`.This is needed when a PaymentMethod is created for a User that has not been selected or created, yet.
*/
@ApiMember(Description="**Conditionally Required** \r\n\r\nWhen importing a ProfileToken with an OwnerType of `TempStUser`, the ownership will be changed to\r\nOwnerType of `User` with the userId of the supplied `NewOwnerId`.\r\n\r\nThis is needed when a PaymentMethod is created for a User that has not been selected or created, yet.")
public Integer NewOwnerId = null;
public String getApiKey() { return ApiKey; }
public PaymentProfileImportEndpoint setApiKey(String value) { this.ApiKey = value; return this; }
public String getProfileToken() { return ProfileToken; }
public PaymentProfileImportEndpoint setProfileToken(String value) { this.ProfileToken = value; return this; }
public Boolean isDoNotUpdatePaymentTypePreference() { return DoNotUpdatePaymentTypePreference; }
public PaymentProfileImportEndpoint setDoNotUpdatePaymentTypePreference(Boolean value) { this.DoNotUpdatePaymentTypePreference = value; return this; }
public Integer getNewOwnerId() { return NewOwnerId; }
public PaymentProfileImportEndpoint setNewOwnerId(Integer value) { this.NewOwnerId = value; return this; }
}
public static class PaymentProfileImportRequest
{
public String ProfileToken = null;
public Boolean DoNotUpdatePaymentTypePreference = null;
public Integer NewOwnerId = null;
public String getProfileToken() { return ProfileToken; }
public PaymentProfileImportRequest setProfileToken(String value) { this.ProfileToken = value; return this; }
public Boolean isDoNotUpdatePaymentTypePreference() { return DoNotUpdatePaymentTypePreference; }
public PaymentProfileImportRequest setDoNotUpdatePaymentTypePreference(Boolean value) { this.DoNotUpdatePaymentTypePreference = value; return this; }
public Integer getNewOwnerId() { return NewOwnerId; }
public PaymentProfileImportRequest setNewOwnerId(Integer value) { this.NewOwnerId = value; return this; }
}
public static class PaymentProfileImportResponse
{
public Boolean Success = null;
public String Message = null;
public PaymentProfile PaymentProfile = null;
public Boolean isSuccess() { return Success; }
public PaymentProfileImportResponse setSuccess(Boolean value) { this.Success = value; return this; }
public String getMessage() { return Message; }
public PaymentProfileImportResponse setMessage(String value) { this.Message = value; return this; }
public PaymentProfile getPaymentProfile() { return PaymentProfile; }
public PaymentProfileImportResponse setPaymentProfile(PaymentProfile value) { this.PaymentProfile = value; return this; }
}
public static class PaymentProfile implements IFullNameContainer
{
public Integer PaymentProfileId = null;
public String AcctToken = null;
public Integer OwnerId = null;
public Short OwnerTypeId = null;
public Short AcctTypeId = null;
public Short AcctClassId = null;
public String PrefixName = null;
public String FirstName = null;
public String MiddleName = null;
public String LastName = null;
public String SuffixName = null;
public String Address1 = null;
public String Address2 = null;
public String Urbanization = null;
public String City = null;
public String State = null;
public String PostalCode = null;
public String CountryCode = null;
public String Last4 = null;
public Short CcExpMonth = null;
public Short CcExpYear = null;
public Boolean IsTemp = null;
public Boolean IsDisabled = null;
public Date OnHoldUtc = null;
public Short OnHoldReasonCode = null;
public String OnHoldReasonDetail = null;
public Date AcctUpdaterFlagUtc = null;
public Integer CreatedBy = null;
public Date CreatedUtc = null;
public Integer ModifiedBy = null;
public Date ModifiedUtc = null;
public Boolean AcctUpdaterFlag = null;
public Short EntryModeId = null;
public Boolean ExcludeFromAcctUpdater = null;
public Integer getPaymentProfileId() { return PaymentProfileId; }
public PaymentProfile setPaymentProfileId(Integer value) { this.PaymentProfileId = value; return this; }
public String getAcctToken() { return AcctToken; }
public PaymentProfile setAcctToken(String value) { this.AcctToken = value; return this; }
public Integer getOwnerId() { return OwnerId; }
public PaymentProfile setOwnerId(Integer value) { this.OwnerId = value; return this; }
public Short getOwnerTypeId() { return OwnerTypeId; }
public PaymentProfile setOwnerTypeId(Short value) { this.OwnerTypeId = value; return this; }
public Short getAcctTypeId() { return AcctTypeId; }
public PaymentProfile setAcctTypeId(Short value) { this.AcctTypeId = value; return this; }
public Short getAcctClassId() { return AcctClassId; }
public PaymentProfile setAcctClassId(Short value) { this.AcctClassId = value; return this; }
public String getPrefixName() { return PrefixName; }
public PaymentProfile setPrefixName(String value) { this.PrefixName = value; return this; }
public String getFirstName() { return FirstName; }
public PaymentProfile setFirstName(String value) { this.FirstName = value; return this; }
public String getMiddleName() { return MiddleName; }
public PaymentProfile setMiddleName(String value) { this.MiddleName = value; return this; }
public String getLastName() { return LastName; }
public PaymentProfile setLastName(String value) { this.LastName = value; return this; }
public String getSuffixName() { return SuffixName; }
public PaymentProfile setSuffixName(String value) { this.SuffixName = value; return this; }
public String getAddress1() { return Address1; }
public PaymentProfile setAddress1(String value) { this.Address1 = value; return this; }
public String getAddress2() { return Address2; }
public PaymentProfile setAddress2(String value) { this.Address2 = value; return this; }
public String getUrbanization() { return Urbanization; }
public PaymentProfile setUrbanization(String value) { this.Urbanization = value; return this; }
public String getCity() { return City; }
public PaymentProfile setCity(String value) { this.City = value; return this; }
public String getState() { return State; }
public PaymentProfile setState(String value) { this.State = value; return this; }
public String getPostalCode() { return PostalCode; }
public PaymentProfile setPostalCode(String value) { this.PostalCode = value; return this; }
public String getCountryCode() { return CountryCode; }
public PaymentProfile setCountryCode(String value) { this.CountryCode = value; return this; }
public String getLast4() { return Last4; }
public PaymentProfile setLast4(String value) { this.Last4 = value; return this; }
public Short getCcExpMonth() { return CcExpMonth; }
public PaymentProfile setCcExpMonth(Short value) { this.CcExpMonth = value; return this; }
public Short getCcExpYear() { return CcExpYear; }
public PaymentProfile setCcExpYear(Short value) { this.CcExpYear = value; return this; }
public Boolean getIsTemp() { return IsTemp; }
public PaymentProfile setIsTemp(Boolean value) { this.IsTemp = value; return this; }
public Boolean getIsDisabled() { return IsDisabled; }
public PaymentProfile setIsDisabled(Boolean value) { this.IsDisabled = value; return this; }
public Date getOnHoldUtc() { return OnHoldUtc; }
public PaymentProfile setOnHoldUtc(Date value) { this.OnHoldUtc = value; return this; }
public Short getOnHoldReasonCode() { return OnHoldReasonCode; }
public PaymentProfile setOnHoldReasonCode(Short value) { this.OnHoldReasonCode = value; return this; }
public String getOnHoldReasonDetail() { return OnHoldReasonDetail; }
public PaymentProfile setOnHoldReasonDetail(String value) { this.OnHoldReasonDetail = value; return this; }
public Date getAcctUpdaterFlagUtc() { return AcctUpdaterFlagUtc; }
public PaymentProfile setAcctUpdaterFlagUtc(Date value) { this.AcctUpdaterFlagUtc = value; return this; }
public Integer getCreatedBy() { return CreatedBy; }
public PaymentProfile setCreatedBy(Integer value) { this.CreatedBy = value; return this; }
public Date getCreatedUtc() { return CreatedUtc; }
public PaymentProfile setCreatedUtc(Date value) { this.CreatedUtc = value; return this; }
public Integer getModifiedBy() { return ModifiedBy; }
public PaymentProfile setModifiedBy(Integer value) { this.ModifiedBy = value; return this; }
public Date getModifiedUtc() { return ModifiedUtc; }
public PaymentProfile setModifiedUtc(Date value) { this.ModifiedUtc = value; return this; }
public Boolean isAcctUpdaterFlag() { return AcctUpdaterFlag; }
public PaymentProfile setAcctUpdaterFlag(Boolean value) { this.AcctUpdaterFlag = value; return this; }
public Short getEntryModeId() { return EntryModeId; }
public PaymentProfile setEntryModeId(Short value) { this.EntryModeId = value; return this; }
public Boolean isExcludeFromAcctUpdater() { return ExcludeFromAcctUpdater; }
public PaymentProfile setExcludeFromAcctUpdater(Boolean value) { this.ExcludeFromAcctUpdater = value; return this; }
}
}
Java PaymentProfileImportEndpoint DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /sales/paymentprofile/import HTTP/1.1
Host: www.clubready.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ApiKey":"String","ProfileToken":"String","DoNotUpdatePaymentTypePreference":false,"NewOwnerId":0}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Success":false,"Message":"String","PaymentProfile":{"PaymentProfileId":0,"AcctToken":"String","OwnerId":0,"OwnerTypeId":0,"AcctTypeId":0,"AcctClassId":0,"PrefixName":"String","FirstName":"String","MiddleName":"String","LastName":"String","SuffixName":"String","Address1":"String","Address2":"String","Urbanization":"String","City":"String","State":"String","PostalCode":"String","CountryCode":"String","Last4":"String","CcExpMonth":0,"CcExpYear":0,"IsTemp":false,"IsDisabled":false,"OnHoldUtc":"0001-01-01T00:00:00.0000000","OnHoldReasonCode":0,"OnHoldReasonDetail":"String","AcctUpdaterFlagUtc":"0001-01-01T00:00:00.0000000","CreatedBy":0,"CreatedUtc":"0001-01-01T00:00:00.0000000","ModifiedBy":0,"ModifiedUtc":"0001-01-01T00:00:00.0000000","AcctUpdaterFlag":false,"EntryModeId":0,"ExcludeFromAcctUpdater":false}}