Create Transaction
1min
The following is an example of Create Transaction.
Request
Response
|

Updated 03 Mar 2023
Did this page help you?
Yes
No
The following is an example of Create Transaction.
Map<String, Object> chargeData = new Map<String, Object>(); chargeData.put('processorCustomerId', 'processorCustomerId'); chargeData.put('paymentMethodId', 'paymentMethodId'); chargeData.put('amount', '123.12'); chargeData.put('chargeCurrency', 'USD'); chargeData.put('description', 'test payment'); chargeData.put('paymentMethodType', 'Card'); // Initializing the RequestJSON Data to be passed. Map<String, Object> requestJSONMap = new Map<String, Object>(); requestJSONMap.put('transactions', new List<Object>{chargeData}); String reqJSON = JSON.serialize(requestJSONMap); Map<String, Object> reqObj = new Map<String, Object>(); reqObj.put('version','1.0'); reqObj.put('action','ChargeProcessor'); reqObj.put('processorId', 'processorId'); reqObj.put('requestJSON',reqJSON); // Placing a request to Breadwinner Global API Map<String,Object> resp = bw_payments.BreadwinnerPaymentsAPI.call(reqObj); System.debug(resp);