The PaymentGateway interface contains several basic transaction methods that the PaymentGatewayAPI class implements to handle gateway requests. The methods allow PaymentGatewayAPI to create a credit card token, process a payment charge, void a payment, authorize a payment, and refund a payment.
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.
Example
1global class CyberSourceAPI implements blng.PaymentGateWay2{3 global static Map<String, blng.TransactionResult>generateToken(Map<String, blng.TransactionParameter>mapOfTransactionParameterById)4{5 return service().generateToken(mapOfTransactionParameterById);6}78 global static Map<String, blng.TransactionResult>authorizeTransaction(Map<String, blng.TransactionParameter>mapOfTransactionParameterById)9{10 return service().authorizeTransaction(mapOfTransactionParameterById);11}1213 global static Map<String, blng.TransactionResult>chargeTransaction(Map<String, blng.TransactionParameter>mapOfTransactionParameterById)14{15 return service().chargeTransaction(mapOfTransactionParameterById);16}1718 global static Map<String, blng.TransactionResult>voidTransaction(Map<String, blng.TransactionParameter>mapOfTransactionParameterById)19{20 return service().voidTransaction(mapOfTransactionParameterById);21}2223 global static Map<String, blng.TransactionResult>refundTransaction(Map<String, blng.TransactionParameter>mapOfTransactionParameterById)24{25 return service().refundTransaction(mapOfTransactionParameterById);26}27}