PUT | /sales/wallet/paymentprofileupdate | Update the personal information of a Payment Profile | Omitting fields or providing `null` will not update that field. Providing an empty or whitespace string will remove the data from the field. To update the account information (Account Number, Last4, Country, etc), create a new Payment Profile. |
---|
import Foundation
import ServiceStack
public class PaymentProfileUpdateEndpoint : PaymentProfileUpdateRequestDto
{
/**
* Grants access to resources
*/
// @ApiMember(Description="Grants access to resources", IsRequired=true)
public var apiKey:String
/**
* AcctToken to update
*/
// @ApiMember(Description="AcctToken to update", IsRequired=true)
public var acctToken:String
/**
* UserId that is updating profile
*/
// @ApiMember(Description="UserId that is updating profile", IsRequired=true)
public var modifiedBy:Int?
/**
* Expiry Month: 1 = January, 12 = December
*/
// @ApiMember(Description="Expiry Month: 1 = January, 12 = December")
public var ccExpMonth:UInt8?
/**
* Expiry Year: Two digit year
*/
// @ApiMember(Description="Expiry Year: Two digit year")
public var ccExpYear:UInt8?
/**
* The name can be provided with FullName OR as separate fields (PrefixName, FirstName, MiddleName, LastName, SuffixName).<br />Providing both will cause an error.
*/
// @ApiMember(Description="The name can be provided with FullName OR as separate fields (PrefixName, FirstName, MiddleName, LastName, SuffixName).<br />Providing both will cause an error.")
public var fullName:String
// @ApiMember()
public var prefixName:String
// @ApiMember()
public var firstName:String
// @ApiMember()
public var middleName:String
// @ApiMember()
public var lastName:String
// @ApiMember()
public var suffixName:String
// @ApiMember()
public var address1:String
// @ApiMember()
public var address2:String
// @ApiMember()
public var urbanization:String
// @ApiMember()
public var city:String
// @ApiMember()
public var state:String
// @ApiMember()
public var postalCode:String
/**
* Disable (or Enabled) the Payment Profile
*/
// @ApiMember(Description="Disable (or Enabled) the Payment Profile")
public var isDisabled:Bool?
/**
* Exclude (or Include) from Account Updater
*/
// @ApiMember(Description="Exclude (or Include) from Account Updater")
public var excludeFromAcctUpdater:Bool?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case apiKey
case acctToken
case modifiedBy
case ccExpMonth
case ccExpYear
case fullName
case prefixName
case firstName
case middleName
case lastName
case suffixName
case address1
case address2
case urbanization
case city
case state
case postalCode
case isDisabled
case excludeFromAcctUpdater
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
apiKey = try container.decodeIfPresent(String.self, forKey: .apiKey)
acctToken = try container.decodeIfPresent(String.self, forKey: .acctToken)
modifiedBy = try container.decodeIfPresent(Int.self, forKey: .modifiedBy)
ccExpMonth = try container.decodeIfPresent(UInt8.self, forKey: .ccExpMonth)
ccExpYear = try container.decodeIfPresent(UInt8.self, forKey: .ccExpYear)
fullName = try container.decodeIfPresent(String.self, forKey: .fullName)
prefixName = try container.decodeIfPresent(String.self, forKey: .prefixName)
firstName = try container.decodeIfPresent(String.self, forKey: .firstName)
middleName = try container.decodeIfPresent(String.self, forKey: .middleName)
lastName = try container.decodeIfPresent(String.self, forKey: .lastName)
suffixName = try container.decodeIfPresent(String.self, forKey: .suffixName)
address1 = try container.decodeIfPresent(String.self, forKey: .address1)
address2 = try container.decodeIfPresent(String.self, forKey: .address2)
urbanization = try container.decodeIfPresent(String.self, forKey: .urbanization)
city = try container.decodeIfPresent(String.self, forKey: .city)
state = try container.decodeIfPresent(String.self, forKey: .state)
postalCode = try container.decodeIfPresent(String.self, forKey: .postalCode)
isDisabled = try container.decodeIfPresent(Bool.self, forKey: .isDisabled)
excludeFromAcctUpdater = try container.decodeIfPresent(Bool.self, forKey: .excludeFromAcctUpdater)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if apiKey != nil { try container.encode(apiKey, forKey: .apiKey) }
if acctToken != nil { try container.encode(acctToken, forKey: .acctToken) }
if modifiedBy != nil { try container.encode(modifiedBy, forKey: .modifiedBy) }
if ccExpMonth != nil { try container.encode(ccExpMonth, forKey: .ccExpMonth) }
if ccExpYear != nil { try container.encode(ccExpYear, forKey: .ccExpYear) }
if fullName != nil { try container.encode(fullName, forKey: .fullName) }
if prefixName != nil { try container.encode(prefixName, forKey: .prefixName) }
if firstName != nil { try container.encode(firstName, forKey: .firstName) }
if middleName != nil { try container.encode(middleName, forKey: .middleName) }
if lastName != nil { try container.encode(lastName, forKey: .lastName) }
if suffixName != nil { try container.encode(suffixName, forKey: .suffixName) }
if address1 != nil { try container.encode(address1, forKey: .address1) }
if address2 != nil { try container.encode(address2, forKey: .address2) }
if urbanization != nil { try container.encode(urbanization, forKey: .urbanization) }
if city != nil { try container.encode(city, forKey: .city) }
if state != nil { try container.encode(state, forKey: .state) }
if postalCode != nil { try container.encode(postalCode, forKey: .postalCode) }
if isDisabled != nil { try container.encode(isDisabled, forKey: .isDisabled) }
if excludeFromAcctUpdater != nil { try container.encode(excludeFromAcctUpdater, forKey: .excludeFromAcctUpdater) }
}
}
public class PaymentProfileUpdateRequestDto : ApiDtoBase
{
public var acctToken:String
public var modifiedBy:Int?
public var ccExpMonth:UInt8?
public var ccExpYear:UInt8?
public var fullName:String
public var prefixName:String
public var firstName:String
public var middleName:String
public var lastName:String
public var suffixName:String
public var address1:String
public var address2:String
public var urbanization:String
public var city:String
public var state:String
public var postalCode:String
public var isDisabled:Bool?
public var excludeFromAcctUpdater:Bool?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case acctToken
case modifiedBy
case ccExpMonth
case ccExpYear
case fullName
case prefixName
case firstName
case middleName
case lastName
case suffixName
case address1
case address2
case urbanization
case city
case state
case postalCode
case isDisabled
case excludeFromAcctUpdater
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
acctToken = try container.decodeIfPresent(String.self, forKey: .acctToken)
modifiedBy = try container.decodeIfPresent(Int.self, forKey: .modifiedBy)
ccExpMonth = try container.decodeIfPresent(UInt8.self, forKey: .ccExpMonth)
ccExpYear = try container.decodeIfPresent(UInt8.self, forKey: .ccExpYear)
fullName = try container.decodeIfPresent(String.self, forKey: .fullName)
prefixName = try container.decodeIfPresent(String.self, forKey: .prefixName)
firstName = try container.decodeIfPresent(String.self, forKey: .firstName)
middleName = try container.decodeIfPresent(String.self, forKey: .middleName)
lastName = try container.decodeIfPresent(String.self, forKey: .lastName)
suffixName = try container.decodeIfPresent(String.self, forKey: .suffixName)
address1 = try container.decodeIfPresent(String.self, forKey: .address1)
address2 = try container.decodeIfPresent(String.self, forKey: .address2)
urbanization = try container.decodeIfPresent(String.self, forKey: .urbanization)
city = try container.decodeIfPresent(String.self, forKey: .city)
state = try container.decodeIfPresent(String.self, forKey: .state)
postalCode = try container.decodeIfPresent(String.self, forKey: .postalCode)
isDisabled = try container.decodeIfPresent(Bool.self, forKey: .isDisabled)
excludeFromAcctUpdater = try container.decodeIfPresent(Bool.self, forKey: .excludeFromAcctUpdater)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if acctToken != nil { try container.encode(acctToken, forKey: .acctToken) }
if modifiedBy != nil { try container.encode(modifiedBy, forKey: .modifiedBy) }
if ccExpMonth != nil { try container.encode(ccExpMonth, forKey: .ccExpMonth) }
if ccExpYear != nil { try container.encode(ccExpYear, forKey: .ccExpYear) }
if fullName != nil { try container.encode(fullName, forKey: .fullName) }
if prefixName != nil { try container.encode(prefixName, forKey: .prefixName) }
if firstName != nil { try container.encode(firstName, forKey: .firstName) }
if middleName != nil { try container.encode(middleName, forKey: .middleName) }
if lastName != nil { try container.encode(lastName, forKey: .lastName) }
if suffixName != nil { try container.encode(suffixName, forKey: .suffixName) }
if address1 != nil { try container.encode(address1, forKey: .address1) }
if address2 != nil { try container.encode(address2, forKey: .address2) }
if urbanization != nil { try container.encode(urbanization, forKey: .urbanization) }
if city != nil { try container.encode(city, forKey: .city) }
if state != nil { try container.encode(state, forKey: .state) }
if postalCode != nil { try container.encode(postalCode, forKey: .postalCode) }
if isDisabled != nil { try container.encode(isDisabled, forKey: .isDisabled) }
if excludeFromAcctUpdater != nil { try container.encode(excludeFromAcctUpdater, forKey: .excludeFromAcctUpdater) }
}
}
public class ApiDtoBase : Codable
{
public var apiKey:String
public var storeId:Int?
public var chainId:Int?
required public init(){}
}
public class PaymentProfileUpdateResponse : PaymentProfileUpdateResponseDto
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class PaymentProfileUpdateResponseDto : ApiResponseBase
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class ApiResponseBase : Codable
{
public var success:Bool
public var message:String
required public init(){}
}
Swift PaymentProfileUpdateEndpoint DTOs
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.
PUT /sales/wallet/paymentprofileupdate HTTP/1.1
Host: clubready.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ApiKey":"String","AcctToken":"String","ModifiedBy":0,"CcExpMonth":0,"CcExpYear":0,"FullName":"String","PrefixName":"String","FirstName":"String","MiddleName":"String","LastName":"String","SuffixName":"String","Address1":"String","Address2":"String","Urbanization":"String","City":"String","State":"String","PostalCode":"String","IsDisabled":false,"ExcludeFromAcctUpdater":false,"StoreId":0,"ChainId":0}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Success":false,"Message":"String"}