Home > Requesting Services > Set Service


Set Service

The payPalEcSetService service:

nAlerts PayPal that an order is going to occur.

nReturns the PayPal token which is the token that identifies this session.

After payPalEcSetService returns, you must redirect your customer’s browser to the PayPal web site.

Redirection URLs

PayPal has a specific URL for each of the two Express Checkout customer experience flows.

Traditional Express Checkout Redirection URL

For Traditional Express Checkout, use the following URL and append the value of the PayPal token:

https://www.paypal.com/cgibin/webscr?cmd=_express-checkout&token=

Therefore, if the PayPal token is EC-4WL17777V4111184H, you will redirect this customer’s browser to:

https://www.paypal.com/cgibin/webscr?cmd=_express-checkout&token=EC-4WL17777V4111184H

For more information on Traditional Express Checkout, see Traditional Express Checkout Flow.

In-Context Express Checkout Redirection URL

For In-Context Express Checkout, use the following URL and append the value of the PayPal token:

https://www.paypal.com/checkoutnow?&useraction=commit&token=

Therefore, if the PayPal Token is EC-4WL17777V4111184H, you will redirect this customer’s browser to:

https://www.paypal.com/checkoutnow?&useraction=commit&token=EC-4WL17777V4111184H

For more information on In-Context Express Checkout, see In-Context Express Checkout Flow.

At the PayPal site, the customer can review and either approve or cancel the transaction. If the customer approves the transaction, the customer is redirected to the return URL in the field payPalEcSetServicePaypalReturn. If the customer cancels the transaction, the customer is redirected to the return URL in the field payPalEcSetServicePaypalCancel
Return.

 

The PayPal Sandbox URL for confirming CAS/Sandbox payments is:

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=

As with the production URL, you need to append your PayPal token to the end of the URL.

Multiple Calls to the Set Service

If, after the first call to payPalEcSetService, the customer realizes the shipping address is incorrect, you can let the customer enter a different shipping address and then you can call payPalEcSetService again as a follow-on service.

 

If you are using Cybersource Decision Manager, do not allow customers to change their shipping addresses in the PayPal portion of the session.

 

After each call to payPalEcSetService, you must redirect the customer’s browser to the PayPal web page, appending the PayPal token to the URL listed above.

Required Fields

When you request payPalEcSetService, you must include the following fields in the request:

npayPalEcSetService_run

npayPalEcSetService_paypalReturn

npayPalEcSetService_paypalCancelReturn

nmerchantID

nmerchantReferenceCode

npurchaseTotals_currency

npurchaseTotals_grandTotalAmount or at least one item_#_unitPrice field

 

To enable item-level fields, contact Cybersource Customer Support to have your account configured for this feature. For important information about items and subtotals, see Requirements for the Subtotal.

For calls to payPalEcSetService after the first call, the following fields are also required:

npayPalEcSetService_paypalEcSetRequestID

npayPalEcSetService_paypalEcSetRequestToken

For calls to payPalEcSetService that initiate the creation of a billing agreement, include the following fields:

npayPalEcSetService_paypalBillingType (required)

npayPalEcSetService_paypalBillingAgreementDesc (optional)

npayPalEcSetService_paypalBillingAgreementCustom (optional)

npayPalEcSetService_paypalPaymentType (optional)

Additional fields are optional. The required and optional fields are described in API Fields.