@@ -231,15 +231,15 @@ public void onFailure(Call call, IOException e) {
231231
232232 /**
233233 * Cancels outstanding http calls and sets the checkout to its initial state.
234- *
234+ * <p>
235235 * Does NOT notify the backend that the checkout was cancelled.
236236 */
237237 public void reset () {
238238 cancelOutstandingCalls ();
239239 notifyStateChanged (State .NONE );
240240 }
241241
242- private void cancelOutstandingCalls (){
242+ private void cancelOutstandingCalls () {
243243 if (call != null ) {
244244 call .cancel ();
245245 call = null ;
@@ -305,7 +305,7 @@ public void onResponse(Call call, Response response) throws IOException {
305305 String json = IOUtils .toString (inputStream , Charset .forName ("UTF-8" ));
306306 signedCheckoutInfo = gson .fromJson (json , SignedCheckoutInfo .class );
307307
308- if (signedCheckoutInfo .checkoutInfo .has ("price" )
308+ if (signedCheckoutInfo .checkoutInfo .has ("price" )
309309 && signedCheckoutInfo .checkoutInfo .get ("price" ).getAsJsonObject ().has ("price" )) {
310310 priceToPay = signedCheckoutInfo .checkoutInfo
311311 .get ("price" )
@@ -316,7 +316,7 @@ public void onResponse(Call call, Response response) throws IOException {
316316 priceToPay = shoppingCart .getTotalPrice ();
317317 }
318318
319- if (priceToPay != shoppingCart .getTotalPrice ()){
319+ if (priceToPay != shoppingCart .getTotalPrice ()) {
320320 Logger .w ("Warning local price is different from remotely calculated price! (Local: "
321321 + shoppingCart .getTotalPrice () + ", Remote: " + priceToPay + ")" );
322322 }
@@ -532,36 +532,36 @@ private boolean handleProcessResponse(CheckoutProcessResponse checkoutProcessRes
532532 return false ;
533533 }
534534
535- private void approve (){
535+ private void approve () {
536536 Logger .d ("Payment approved" );
537537 shoppingCart .invalidate ();
538538 clearCodes ();
539539 notifyStateChanged (State .PAYMENT_APPROVED );
540540 }
541541
542542 public void approveOfflineMethod () {
543- if (paymentMethod .isOfflineMethod ()) {
543+ if (paymentMethod .isOfflineMethod ()) {
544544 approve ();
545545 }
546546 }
547547
548- public void setClientAcceptedPaymentMethods (PaymentMethod [] acceptedPaymentMethods ){
548+ public void setClientAcceptedPaymentMethods (PaymentMethod [] acceptedPaymentMethods ) {
549549 clientAcceptedPaymentMethods = acceptedPaymentMethods ;
550550 }
551551
552- public void addCode (String code ){
552+ public void addCode (String code ) {
553553 codes .add (code );
554554 }
555555
556- public void removeCode (String code ){
556+ public void removeCode (String code ) {
557557 codes .remove (code );
558558 }
559559
560560 public Collection <String > getCodes () {
561561 return Collections .unmodifiableCollection (codes );
562562 }
563563
564- public void clearCodes (){
564+ public void clearCodes () {
565565 codes .clear ();
566566 }
567567
@@ -598,13 +598,14 @@ public PaymentMethod[] getAvailablePaymentMethods() {
598598 JsonArray jsonArray = signedCheckoutInfo .checkoutInfo .getAsJsonArray ("availableMethods" );
599599 if (jsonArray != null ) {
600600 List <PaymentMethod > paymentMethods = gson .fromJson (jsonArray ,
601- new TypeToken <List <PaymentMethod >>(){}.getType ());
601+ new TypeToken <List <PaymentMethod >>() {
602+ }.getType ());
602603
603- if (clientAcceptedPaymentMethods != null ) {
604+ if (clientAcceptedPaymentMethods != null ) {
604605 List <PaymentMethod > result = new ArrayList <>();
605606
606607 for (PaymentMethod clientPaymentMethod : clientAcceptedPaymentMethods ) {
607- if (paymentMethods .contains (clientPaymentMethod )){
608+ if (paymentMethods .contains (clientPaymentMethod )) {
608609 result .add (clientPaymentMethod );
609610 }
610611 }
0 commit comments