@Immutable @LevelUpApi(contract=PUBLIC) public final class CreditCardRequestFactory extends AbstractRequestFactory
| Modifier and Type | Field and Description |
|---|---|
static String |
OUTER_PARAM_CARD
The outer JSON object request parameter.
|
static String |
PARAM_ENCRYPTED_CVV
The encrypted CVV code.
|
static String |
PARAM_ENCRYPTED_EXPIRATION_MONTH
The encrypted expiration date month.
|
static String |
PARAM_ENCRYPTED_EXPIRATION_YEAR
The encrypted expiration date year.
|
static String |
PARAM_ENCRYPTED_NUMBER
The encrypted credit card number.
|
static String |
PARAM_POSTAL_CODE
The postal/zip code.
|
| Constructor and Description |
|---|
CreditCardRequestFactory(Context context,
AccessTokenRetriever retriever) |
| Modifier and Type | Method and Description |
|---|---|
AbstractRequest |
buildCreateCardRequest(String cardNumber,
String cvv,
String expirationMonth,
String expirationYear,
String postalCode)
Builds a request to the server which will add a credit card for the current user.
|
AbstractRequest |
buildDeleteCardRequest(CreditCard card)
Builds a request to delete a credit card.
|
AbstractRequest |
buildGetCardsRequest()
Builds a request to get the credit cards for a user.
|
AbstractRequest |
buildPromoteCardRequest(CreditCard card)
Builds a request to promote (set as default) a credit card.
|
getAccessTokenRetriever, getContextpublic static final String OUTER_PARAM_CARD
public static final String PARAM_ENCRYPTED_CVV
public static final String PARAM_ENCRYPTED_EXPIRATION_MONTH
public static final String PARAM_ENCRYPTED_EXPIRATION_YEAR
public static final String PARAM_ENCRYPTED_NUMBER
public static final String PARAM_POSTAL_CODE
public CreditCardRequestFactory(Context context, AccessTokenRetriever retriever)
context - the Application context.retriever - the implementation of AccessTokenRetriever to use to get the
User's
AccessToken.@LevelUpApi(contract=PUBLIC) @RequiresPermission(value="manage_user_payment_methods") @AccessTokenRequired public AbstractRequest buildCreateCardRequest(String cardNumber, String cvv, String expirationMonth, String expirationYear, String postalCode)
cardNumber - the card number for the card.cvv - the CVV (security code) of the card.expirationMonth - the month the card expires.expirationYear - the year the card expires.postalCode - the billing postal code of the card.AbstractRequest to create a card on the server.@LevelUpApi(contract=ENTERPRISE) @AccessTokenRequired public AbstractRequest buildGetCardsRequest()
AbstractRequest to use to get the credit cards for the current user.@LevelUpApi(contract=ENTERPRISE) @AccessTokenRequired public AbstractRequest buildPromoteCardRequest(CreditCard card)
card - the CreditCard to promote.AbstractRequest to use to promote a credit card.@LevelUpApi(contract=ENTERPRISE) @AccessTokenRequired public AbstractRequest buildDeleteCardRequest(CreditCard card)
card - the CreditCard to delete.AbstractRequest to use to delete a credit card.