• No results found

Processing a Credit

You can perform a credit for a regular payment or a preapproved payment by using payPalCreditService. For general information about refunding PayPal payments, see

"PayPal Credits," page 13.

To request the service, send a request with payPalCreditService_run=true. A PayPal credit is a follow-on service. It uses the requestID returned from a previous

payPalButtonCreateService or payPalPreapprovedPaymentService request to link the credit to the payment. Send the request ID value in the payPalCreditService_

payPalPaymentRequestID field. CyberSource uses these values to look up the

customer’s billing and account information from the original payment, so you do not have to supply those fields in the payPalCreditService request. See Appendix A, "Examples for the Simple Order API," on page 110 for example requests and replies.

When requesting the service, do not include any other ICS services in the request.

Request Fields

The following table lists the request fields for processing a credit.

Important

You must perform the credit within 60 days of the payment request.

At this time, you can perform only one credit for an order, for either a partial amount or the full amount of the payment.

Table 10 PayPal Credit Request Fields

Request Field Description Required /

Optional

Data Type &

Length item_#_productCode Type of product. The default value is default. See

"Product Codes," page 152 for a list of valid values.

Optional String (30)

item_#_productName Product’s name. Optional String (30)

item_#_productSKU Product’s identifier code. Optional String (30) item_#_quantity Quantity of the product being returned. Optional Integer

(10) item_#_taxAmount Total tax to apply to the product. Optional String (15) item_#_unitPrice Amount of the credit. At this time, you can perform

only one credit for an order, for either a partial amount or the full amount of the payment.

You must include either this field or purchaseTotals_

grandTotalAmount in your request. See the

See description

String (15)

merchantID Your CyberSource merchant ID. Use the same merchantID for evaluation, testing, and production.

Required String (30)

merchantReferenceCode Merchant-generated order reference or tracking number. See the information about order tracking in Getting Started with CyberSource Advanced.

Required String (50)

orderRequestToken The request token value returned from a previous request. This value links the previous request to the current follow-on request. This field is an encoded string that does not contain any confidential information, such as account numbers or card verification numbers. The string can contain a maximum of 256 characters.

Required String (256)

payPalCreditService_

payPalPaymentRequest ID

Request ID from the payment reply. Required String (26)

payPalCreditService_

payPalPaymentRequest Token

The requestToken value returned from a previous request for payPalButtonCreateService or payPalPreapprovedPaymentService.

The field is an encoded string that contains no confidential information, such as an account number or card verification number. The string can contain a maximum of 256 characters.

Optional String (256)

payPalCreditService_run Set to true to request payPalCreditService. Required String (5) purchaseTotals_currency Currency used for the order. PayPal currently accepts

orders that use USD, CAD, EUR, GBP, or JPY only.

Required String (5)

purchaseTotals_

grandTotalAmount

Amount of the credit. At this time, you can perform only one credit for an order, for either a partial amount or the full amount of the payment.

You must include either this field or item_#_unitPrice in your request. See the information about items and grand totals in Getting Started with CyberSource Advanced. This value cannot be negative.

See description

String (15) Table 10 PayPal Credit Request Fields (Continued)

Request Field Description Required /

Optional

Data Type &

Length

Reply Fields

The following table lists the reply fields for processing a credit.

Table 11 PayPal Credit Reply Fields

Reply Field Description Data

Type &

Length decision Summarizes the result of the overall request. The field can contain

one of the following values:

ACCEPT

ERROR

REJECT

String (6)

invalidField_0...N Fields in the request that contained invalid data. These reply fields are included as an aid to software developers only. No attempt should be made to use these fields for end user interaction.See the information about missing and invalid fields in Getting Started with CyberSource Advanced.

String (100)

merchantReferenceCode Order reference or tracking number that you provided in the request. If you included multi-byte characters in this field in the request, the returned value might contain corrupted characters.

String (50)

missingField_0...N Required fields that were missing from the request. These reply fields are included as an aid to software developers only. No attempt should be made to use these fields for end user interaction.

See the information about missing and invalid fields in Getting Started with CyberSource Advanced.

String (100)

payPalCreditReply_amount Amount of the credit. String (15)

payPalCreditReply_

reasonCode

A numeric value corresponding to the result of the PayPal credit request. See "Reason Codes," page 70 for a list of possible values.

Integer (5)

payPalCreditReply_

reconciliationID

Reference number for the transaction that you use to reconcile your transactions.

String (60)

payPalCreditReply_

requestDateTime

Time of the PayPal credit. The format is

YYYY-MM-DDThh:mm:ssZ. For example, 2003-08-11T22:47:57Z is equalto August 11, 2003, at 10:47:57 P.M. The T separates the date and the time. The Z indicates UTC.

String (20)

purchaseTotals_currency Currency used for the order. String (5) reasonCode Numeric value corresponding to the result of the overall request.

See "Reason Codes," page 70 for a list of possible values.

Integer (5)

requestID Unique identifier for the request. String (26)

requestToken Request token data created by CyberSource for each reply. The field is an encoded string that contains no confidential information such as an account or card verification number. The string can

String (256)