public class OrderRequest extends JWTClaim
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLAIM_NAME |
Constructor and Description |
---|
OrderRequest()
Empty Constructor
|
OrderRequest(javax.json.JsonObject jsonObject)
JSON Parseable constructor
|
OrderRequest(org.jose4j.jwt.JwtClaims jwtClaims)
Parse from JWTClaims constructor
|
OrderRequest(java.lang.String articleId,
int calculatedUnits,
java.util.List<PaymentOption> paymentOptions,
boolean payPerRequest)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
convertToJson(javax.json.JsonObjectBuilder jsonObjectBuilder)
Method that should set the objects property to Json representation.
|
java.lang.String |
getArticleId() |
java.lang.String |
getClaimName() |
java.util.List<PaymentOption> |
getPaymentOptions() |
int |
getUnits() |
boolean |
isPayPerRequest() |
void |
parseJson(javax.json.JsonObject jsonObject)
Method to read all properties from a JsonObject into this value object.
|
void |
setArticleId(java.lang.String articleId) |
void |
setPaymentOptions(java.util.List<PaymentOption> paymentOptions) |
void |
setPayPerRequest(boolean payPerRequest) |
void |
setUnits(int units) |
add, addB58, addNotRequired, addNotRequiredB58, getBoolean, getBooleanIfSet, getByteArrayFromB58, getByteArrayFromB58IfSet, getByteArrayFromB64, getByteArrayFromB64IfSet, getByteArrayFromHex, getByteArrayFromHexIfSet, getDate, getDateIfSet, getDouble, getDoubleIfSet, getInt, getIntIfSet, getJsonArray, getJsonArrayIfSet, getJsonObject, getJsonObjectIfSet, getLong, getLongIfSet, getString, getStringIfSet, toJson, toJsonAsString, toString
public static final java.lang.String CLAIM_NAME
public OrderRequest()
public OrderRequest(java.lang.String articleId, int calculatedUnits, java.util.List<PaymentOption> paymentOptions, boolean payPerRequest)
articleId
- the article id derived from PaymentRequired notation and OrderRequestGenerator.calculatedUnits
- the calculated units for paymentRequiredAnnotation unit calculator.paymentOptions
- optional payment options which can be custom values defined between
PaymentRequired annotation and used PaymentHandler.payPerRequest
- true if payment only should be valid for one payment, set by annotation, but
PaymentHandler might override this setting. Important: If used must PaymentData implementation
implement PerRequestPaymentData.public OrderRequest(javax.json.JsonObject jsonObject) throws javax.json.JsonException
jsonObject
- the json object to parsejavax.json.JsonException
public OrderRequest(org.jose4j.jwt.JwtClaims jwtClaims)
jwtClaims
- the JWT Tokens Claim set to extract data from.public java.lang.String getClaimName()
getClaimName
in class JWTClaim
public java.lang.String getArticleId()
public void setArticleId(java.lang.String articleId)
articleId
- the article id derived from PaymentRequired notation and OrderRequestGenerator.public int getUnits()
public void setUnits(int units)
units
- the number of units ordered.public java.util.List<PaymentOption> getPaymentOptions()
public void setPaymentOptions(java.util.List<PaymentOption> paymentOptions)
paymentOptions
- optional payment options which can be custom values defined between
PaymentRequired annotation and used PaymentHandler.public boolean isPayPerRequest()
public void setPayPerRequest(boolean payPerRequest)
payPerRequest
- true if payment only should be valid for one payment, set by annotation, but
PaymentHandler might override this setting. Important: If used must PaymentData implementation
implement PerRequestPaymentData.public void convertToJson(javax.json.JsonObjectBuilder jsonObjectBuilder) throws javax.json.JsonException
convertToJson
in class JSONParsable
jsonObjectBuilder
- the json object build to use to set key/values in jsonjavax.json.JsonException
- if problems occurred converting object to JSON.public void parseJson(javax.json.JsonObject jsonObject) throws javax.json.JsonException
parseJson
in class JSONParsable
jsonObject
- the json object to read key and values from and set object properties.javax.json.JsonException
- if problems occurred converting object from JSON.