POST | /sales/member/{MemberId}/payment/profile | Add Payment Profile for a Member |
---|
namespace ClubReady.Core.Api.Models
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type ApiDtoBase() =
member val ApiKey:String = null with get,set
member val StoreId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val ChainId:Nullable<Int32> = new Nullable<Int32>() with get,set
[<DataContract>]
type 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
[<AllowNullLiteral>]
type AddPaymentProfileRequest() =
inherit ApiDtoBase()
member val UserId:Int32 = new Int32() with get,set
member val AcctToken:String = null with get,set
member val Last4:String = null with get,set
member val ExpMonth:Nullable<Int32> = new Nullable<Int32>() with get,set
member val ExpYear:Nullable<Int32> = new Nullable<Int32>() with get,set
member val AcctType:Nullable<AcctType> = new Nullable<AcctType>() with get,set
member val BnkRoute:Nullable<Int32> = new Nullable<Int32>() with get,set
member val FirstName:String = null with get,set
member val MiddleName:String = null with get,set
member val LastName:String = null with get,set
member val Address1:String = null with get,set
member val Address2:String = null with get,set
member val City:String = null with get,set
member val State:String = null with get,set
member val PostalCode:String = null with get,set
member val CountryCode:String = null with get,set
member val Urbanization:String = null with get,set
member val DoNotUpdatePaymentTypePreference:Boolean = new Boolean() with get,set
member val IsTemp:Boolean = new Boolean() with get,set
type RestrictedResourceType =
| Store = 0
| Chain = 1
| User = 2
| Undefined = 3
[<ApiResponse(Description="", ResponseType=typeof<AddPaymentProfileResponse>, StatusCode=200)>]
[<AllowNullLiteral>]
type AddPaymentAccount() =
inherit AddPaymentProfileRequest()
///<summary>
///Api Authentication Key
///</summary>
[<ApiMember(Description="Api Authentication Key", IsRequired=true, ParameterType="query")>]
member val ApiKey:String = null with get,set
///<summary>
///Id of the store for the user
///</summary>
[<ApiMember(Description="Id of the store for the user", IsRequired=true, ParameterType="query")>]
member val StoreId:Nullable<Int32> = new Nullable<Int32>() with get,set
///<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")>]
member val MemberId:Int32 = new Int32() with get,set
///<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)>]
member val AcctToken:String = null with get,set
///<summary>
///Last 4 digits of the Payment Profile
///</summary>
[<ApiMember(Description="Last 4 digits of the Payment Profile")>]
member val Last4:String = null with get,set
///<summary>
///2 digit expiration month **Required for Credit Card**
///</summary>
[<ApiMember(Description="2 digit expiration month \n**Required for Credit Card**")>]
member val ExpMonth:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///2 digit expiration year **Required for Credit Card**
///</summary>
[<ApiMember(Description="2 digit expiration year \n**Required for Credit Card**")>]
member val ExpYear:Nullable<Int32> = new Nullable<Int32>() with get,set
///<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="\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>")>]
member val AcctType:Nullable<AcctType> = new Nullable<AcctType>() with get,set
///<summary>
///Bank Routing Number **Required for Bank Accounts**
///</summary>
[<ApiMember(Description="Bank Routing Number \n**Required for Bank Accounts**")>]
member val BnkRoute:Nullable<Int32> = new Nullable<Int32>() with get,set
///<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")>]
member val DoNotUpdatePaymentTypePreference:Boolean = new Boolean() with get,set
///<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`)")>]
member val IsTemp:Boolean = new Boolean() with get,set
member val RestrictedId:Nullable<Int32> = new Nullable<Int32>() with get,set
member val RestrictedResourceType:RestrictedResourceType = new RestrictedResourceType() with get,set
[<AllowNullLiteral>]
type AddPaymentProfileResponse() =
member val Success:String = null with get,set
member val Message:String = null with get,set
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>