@@ -246,42 +246,7 @@ public void onError(String message, String responseAsJSONString) {
246246 public void chargeSavedCard (Payload payload , String encryptionKey ) {
247247 if (payload .getOtp () == null || payload .getOtp () == "" ) {
248248 sendRaveOTP (payload );
249- } else {
250- // Charge saved card
251- String cardRequestBodyAsString = Utils .convertChargeRequestPayloadToJson (payload );
252- String encryptedCardRequestBody = Utils .getEncryptedData (cardRequestBodyAsString , encryptionKey );
253-
254- final ChargeRequestBody body = new ChargeRequestBody ();
255- body .setAlg ("3DES-24" );
256- body .setPBFPubKey (payload .getPBFPubKey ());
257- body .setClient (encryptedCardRequestBody );
258-
259- mView .showProgressIndicator (true );
260-
261- networkRequest .charge (body , new Callbacks .OnChargeRequestComplete () {
262- @ Override
263- public void onSuccess (ChargeResponse response , String responseAsJSONString ) {
264-
265- mView .showProgressIndicator (false );
266-
267- if (response .getData () != null ) {
268- Log .d ("Saved card charge" , responseAsJSONString );
269- mView .onChargeCardSuccessful (response );
270-
271- } else {
272- mView .onPaymentError ("No response data was returned" );
273- }
274-
275- }
276-
277- @ Override
278- public void onError (String message , String responseAsJSONString ) {
279-
280- mView .showProgressIndicator (false );
281- mView .onPaymentError (message );
282- }
283- });
284- }
249+ } else chargeCard (payload , encryptionKey );
285250 }
286251
287252 @ Override
0 commit comments