I want to save an unpaid order that uses a payment plan to store the credit card. The API documentation says about CheckoutEx4's `iCCType` parameter, "Pass 0 to omit a payment method if saving an unpaid order." All goes well if I pass the invoice payment method, but when I pass `0`, I get the exception "System.Data.SqlClient.SqlException: Invalid Payment Method". How can I save this order?
Here's a distilled version of the algorithm that's throwing the exception:
var sessionKey = client.GetNewSessionKeyEx(
string
.Empty, 1);
var loginRequest =
new
LoginEx3Request()
{
bAlreadyAuthenticated =
false
,
iCustomerNo = 0,
iLoginType = LOGIN_TYPE,
iN1N2 = 0,
iPromotionCode = 0,
sEmail = EMAIL,
sForgotLoginToken =
.Empty,
sPhone =
sPostalCode =
sPwd = PASSWORD,
sSessionKey = sessionKey,
sUID =
.Empty
};
var loginResult = client.LoginEx3(loginRequest);
var reserveSeatsRequest =
ReserveTicketsExRequest()
iNumberOfSeats = 1,
iPerformanceNumber = 5757,
iZone = 40,
sPriceType =
"36"
sSpecialRequests =
sWebSessionID = sessionKey
var reservedSeatCount = client.ReserveTicketsEx(reserveSeatsRequest);
var farFutureDate = DateTime.Now.AddYears(100).ToString();
var orderWithNewPaymentPlan = client.CreatePaymentPlan(
sSessionKey: sessionKey,
sStartDate: farFutureDate,
sEndDate: farFutureDate,
iBillingScheduleId: 10,
iNumberOfPayments: 0);
var orderWithFinalizedPaymentPlan = client.FinalizePaymentPlan(
sCCOwner:
"Test Test"
sCCNumber: TEST_CREDIT_CARD_NUMBER,
iCCType: 28,
iCCMonth: 5,
iCCYear: DateTime.Now.Year + 1,
sCardAuthenticationCode:
iCCIssueNumber: 0,
iCCStartMonth: 0,
iCCStartYear: 0,
iBillingType: 7);
var checkoutRequest =
CheckoutEx4Request()
bAllowUnderPayment =
bAuthorize =
dAmount = 0.98m,
iAccountId = 0,
iCCIssueNumber = 0,
iCCMonth = 0,
iCCStartMonth = 0,
iCCStartYear = 0,
iCCType = 0,
// payment method ID
iCCYear = 0,
s3DSecureValues =
sAddress =
sAuthorizationCode =
"n/a (saving credit card)"
sCardAuthenticationCode = string.Empty
sCCNumber =
sCCOwner =
sPaymentReference =
sZipCode =
var checkoutResult = client.CheckoutEx4(checkoutRequest);
To reiterate, the last line throws the exception when `iCCType` is `0`, but not when it's the invoice payment method.
(x-post from https://developer.tessituranetwork.com/display/devportal/Save+an+unpaid+order+with+credit+card+info+stored+in+a+payment+plan)
Were you able to solve this? We are looking at a payment plan option with no, or little money, up front and then charging on the night of the show.
Thanks
Margaret