GenericValue paymentPref = (GenericValue) context.get("orderPaymentPreference");
Boolean creditResponse = (Boolean) context.get("creditResult");
Locale locale = (Locale) context.get("locale");
// create the PaymentGatewayResponse
String responseId = delegator.getNextSeqId("PaymentGatewayResponse");
GenericValue pgCredit = delegator.makeValue("PaymentGatewayResponse");
pgCredit.set("paymentGatewayResponseId", responseId);
pgCredit.set("paymentServiceTypeEnumId", CREDIT_SERVICE_TYPE);
pgCredit.set("orderPaymentPreferenceId", paymentPref.get("orderPaymentPreferenceId"));
pgCredit.set("paymentMethodTypeId", paymentPref.get("paymentMethodTypeId"));
pgCredit.set("paymentMethodId", paymentPref.get("paymentMethodId"));