POST | /sales/member/{MemberId}/payment/profile | Add Payment Profile for a Member |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports ClubReady.Web.Api.Sales.Model
Imports ClubReady.Core.Api.Models
Imports ClubReadyGateway.Vault
Imports ClubReady.Web.Api
Namespace Global
Namespace ClubReady.Core.Api.Models
Public Partial Class AddPaymentProfileRequest
Inherits ApiDtoBase
Public Overridable Property UserId As Integer
Public Overridable Property AcctToken As String
Public Overridable Property Last4 As String
Public Overridable Property ExpMonth As Nullable(Of Integer)
Public Overridable Property ExpYear As Nullable(Of Integer)
Public Overridable Property AcctType As Nullable(Of AcctType)
Public Overridable Property BnkRoute As Nullable(Of Integer)
Public Overridable Property FirstName As String
Public Overridable Property MiddleName As String
Public Overridable Property LastName As String
Public Overridable Property Address1 As String
Public Overridable Property Address2 As String
Public Overridable Property City As String
Public Overridable Property State As String
Public Overridable Property PostalCode As String
Public Overridable Property CountryCode As String
Public Overridable Property Urbanization As String
Public Overridable Property DoNotUpdatePaymentTypePreference As Boolean
Public Overridable Property IsTemp As Boolean
End Class
Public Partial Class AddPaymentProfileResponse
Public Overridable Property Success As String
Public Overridable Property Message As String
End Class
Public Partial Class ApiDtoBase
Public Overridable Property ApiKey As String
Public Overridable Property StoreId As Nullable(Of Integer)
Public Overridable Property ChainId As Nullable(Of Integer)
End Class
End Namespace
Namespace ClubReady.Web.Api
Public Enum RestrictedResourceType
Store
Chain
User
Undefined
End Enum
End Namespace
Namespace ClubReady.Web.Api.Sales.Model
<ApiResponse(Description:="", ResponseType:=GetType(AddPaymentProfileResponse), StatusCode:=200)>
Public Partial Class AddPaymentAccount
Inherits AddPaymentProfileRequest
Implements IRestrictedApiRequest
'''<Summary>
'''Api Authentication Key
'''</Summary>
<ApiMember(Description:="Api Authentication Key", IsRequired:=true, ParameterType:="query")>
Public Overridable Property ApiKey As String
'''<Summary>
'''Id of the store for the user
'''</Summary>
<ApiMember(Description:="Id of the store for the user", IsRequired:=true, ParameterType:="query")>
Public Overridable Property StoreId As Nullable(Of Integer)
'''<Summary>
'''Member Id of the user to update their Payment Profile
'''</Summary>
<ApiMember(Description:="Member Id of the user to update their Payment Profile", IsRequired:=true, ParameterType:="path")>
Public Overridable Property MemberId As Integer
'''<Summary>
'''The AcctToken provided by creating a Payment Profile with the Vault Api
'''</Summary>
<ApiMember(Description:="The AcctToken provided by creating a Payment Profile with the Vault Api", IsRequired:=true)>
Public Overridable Property AcctToken As String
'''<Summary>
'''Last 4 digits of the Payment Profile
'''</Summary>
<ApiMember(Description:="Last 4 digits of the Payment Profile")>
Public Overridable Property Last4 As String
'''<Summary>
'''2 digit expiration month **Required for Credit Card**
'''</Summary>
<ApiMember(Description:="2 digit expiration month
**Required for Credit Card**")>
Public Overridable Property ExpMonth As Nullable(Of Integer)
'''<Summary>
'''2 digit expiration year **Required for Credit Card**
'''</Summary>
<ApiMember(Description:="2 digit expiration year
**Required for Credit Card**")>
Public Overridable Property ExpYear As Nullable(Of Integer)
'''<Summary>
'''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>
'''</Summary>
<ApiMember(Description:="
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>")>
Public Overridable Property AcctType As Nullable(Of AcctType)
'''<Summary>
'''Bank Routing Number **Required for Bank Accounts**
'''</Summary>
<ApiMember(Description:="Bank Routing Number
**Required for Bank Accounts**")>
Public Overridable Property BnkRoute As Nullable(Of Integer)
'''<Summary>
'''Set to `true` to not set the user's Payment Type Preference when adding an on-file profile
'''</Summary>
<ApiMember(Description:="Set to `true` to not set the user's Payment Type Preference when adding an on-file profile")>
Public Overridable Property DoNotUpdatePaymentTypePreference As Boolean
'''<Summary>
'''Whether the Payment Profile is Temporary (One time transactions and Gift Cards are IsTemp = `true`)
'''</Summary>
<ApiMember(Description:="Whether the Payment Profile is Temporary (One time transactions and Gift Cards are IsTemp = `true`)")>
Public Overridable Property IsTemp As Boolean
Public Overridable Property RestrictedId As Nullable(Of Integer)
Public Overridable Property RestrictedResourceType As RestrictedResourceType
End Class
End Namespace
Namespace ClubReadyGateway.Vault
<DataContract>
Public 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
End Enum
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<AddPaymentAccount xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Model">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</ApiKey>
<ChainId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ChainId>
<StoreId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</StoreId>
<AcctToken xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</AcctToken>
<AcctType xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">Uninitialized</AcctType>
<Address1 xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Address1>
<Address2 xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Address2>
<BnkRoute xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</BnkRoute>
<City xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</City>
<CountryCode xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</CountryCode>
<DoNotUpdatePaymentTypePreference xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</DoNotUpdatePaymentTypePreference>
<ExpMonth xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ExpMonth>
<ExpYear xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ExpYear>
<FirstName xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</FirstName>
<IsTemp xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</IsTemp>
<Last4 xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Last4>
<LastName xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</LastName>
<MiddleName xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</MiddleName>
<PostalCode xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</PostalCode>
<State xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</State>
<Urbanization xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Urbanization>
<UserId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</UserId>
<AuthToken>String</AuthToken>
<CardType>0</CardType>
<MemberId>0</MemberId>
</AddPaymentAccount>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <AddPaymentProfileResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models"> <Message>String</Message> <Success>String</Success> </AddPaymentProfileResponse>