Class CreatePaymentRequest
- All Implemented Interfaces:
Serializable
Payment.- Author:
- Chad Harchar (charchar), Chris Kittrell (ckittrell)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanjavax.money.MonetaryAmountThe payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.javax.money.MonetaryAmountThe amount for which the payment is allotted.Map to capture any additional information about the paymentThe billing address associated with this payment.General use map to capture any display properties for this Paymentjavax.money.MonetaryAmountThe payment's total fulfillment costThe gateway used to process this payment.getName()The name of this payment.The id of the entity that owns this payment.Describes the owner of the payment.The email address of the owning user identified byowningUserTypeandowningUserId.The id of the owning user that owns this payment.The name of the owning user identified byowningUserTypeandowningUserId.Describes the owning user type of the payment.Map to capture any information about the payment method needed to perform gateway transactionsThe id of the saved payment method that was used to build this payment object.The shipping address associated with this payment.javax.money.MonetaryAmountThe payment's total usually excluding adjustments, tax, and shipping.javax.money.MonetaryAmountThe payment's total tax costgetType()The type of this payment like Credit Card or Gift Card.inthashCode()booleanWhether or not the underlying payment method can only be used once.voidsetAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.voidsetAmount(javax.money.MonetaryAmount amount) The amount for which the payment is allotted.voidsetAttributes(Map<String, String> attributes) Map to capture any additional information about the paymentvoidsetBillingAddress(Address billingAddress) The billing address associated with this payment.voidsetDisplayAttributes(Map<String, String> displayAttributes) General use map to capture any display properties for this PaymentvoidsetFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal) The payment's total fulfillment costvoidsetGatewayType(String gatewayType) The gateway used to process this payment.voidThe name of this payment.voidsetOwnerId(String ownerId) The id of the entity that owns this payment.voidsetOwnerType(String ownerType) Describes the owner of the payment.voidsetOwningUserEmailAddress(String owningUserEmailAddress) The email address of the owning user identified byowningUserTypeandowningUserId.voidsetOwningUserId(String owningUserId) The id of the owning user that owns this payment.voidsetOwningUserName(String owningUserName) The name of the owning user identified byowningUserTypeandowningUserId.voidsetOwningUserType(String owningUserType) Describes the owning user type of the payment.voidsetPaymentMethodProperties(Map<String, String> paymentMethodProperties) Map to capture any information about the payment method needed to perform gateway transactionsvoidsetSavedPaymentMethodId(String savedPaymentMethodId) The id of the saved payment method that was used to build this payment object.voidsetShippingAddress(Address shippingAddress) The shipping address associated with this payment.voidsetShouldSavePaymentForFutureUse(boolean shouldSavePaymentForFutureUse) Should the payment method be saved to the owning user.voidsetShouldSavePaymentToCustomer(boolean shouldSavePaymentToCustomer) Deprecated.voidsetSingleUsePaymentMethod(boolean isSingleUsePaymentMethod) Whether or not the underlying payment method can only be used once.voidsetSubtotal(javax.money.MonetaryAmount subtotal) The payment's total usually excluding adjustments, tax, and shipping.voidsetTaxTotal(javax.money.MonetaryAmount taxTotal) The payment's total tax costvoidThe type of this payment like Credit Card or Gift Card.booleanShould the payment method be saved to the owning userbooleanDeprecated, for removal: This API element is subject to removal in a future version.since 1.0.2, in favor ofshouldSavePaymentForFutureUse()to support owning user types other than a customer (i.e.toString()
-
Constructor Details
-
CreatePaymentRequest
public CreatePaymentRequest()
-
-
Method Details
-
shouldSavePaymentToCustomer
Deprecated, for removal: This API element is subject to removal in a future version.since 1.0.2, in favor ofshouldSavePaymentForFutureUse()to support owning user types other than a customer (i.e. account). -
shouldSavePaymentForFutureUse
public boolean shouldSavePaymentForFutureUse()Should the payment method be saved to the owning user- Returns:
- Should the payment method be saved to the owning user
-
getOwnerType
Describes the owner of the payment. For example, the payment could have originated with a cart or a subscription, therefore this value might be CART or SUBSCRIPTION.- Returns:
- The type describing the owner of the payment
-
getOwnerId
The id of the entity that owns this payment. For example, this may be a cart id, or a subscription billing cycle id.- Returns:
- The id of the entity that owns this payment.
-
getOwningUserType
Describes the owning user type of the payment. For example, the payment could belong to a customer or an account, therefore this value might be BLC_CUSTOMER or BLC_ACCOUNT.This is typically specified for system-initiated actions where the current authentication is not the same as the owning user's context. For example, if the subscription service needs to create a payment for a new billing cycle, the authentication context is the system itself instead of the customer context that actually owns this payment.
This value is ignored if the owning user type can be resolved based on the current authentication.
- Returns:
- The type describing the owning user of the payment
- See Also:
-
getOwningUserId
The id of the owning user that owns this payment. For example, this may be a customer id, or an account id.This is typically specified for system-initiated actions where the current authentication is not the same as the owning user's context. For example, if the subscription service needs to create a payment for a new billing cycle, the authentication context is the system itself instead of the customer context that actually owns this payment.
This value is ignored if the owning user id can be resolved based on the current authentication.
- Returns:
- The id of the owning user that owns this payment.
-
getOwningUserName
The name of the owning user identified byowningUserTypeandowningUserId.- Returns:
- The name of the owning user.
-
getOwningUserEmailAddress
The email address of the owning user identified byowningUserTypeandowningUserId.- Returns:
- The email address of the owning user.
-
getName
The name of this payment. This name is typically something like "Visa ending in 1234".- Returns:
- The name of this payment.
-
getSavedPaymentMethodId
The id of the saved payment method that was used to build this payment object. Note: This property is only relevant if the user desires to use a saved payment method to pay for their order. Otherwise, this value should remain unset.- Returns:
- The id of the saved payment method.
-
isSingleUsePaymentMethod
public boolean isSingleUsePaymentMethod()Whether or not the underlying payment method can only be used once. In most cases, we're managing a single-use token that represents a credit card. This flag is especially important for managing payments with successful transactions. In those cases, the token has already been used and cannot be reused. If we need modify the payment's amount, then we may actually need to archive the existing payment, and create a new payment, with a new underlying token. Additionally, this flag is helpful when needing to re-authorize an expired authorization transaction. In that case, if the payment represents a single-use payment method, then the re-authorization may not be possible, and you'll need to seek an alternative form of payment.- Returns:
- Whether or not the underlying payment method can only be used once
-
getType
The type of this payment like Credit Card or Gift Card.- Returns:
- The type of this payment like Credit Card or Gift Card.
- See Also:
-
DefaultPaymentTypes
-
getGatewayType
The gateway used to process this payment. Only a SINGLE payment gateway can modify transactions on a particular payment.- Returns:
- The gateway used to process this payment.
- See Also:
-
PaymentGatewayType
-
getAmount
public javax.money.MonetaryAmount getAmount()The amount for which the payment is allotted.- Returns:
- The amount for which the payment is allotted.
-
getSubtotal
public javax.money.MonetaryAmount getSubtotal()The payment's total usually excluding adjustments, tax, and shipping.- Returns:
- The payment's total usually excluding adjustments, tax, and shipping.
-
getAdjustmentsTotal
public javax.money.MonetaryAmount getAdjustmentsTotal()The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.- Returns:
- The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.
-
getFulfillmentTotal
public javax.money.MonetaryAmount getFulfillmentTotal()The payment's total fulfillment cost- Returns:
- The payment's total fulfillment cost
-
getTaxTotal
public javax.money.MonetaryAmount getTaxTotal()The payment's total tax cost- Returns:
- The payment's total tax cost
-
getShippingAddress
The shipping address associated with this payment.- Returns:
- The shipping address associated with this payment.
-
getBillingAddress
The billing address associated with this payment.- Returns:
- The billing address associated with this payment.
-
getPaymentMethodProperties
Map to capture any information about the payment method needed to perform gateway transactions- Returns:
- Map to capture any information about the payment method needed to perform gateway transactions
-
getDisplayAttributes
General use map to capture any display properties for this Payment- Returns:
- General use map to capture any display properties for this Payment
-
getAttributes
Map to capture any additional information about the payment- Returns:
- Map to capture any additional information about the payment
-
setOwnerType
Describes the owner of the payment. For example, the payment could have originated with a cart or a subscription, therefore this value might be CART or SUBSCRIPTION.- Parameters:
ownerType- The type describing the owner of the payment
-
setOwnerId
The id of the entity that owns this payment. For example, this may be a cart id, or a subscription billing cycle id.- Parameters:
ownerId- The id of the entity that owns this payment.
-
setOwningUserType
Describes the owning user type of the payment. For example, the payment could belong to a customer or an account, therefore this value might be BLC_CUSTOMER or BLC_ACCOUNT.This is typically specified for system-initiated actions where the current authentication is not the same as the owning user's context. For example, if the subscription service needs to create a payment for a new billing cycle, the authentication context is the system itself instead of the customer context that actually owns this payment.
This value is ignored if the owning user type can be resolved based on the current authentication.
- Parameters:
owningUserType- The type describing the owning user of the payment- See Also:
-
setOwningUserId
The id of the owning user that owns this payment. For example, this may be a customer id, or an account id.This is typically specified for system-initiated actions where the current authentication is not the same as the owning user's context. For example, if the subscription service needs to create a payment for a new billing cycle, the authentication context is the system itself instead of the customer context that actually owns this payment.
This value is ignored if the owning user id can be resolved based on the current authentication.
- Parameters:
owningUserId- The id of the owning user that owns this payment.
-
setOwningUserName
The name of the owning user identified byowningUserTypeandowningUserId.- Parameters:
owningUserName- The name of the owning user.
-
setOwningUserEmailAddress
The email address of the owning user identified byowningUserTypeandowningUserId.- Parameters:
owningUserEmailAddress- The email address of the owning user.
-
setName
The name of this payment. This name is typically something like "Visa ending in 1234".- Parameters:
name- The name of this payment.
-
setSavedPaymentMethodId
The id of the saved payment method that was used to build this payment object. Note: This property is only relevant if the user desires to use a saved payment method to pay for their order. Otherwise, this value should remain unset.- Parameters:
savedPaymentMethodId- The id of the saved payment method.
-
setSingleUsePaymentMethod
public void setSingleUsePaymentMethod(boolean isSingleUsePaymentMethod) Whether or not the underlying payment method can only be used once. In most cases, we're managing a single-use token that represents a credit card. This flag is especially important for managing payments with successful transactions. In those cases, the token has already been used and cannot be reused. If we need modify the payment's amount, then we may actually need to archive the existing payment, and create a new payment, with a new underlying token. Additionally, this flag is helpful when needing to re-authorize an expired authorization transaction. In that case, if the payment represents a single-use payment method, then the re-authorization may not be possible, and you'll need to seek an alternative form of payment.- Parameters:
shouldSavePaymentToCustomer- Whether or not the underlying payment method can only be used once
-
setShouldSavePaymentToCustomer
Deprecated.since 1.0.2, in favor ofshouldSavePaymentForFutureUseto support owning user types other than a customer (i.e. account). -
setShouldSavePaymentForFutureUse
public void setShouldSavePaymentForFutureUse(boolean shouldSavePaymentForFutureUse) Should the payment method be saved to the owning user. Typically, this value is set totruewhen the payment's initial transaction is executed using a single-use token, and produces a mutli-use token that can be used for future purchases.- Parameters:
shouldSavePaymentForFutureUse- Should the payment method be saved to the owning user
-
setType
The type of this payment like Credit Card or Gift Card.- Parameters:
type- The type of this payment like Credit Card or Gift Card.- See Also:
-
DefaultPaymentTypes
-
setGatewayType
The gateway used to process this payment. Only a SINGLE payment gateway can modify transactions on a particular payment.- Parameters:
gatewayType- The gateway used to process this payment.- See Also:
-
PaymentGatewayType
-
setAmount
public void setAmount(javax.money.MonetaryAmount amount) The amount for which the payment is allotted.- Parameters:
amount- The amount for which the payment is allotted.
-
setSubtotal
public void setSubtotal(javax.money.MonetaryAmount subtotal) The payment's total usually excluding adjustments, tax, and shipping. -
setAdjustmentsTotal
public void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts. -
setFulfillmentTotal
public void setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal) The payment's total fulfillment cost -
setTaxTotal
public void setTaxTotal(javax.money.MonetaryAmount taxTotal) The payment's total tax cost -
setShippingAddress
The shipping address associated with this payment.- Parameters:
shippingAddress- The shipping address associated with this payment.
-
setBillingAddress
The billing address associated with this payment.- Parameters:
billingAddress- The billing address associated with this payment.
-
setPaymentMethodProperties
Map to capture any information about the payment method needed to perform gateway transactions- Parameters:
paymentMethodProperties- Map to capture any information about the payment method needed to perform gateway transactions
-
setDisplayAttributes
General use map to capture any display properties for this Payment- Parameters:
displayAttributes- General use map to capture any display properties for this Payment
-
setAttributes
Map to capture any additional information about the payment- Parameters:
attributes- Map to capture any additional information about the payment
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
shouldSavePaymentForFutureUseto support owning user types other than a customer (i.e.