Class PayLater
The PayPal Pay Later service allows online merchants to offer promotional financing to buyers at checkout - even if a buyer doesn't have a PayPal account. Promotional offers, such as no payments for 90 days, give merchants new and powerful ways to market to online shoppers.
................. // Following example shows how to use Pay Later. PayLater setPayLater = new PayLater(); setPayLater.setshippingMethod("UPSGround"); setPayLater.setproductCategory("E"); // Camera and Photos setPayLater.setpromoCodeOverride("1"); setPayLater.setpaypalCheckoutBtnType("P"); // You can combine up to 10 promotions for PayPal Promotional Financing. // L_PROMOCODE0 PayLaterLineItem setPayLaterLineItem = new PayLaterLineItem(); setPayLaterLineItem.setpromoCode("101"); setPayLater.PayLaterAddLineItem(setPayLaterLineItem); // L_PROMOCODE1 PayLaterLineItem setPayLaterLineItem1 = new PayLaterLineItem(); setPayLaterLineItem1.setpromoCode("102"); setPayLater.PayLaterAddLineItem(setPayLaterLineItem1); .................
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected ContextGets the PayPal Checkout Button TypeGets the Product Category.Gets Profile Address Change DateGets Promo Code Overrideprotected StringBufferGets the Requestbuffer used for creating the actual request string.Gets the shippingMethodvoidAdds a promo code to promo code list.voidClears the promo code list.voidPayLaterRemoveLineItem(int index) Removes a line item from line item list.protected voidsetContext(Context context) voidsetpaypalCheckoutBtnType(String paypalCheckoutBtnType) Sets the PayPal Checkout Button TypevoidsetproductCategory(String productCategory) Sets the Product Category.voidsetprofileAddressChangeDate(String profileAddressChangeDate) Sets Profile Address Change DatevoidsetpromoCodeOverride(String promoCodeOverride) Sets Promo Code Overrideprotected voidsetRequestBuffer(StringBuffer value) sets the StringBuffer to hold the request string.voidsetshippingMethod(String shippingMethod) Sets the shippingMethod
-
Constructor Details
-
PayLater
public PayLater()Constructor. This is a default constructor which does not take any parameters. *
-
-
Method Details
-
PayLaterAddLineItem
Adds a promo code to promo code list.- Parameters:
item- PayLaterLineItem objectUse this method to add a promo code to the request. A promotion code for PayPal Promotional Financing where n is a value from 0 to 9. The first promotion must be specified as L_PROMOCODE0. Combine promotions by using additonal parameters, such as L_PROMOCODE1 and L_PROMOCODE2
................. // setPayLaterLineItem is the PayLaterLineItem object. ................. // Create new Promo Code or Codes. You can combine up to 10 promotions. // First promo code, L_PROMOCODE0 PayLaterLineItem setPayLaterLineItem = new PayLaterLineItem(); setPayLaterLineItem.setpromoCode("101"); setPayLater.PayLaterAddLineItem(setPayLaterLineItem); // Additional promo code (if needed), L_PROMOCODE1. All addtional codes created in // this manner. PayLaterLineItem setPayLaterLineItem1 = new PayLaterLineItem(); setPayLaterLineItem1.setpromoCode("102"); setPayLater.PayLaterAddLineItem(setPayLaterLineItem1); .................
-
PayLaterRemoveLineItem
public void PayLaterRemoveLineItem(int index) Removes a line item from line item list.- Parameters:
index- Index of promo code to be removed.Use this method to remove a promo code at a particular index in the requestr.
................. // setPayLater is the PayLater object ................. // Remove promo code at index 0 setPayLater.PayLaterRemoveLineItem(0); .................
-
PayLaterRemoveAllLineItems
public void PayLaterRemoveAllLineItems()Clears the promo code list.Use this method to clear all the promo codes added to the request.
................. // setPayLater is the PayLater object ................. // Remove all promo codes. setPayLater.PayLaterRemoveAllLineItems(); .................
-
generateRequest
protected void generateRequest() -
getshippingMethod
Gets the shippingMethodUse this to get the Shipping method for this transaction.
- Returns:
- String
Maps to Payflow Parameter: SHIPPINGMETHOD
-
setshippingMethod
Sets the shippingMethodUse this method to set the Shipping method for this transaction.
- Parameters:
shippingMethod- StringMaps to Payflow Parameter: SHIPPINGMETHOD
-
getpromoCodeOverride
Gets Promo Code OverrideValue is 0 or 1. Default value is 0. Set to 1 to override promotions from Set Express Checkout request. Otherwise, promotions will not be overridden.
- Returns:
- String
Maps to Payflow Parameter: PROMOCODEOVERRIDE
-
setpromoCodeOverride
Sets Promo Code OverrideValue is 0 or 1. Default value is 0. Set to 1 to override promotions from Set Express Checkout request. Otherwise, promotions will not be overridden.
- Parameters:
promoCodeOverride- StringMaps to Payflow Parameter: PROMOCODEOVERRIDE
-
getprofileAddressChangeDate
Gets Profile Address Change DateThe last date that the billing address stored in the customer's profile with the merchant was changed. The date must be in UTC/GMT format. For example, 2007-12-15T17:23:15Z.
- Returns:
- String
Maps to Payflow Parameter: PROFILEADDRESSCHANGEDATE
-
setprofileAddressChangeDate
Sets Profile Address Change DateThe last date that the billing address stored in the customer's profile with the merchant was changed. The date must be in UTC/GMT format. For example, 2007-12-15T17:23:15Z.
- Parameters:
profileAddressChangeDate- StringMaps to Payflow Parameter: PROFILEADDRESSCHANGEDATE
-
getpaypalCheckoutBtnType
Gets the PayPal Checkout Button TypeOnly for the No payment 90 days button, you must set this variable to P, which allows PayPal to make 90 days no payments the default payment option in the PayPal checkout flow.
- Returns:
- String
Maps to Payflow Parameter: PAYPALCHECKOUTBTNTYPE
-
setpaypalCheckoutBtnType
Sets the PayPal Checkout Button TypeOnly for the No payment 90 days button, you must set this variable to P, which allows PayPal to make 90 days no payments the default payment option in the PayPal checkout flow.
- Parameters:
paypalCheckoutBtnType- StringMaps to Payflow Parameter: PAYPALCHECKOUTBTNTYPE
-
getproductCategory
Gets the Product Category.The product category for this order. If the customer's cart contains more than one item, use the product category for the most expensive item.
- Returns:
- String
Maps to Payflow Parameter: PRODUCTCATEGORY
-
setproductCategory
Sets the Product Category.The product category for this order. If the customer's cart contains more than one item, use the product category for the most expensive item.
- Parameters:
productCategory- StringMaps to Payflow Parameter: PRODUCTCATEGORY
-
getContext
-
setContext
-
getRequestBuffer
Gets the Requestbuffer used for creating the actual request string.- Returns:
- mRequestBuffer StringBuffer
-
setRequestBuffer
sets the StringBuffer to hold the request string.- Parameters:
value- StringBuffer
-