Commerce SDK
Partial approval
A partial approval or authorization is the ability to partially approve a transaction. This is useful if the shopper does not have the funds to cover the entire purchase on their debit card, prepaid card, or gift card. The transaction can be partially approved and the merchant can obtain the remainder of the purchase amount in another form of payment.
For example, the shopper is making a $20 purchase. The shopper would first like to use the balance of a gift card which has $9.00 remaining. After the partial approval, the shopper can pay the remaining balance of $11.00 using a debit card, credit card, or other form of payment.
Per card brand requirements, CSDK may not assume a default for partial approval. The integrating POS should specify the value for the partialApprovalAllowed
flag when sending a transaction request to CSDK. If the flag is not specified, CSDK will ask integrating POS the value through callbacks.
Code samples
CWS
Request
Property | Description |
---|---|
parameters JSONObject required | All relevant parameters for partial approval transaction processing. |
partialApprovalAllowed string required | Partial approval indicator that indicates whether to allow partial approval or not. Valid values:
|
Response
Property | Description |
---|---|
data JSONObject | Object holding various responses. |
result boolean | Partial approval result PARTIALLY_APPROVED |
balanceDue JSONObject | Balance due Holds the remainder if the total amount was not authorized. "balanceDue" : { "currencyCode" : "USD", "value" : 0.05 |
Example
Request
{
"method" : "startPaymentTransaction",
"requestId" : "2064767805",
"targetType" : "paymentGatewayConverge",
"version" : "1.0",
"parameters" : {
"paymentGatewayId" : "badd86fe-0679-42f0-b514-759bbac3402b",
"transactionType" : "SALE",
"tenderType" : "CARD",
.....
"partialApprovalAllowed" : "true",
.....
}
}
Response
{
"requestId" : "2064767827",
"statusDetails" : "REQUEST_ACCEPTED",
"data" : {
"paymentGatewayCommand" : {
"completed" : true,
"eventQueue" : [ ],
"chanId" : "11a8c625-2fdf-4751-a250-f3361a008ceb",
"paymentTransactionData" : {
"result" : "PARTIALLY_APPROVED",
"authCode" : "******",
"date" : "Thu Mar 03 10:24:46 MST 2016",
"cardEntryType" : "SWIPE",
"resultMessage" : "PARTIALLY_APPROVED",
"cardScheme" : "VISA",
"amount" : {
"currencyCode" : "USD",
"value" : 2110
},
"id" : "030316A15-4BE7CD7D-0478-4CC0-A29D-F402406A78F3",
"transactionType" : "SALE",
"approved" : "yes",
"errors" : [ ],
"maskedPan" : "******",
"gratuityAmount" : {
"currencyCode" : "USD",
"value" : 0
},
"signatureBitmap" : {
"data" : "` *) !_ X ! ! (_ X ( ! ( ! ) ( ) ( ) 0 ) ( 0 0 0 0 ( 0 _7 ( _7 _/ _/ _/ _. _' _. _&__^ _&__^__^__]__^__^__^__V__^__^__^_____W _'_________ _' ! ( ( ) 1 ( ) ( 0 1 1 ( 1 0 ) 0 1 ( 1 ( 0 ) 0 ( ( ( ( ) ( ( !p`&++ ) ( ) ( ( ( ( ( _/ ( ( _/ _' _/ _/ _' _/ _& _' _& _& _' _& _&__^ _& _&__^ _&__] _&___ _& _& _&___ _& _' _' _' _/p`+'4___ _' _'_ X _' _'_ X _'_ X _'___ _' _' _'___p`.+1 _' _' _/ _' _' _' _' _' _& _' _'__^ _' _& _' _& _' _& _'__^ _& _' _' _& _'p`1*+ _'_ X_______ X _'____ X___ _'________^___ _'___ _' _' _& _' _/ _/ _7 ( ( _7 0 0 0 1 0 1 1 0 ) 1 1 ) ) * ! ! !_ Y \"_ Y_ Q_ Z_ Y_ Q_ Q_ Q_ Zp",
"format" : "SIG_BIN_2"
},
"tenderType" : "CARD",
"balanceDue" : {
"currencyCode" : "USD",
"value" : 5
}
}
}
}
}
Java
Enable partial approval
ECLCurrencyTransactionInterface transaction = account.getTransactionProcessor().createSaleTransactionWithSubtotal(amount);
// partial approval checkbox selected
if (getCardTransactionPropertiesDialog.isPartialApprovalAllowed())
{
transaction.setIsPartialApprovalAllowed(ECLTriState.YES);
}
...
account.getTransactionProcessor().processTransaction(transaction, cardTenderInterface, transactionListener);
If a partial approval took place, the ECLTransactionOutcome
object will have the following characteristics:
- result will be PARTIALLY_APPROVED
amountRequested
will reflect the amount that was specified in the original transaction requestamountAuthorized
will reflect the amount that was actually charged against the cardbalanceDue
will reflect the difference betweenamountRequested
andamountAuthorized
Objective-C
Enable partial approval
Using the same code from the Sale transaction with a card tender, the only addition we need to do before processing the transaction is:
...
id<ECLCurrencyTransactionProtocol> transaction = [account.transactionProcessor createSaleTransactionWithSubtotal:amount];
// switch in POS application
ECLTriState isPartialApprovalAllowed = _partialApprovalSwitch.isOn ? ECLTriState_Yes : ECLTriState_No;
[transaction setIsPartialApprovalAllowed:isPartialApprovalAllowed];
...
[account.transactionProcessor processTransaction:transaction using:tender delegate:delegate];
If a partial approval took place, the transaction outcome will have the following characteristics:
- result will be PARTIALLY_APPROVED
amountRequested
will reflect the amount that was specified in the original transaction requestamountAuthorized
will reflect the amount that was actually charged against the cardbalanceDue
will reflect the difference betweenamountRequested
andamountAuthorized
C#
Request
PaymentArgs bea = new PaymentArgs();
...
bea.isPartialApprovalAllowed = "true";
...
m_CWS.StartPaymentTransaction(bea, MyNotifyCWSEvent, MyPaymentComplete)
Response
public void MyPaymentComplete(PaymentTransactionResults ber)
{
PaymentTransactionData betd = ber.PaymentTransactionData;
if (null != betd)
{
if ((null != betd.approved)
&& (betd.approved.Equals("yes")))
{
Money due = betd.balanceDue; /* Is there a balance due? */
if ((betd.result.Equals("PARTIALLY_APPROVED"))
&& (null != due))
Log(String.Format("balanceDue {0}", betd.balanceDue.getAmountInMinorUnits()));
If a partial approval took place, the transaction outcome will have the following characteristics:
- result will be PARTIALLY_APPROVED
amountRequested
will reflect the amount that was specified in the original transaction requestamountAuthorized
will reflect the amount that was actually charged against the cardbalanceDue
will reflect the difference betweenamountRequested
andamountAuthorized
ON THIS PAGE