Я пытаюсь использовать систему Paypal Website Payments Pro Recurring Payments.Однако при возврате из Paypal, похоже, отсутствуют некоторые данные, и выдается следующее:
java.lang.NumberFormatException: неверная дата / время в org.apache.axis.encoding.ser.CalendarDeserializer.makeValue (CalendarDeserializer.java:64)
Это только когда я вызываю CreateRecurringPaymentsProfile
после установки всех данных.Дата и время, которое я отправляю для RecurringPaymentsProfileDetailsType
, верны, и ошибка в следующем:
<cfreturn pp_caller.call("CreateRecurringPaymentsProfile",pp_request)#>
Вот метод, о котором идет речь:
<cffunction name="CreateRecurringPaymentsProfile" returntype="any" output="no">
<cfargument name="buyerLastName" type="string" required="true">
<cfargument name="buyerFirstName" type="string" required="true">
<cfargument name="buyerAddress1" type="string" required="true">
<cfargument name="buyerAddress2" type="string">
<cfargument name="buyerCity" type="string" required="true">
<cfargument name="buyerZipCode" type="string" required="true">
<cfargument name="buyerState" type="string" required="true">
<cfargument name="creditCardType" type="string" required="true">
<cfargument name="creditCardNumber" type="string" required="true">
<cfargument name="CVV2" type="string" required="true">
<cfargument name="expMonth" type="string" required="true">
<cfargument name="expYear" type="string" required="true">
<cfargument name="paymentAmount" type="string" required="true">
<cfargument name="paypalToken" type="string" required="true">
<cfscript>
//*******
currencies = CreateObject("java", "com.paypal.soap.api.CurrencyCodeType");
userStatusCodes = CreateObject("java", "com.paypal.soap.api.PayPalUserStatusCodeType");
details= CreateObject("java", "com.paypal.soap.api.CreateRecurringPaymentsProfileRequestDetailsType");
// Create the request object
pp_request = CreateObject("java", "com.paypal.soap.api.CreateRecurringPaymentsProfileRequestType");
pp_request.setVersion(53);
if(paypalToken IS ''){
creditCardTypes = CreateObject("java", "com.paypal.soap.api.CreditCardTypeType");
countryCodes = CreateObject("java", "com.paypal.soap.api.CountryCodeType");
paymentTypes = CreateObject("java", "com.paypal.soap.api.PaymentActionCodeType");
creditCard = CreateObject("java", "com.paypal.soap.api.CreditCardDetailsType");
switch(creditCardType)
{
case "Visa":
{
creditCard.setCreditCardType(creditCardTypes.Visa);
break;
}
case "MasterCard":
{
creditCard.setCreditCardType(creditCardTypes.MasterCard);
break;
}
case "Discover":
{
creditCard.setCreditCardType(creditCardTypes.Discover);
break;
}
case "Amex":
{
creditCard.setCreditCardType(creditCardTypes.Amex);
break;
}
} //end switch
creditCard.setCreditCardNumber(creditCardNumber);
creditCard.setExpMonth(expMonth);
creditCard.setExpYear(expYear);
creditCard.setCVV2(CVV2);
// Payer info
cardOwner = CreateObject("java", "com.paypal.soap.api.PayerInfoType");
// Name
payerName = CreateObject("java", "com.paypal.soap.api.PersonNameType");
payerName.setFirstName(buyerFirstName);
payerName.setLastName(buyerLastName);
// Address
address = CreateObject("java", "com.paypal.soap.api.AddressType");
address.setStreet1(buyerAddress1);
address.setStreet2(buyerAddress2);
address.setCityName(buyerCity);
address.setStateOrProvince(buyerState);
address.setPostalCode(buyerZipCode);
address.setCountryName("USA");
address.setCountry(countryCodes.US);
cardOwner.setPayerName(payerName);
cardOwner.setPayerCountry(countryCodes.US);
cardOwner.setAddress(address);
creditCard.setCardOwner(cardOwner);
details.setCreditCard(creditCard);
}
else{
details.setToken(paypalToken);
}
// Details
recurringDetails= CreateObject("java", "com.paypal.soap.api.RecurringPaymentsProfileDetailsType");
//MAKE A JAVA DATE
calendar = CreateObject("java", "java.util.Calendar");
calendarObj1 = calendar.getInstance();
calendarObj1.setTime(now());
recurringDetails.setBillingStartdate(calendarObj1);
// Schedule Details
scheduleDetails= CreateObject("java", "com.paypal.soap.api.ScheduleDetailsType");
scheduleDetails.setDescription("Tattooed Pages Subscription");
billPeriodDetails= CreateObject("java", "com.paypal.soap.api.BillingPeriodDetailsType");
billingPeriodTypes= CreateObject("java", "com.paypal.soap.api.BillingPeriodType");
billPeriodDetails.setBillingFrequency(1);
billPeriodDetails.setBillingPeriod(billingPeriodTypes.Month);
orderTotal = CreateObject("java", "com.paypal.soap.api.BasicAmountType");
orderTotal.setCurrencyID(currencies.USD);
orderTotal.set_value(paymentAmount);
billPeriodDetails.setAmount(orderTotal);
scheduleDetails.setPaymentPeriod(billPeriodDetails);
details.setRecurringPaymentsProfileDetails(recurringDetails);
details.setScheduleDetails(scheduleDetails);
pp_request.setCreateRecurringPaymentsProfileRequestDetails(details);
//*******
</cfscript>
<cfreturn #pp_caller.call("CreateRecurringPaymentsProfile", pp_request)#>
Поскольку это происходит вCalendarDeserializer
, похоже, он возвращается из Paypal.