Force Sale
Force Sale is the ability to process a transaction using the voice authorization number provided by the creditor.
Occasionally, a card transaction will not automatically process and will prompt the merchant to call the creditor for a voice authorization.
Code Samples
CWS
Request
Property | Description |
---|---|
parameters JSONObject | required | All relevant parameters for Force Sale processing. |
forceTransaction boolean | optional | Force Sale Indicator Indicates whether to force sale the transaction. Valid values: - True - False Note: You will need to supply a voice referral. |
Example
Request
{
"method" : "startPaymentTransaction",
"requestId" : "2101936245",
"targetType" : "paymentGatewayConverge",
"version" : "1.0",
"parameters" : {
"paymentGatewayId" : "4c45c792-0513-4218-8b6d-c5ff7039a22e",
"transactionType" : "SALE",
"tenderType" : "CARD",
.....
"forceTransaction" : true
.....
}
}
After receiving the request for voice referral, issue this request.
{
"method" : "continuePaymentTransaction",
"requestId" : "2101936247",
"targetType" : "paymentGatewayConverge",
"version" : "1.0",
"parameters" : {
"VoiceReferral" : "321zxc",
"paymentGatewayId" : "4c45c792-0513-4218-8b6d-c5ff7039a22e",
"chanId" : "eb5fcc9f-07db-40a6-9711-6c2bda9a26b9"
}
}
Response
{
"requestId" : "2101936246",
"statusDetails" : "REQUEST_ACCEPTED",
"data" : {
"paymentGatewayCommand" : {
"completed" : false,
"eventQueue" : [ ],
"chanId" : "eb5fcc9f-07db-40a6-9711-6c2bda9a26b9",
"requiredInformation" : [ "VoiceReferral" ]
}
}
}
Java
ECLCardTenderInterface cardTenderInterface= account.getTransactionProcessor().createCardTender();
cardTenderInterface.requiresVoiceReferral();
account.getTransactionProcessor().processTransaction(transaction, cardTenderInterface, transactionListener);
During the transaction, you will get a callback from shouldProvideInformation
and you can check the tenderRequires
parameter to verify that a referral code is needed. Provide the referral code to Commerce SDK and then call continueTransaction
.
This code takes place inside the shouldProvideInformation
callback.
if (tenderRequires.getRequiresVoiceReferral() != ECLVoiceReferralRequirement.NOT_REQUIRED)
{
// give your voice referral code to CSDK
((ECLCardTenderInterface)tender.setVoiceReferralHandledAndApproved("321");
}
// ask CSDK to continue with the transaction
account.getTransactionProcessor().continueProcessingTransaction(transaction, tender, transactionListener);
Objective-C
Using the same code from the Sale transaction with a card tender, the only addition we need to do before processing the transaction is:
[tender setRequiresVoiceApproval];
Once you have set the setRequiresVoiceApproval
on the card tender, ECLTransactionProcessingDelegate::shouldProvideInformation
will be called with requiresVoiceApproval
set on the tenderRequirements
. You can then show some UI for the merchant to enter the voice approval code and do the following:
[tender setVoiceReferralHandledAndApproved:approvalCode];
[transactionProcessor continueTransaction:transaction using:tender delegate:delegate];
C#
PaymentArgs bea = new PaymentArgs();
...
bea.forced = true;
...
m_CWS.StartPaymentTransaction(bea, MyNotifyCWSEvent, MyPaymentComplete);
Request
Respond to VoiceReferral
Dictionary<string, string> info = new Dictionary<string, string>();
info["VoiceReferral"] = theVoiceReferral;
PaymentTransactionResults tr = m_CWS.ContinuePaymentTransaction(m_PaymentGatewayId, chanId, info, MyNotifyCWSEvent);
Response
public void MyPaymentComplete(PaymentResults ber)
{
String[] req = ber.getRequiredInformation();
if (null != req) /* expect "VoiceReferrel" */