public class PayPalRequest
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<PayPalRequest> |
CREATOR |
static java.lang.String |
INTENT_AUTHORIZE |
static java.lang.String |
INTENT_ORDER |
static java.lang.String |
INTENT_SALE |
static java.lang.String |
LANDING_PAGE_TYPE_BILLING
A non-PayPal account landing page is used.
|
static java.lang.String |
LANDING_PAGE_TYPE_LOGIN
A PayPal account login page is used.
|
static java.lang.String |
USER_ACTION_COMMIT
Shows a deterministic call-to-action.
|
static java.lang.String |
USER_ACTION_DEFAULT
Shows the default call-to-action text on the PayPal Express Checkout page.
|
Constructor and Description |
---|
PayPalRequest()
Constructs a
PayPalRequest with a null amount. |
PayPalRequest(android.os.Parcel in) |
PayPalRequest(java.lang.String amount)
Constructs a description of a PayPal checkout for Single Payment and Billing Agreements.
|
Modifier and Type | Method and Description |
---|---|
PayPalRequest |
billingAgreementDescription(java.lang.String description)
Display a custom description to the user for a billing agreement.
|
PayPalRequest |
currencyCode(java.lang.String currencyCode)
Optional: A valid ISO currency code to use for the transaction.
|
int |
describeContents() |
PayPalRequest |
displayName(java.lang.String displayName)
The merchant name displayed in the PayPal flow; defaults to the company name on your Braintree account.
|
java.lang.String |
getAmount() |
java.lang.String |
getBillingAgreementDescription() |
java.lang.String |
getCurrencyCode() |
java.lang.String |
getDisplayName() |
java.lang.String |
getIntent() |
java.lang.String |
getLandingPageType() |
java.util.ArrayList<PayPalLineItem> |
getLineItems() |
java.lang.String |
getLocaleCode() |
java.lang.String |
getMerchantAccountId() |
PayPalProductAttributes |
getProductAttributes() |
PostalAddress |
getShippingAddressOverride() |
java.lang.String |
getUserAction() |
PayPalRequest |
intent(java.lang.String intent)
Payment intent.
|
boolean |
isShippingAddressEditable() |
boolean |
isShippingAddressRequired() |
PayPalRequest |
landingPageType(java.lang.String landingPageType)
Use this option to specify the PayPal page to display when a user lands on the PayPal site to complete the payment.
|
PayPalRequest |
lineItems(java.util.Collection<PayPalLineItem> lineItems)
The line items for this transaction.
|
PayPalRequest |
localeCode(java.lang.String localeCode)
Whether to use a custom locale code.
|
PayPalRequest |
merchantAccountId(java.lang.String merchantAccountId)
Specify a merchant account Id other than the default to use during tokenization.
|
PayPalRequest |
offerCredit(boolean offerCredit)
Offers PayPal Credit prominently in the payment flow.
|
PayPalRequest |
offerPayLater(boolean offerPayLater)
Offers PayPal Pay Later prominently in the payment flow.
|
PayPalRequest |
productAttributes(PayPalProductAttributes productAttributes) |
PayPalRequest |
shippingAddressEditable(boolean shippingAddressEditable)
Defaults to false.
|
PayPalRequest |
shippingAddressOverride(PostalAddress shippingAddressOverride)
A custom shipping address to be used for the checkout flow.
|
PayPalRequest |
shippingAddressRequired(boolean shippingAddressRequired)
Defaults to false.
|
boolean |
shouldOfferCredit() |
boolean |
shouldOfferPayLater() |
PayPalRequest |
userAction(java.lang.String userAction)
Set the checkout user action which determines the button text.
|
void |
writeToParcel(android.os.Parcel parcel,
int i) |
public static final java.lang.String INTENT_ORDER
public static final java.lang.String INTENT_SALE
public static final java.lang.String INTENT_AUTHORIZE
public static final java.lang.String LANDING_PAGE_TYPE_BILLING
public static final java.lang.String LANDING_PAGE_TYPE_LOGIN
public static final java.lang.String USER_ACTION_DEFAULT
public static final java.lang.String USER_ACTION_COMMIT
public static final android.os.Parcelable.Creator<PayPalRequest> CREATOR
public PayPalRequest(java.lang.String amount)
amount
- The transaction amount in currency units (as
determined by setCurrencyCode). For example, "1.20" corresponds to one dollar and twenty cents.
Amount must be a non-negative number, may optionally contain exactly 2 decimal places separated
by '.', optional thousands separator ',', limited to 7 digits before the decimal point.public PayPalRequest()
PayPalRequest
with a null amount.public PayPalRequest(android.os.Parcel in)
public PayPalRequest currencyCode(java.lang.String currencyCode)
currencyCode
- A currency code, such as "USD"public PayPalRequest shippingAddressRequired(boolean shippingAddressRequired)
shippingAddressRequired
- Whether to hide the shipping address in the flow.public PayPalRequest shippingAddressEditable(boolean shippingAddressEditable)
shippingAddressOverride(PostalAddress)
is set
with a PostalAddress
.shippingAddressEditable
- Whether to allow the the shipping address to be editable.public PayPalRequest localeCode(java.lang.String localeCode)
da_DK
,
de_DE
,
en_AU
,
en_GB
,
en_US
,
es_ES
,
es_XC
,
fr_CA
,
fr_FR
,
fr_XC
,
id_ID
,
it_IT
,
ja_JP
,
ko_KR
,
nl_NL
,
no_NO
,
pl_PL
,
pt_BR
,
pt_PT
,
ru_RU
,
sv_SE
,
th_TH
,
tr_TR
,
zh_CN
,
zh_HK
,
zh_TW
,
zh_XC
.localeCode
- Whether to use a custom locale code.public PayPalRequest displayName(java.lang.String displayName)
displayName
- The name to be displayed in the PayPal flow.public PayPalRequest billingAgreementDescription(java.lang.String description)
description
- The description to display.public PayPalRequest shippingAddressOverride(PostalAddress shippingAddressOverride)
shippingAddressOverride
- a custom PostalAddress
public PayPalRequest intent(java.lang.String intent)
INTENT_SALE
for immediate payment,
INTENT_AUTHORIZE
to authorize a payment for capture later, or
INTENT_ORDER
to create an order.
Defaults to authorize. Only works in the Single Payment flow.intent
- Must be a PayPalPaymentIntent
value:
INTENT_AUTHORIZE
to authorize a payment for capture later INTENT_ORDER
to create an order INTENT_SALE
for immediate payment public PayPalRequest landingPageType(java.lang.String landingPageType)
landingPageType
- Must be a PayPalLandingPageType
value:
public PayPalRequest userAction(java.lang.String userAction)
userAction
- Must be a be PayPalPaymentUserAction
value:
public PayPalRequest offerCredit(boolean offerCredit)
offerCredit
- Whether to offer PayPal Credit.public PayPalRequest offerPayLater(boolean offerPayLater)
offerPayLater
- Whether to offer PayPal Pay Later.public PayPalRequest merchantAccountId(java.lang.String merchantAccountId)
merchantAccountId
- the non-default merchant account Id.public PayPalRequest lineItems(java.util.Collection<PayPalLineItem> lineItems)
lineItems
- a collection of PayPalLineItem
public PayPalRequest productAttributes(PayPalProductAttributes productAttributes)
public java.lang.String getAmount()
public java.lang.String getCurrencyCode()
public java.lang.String getLocaleCode()
public java.lang.String getBillingAgreementDescription()
public boolean isShippingAddressRequired()
public boolean isShippingAddressEditable()
public PostalAddress getShippingAddressOverride()
public java.lang.String getDisplayName()
public boolean shouldOfferCredit()
public boolean shouldOfferPayLater()
public java.lang.String getMerchantAccountId()
public java.util.ArrayList<PayPalLineItem> getLineItems()
public PayPalProductAttributes getProductAttributes()
public java.lang.String getIntent()
public java.lang.String getLandingPageType()
public java.lang.String getUserAction()
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel parcel, int i)
writeToParcel
in interface android.os.Parcelable