Creating a PaymentGatewayStatus Interface
Salesforce Billing implements the PaymentGatewayStatus interface to populate the
TransactionResult’s GatewayStatus enum with the value of the return code
that the external gateway set in transactionResult.
1global interface PaymentGateWayStatus
2{
3 void populateGatewayStatus(TransactionResult transactionResult);
4}So, if you want your gateway package to process a chargeTransaction sent from Salesforce Billing, the package must implement chargeTransaction within a PaymentGatewayAPI class. Let’s see how this configuration looks in a sample CyberSource implementation.
1global class CyberSourceAPI implements blng.PaymentGateWay, blng.PaymentGateWays, blng.PaymentGateWayStatus
2{
3 /**
4 Implement other methods as described above
5 */
6 private static CyberSource service()
7 {
8 if (NULL == CyberSourceInstance)
9 {
10 CyberSourceInstance = CyberSource.getInstance();
11 }
12 return CyberSourceInstance;
13 }
14 /**
15 * @name populateGatewayStatus
16 * @description Method that populates the GatewayStatus enum on the TransactionResult,
17 * given return codes that are already set in the TransactionResults
18 * @param transactionResult
19 */
20 global static void populateGatewayStatus(blng.TransactionResult transactionResult)
21 {
22 service().populateGatewayStatus(transactionResult);
23 }
24}