@@ -467,7 +467,7 @@ public void CheckOrderStatus(Order order)
467467 /// <returns>Place order result</returns>
468468 public virtual PlaceOrderResult PlaceOrder ( ProcessPaymentRequest processPaymentRequest , Dictionary < string , string > extraData )
469469 {
470- //think about moving functionality of processing recurring orders (after the initial order was placed) to ProcessNextRecurringPayment() method
470+ // think about moving functionality of processing recurring orders (after the initial order was placed) to ProcessNextRecurringPayment() method
471471 if ( processPaymentRequest == null )
472472 throw new ArgumentNullException ( "processPaymentRequest" ) ;
473473
@@ -481,7 +481,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
481481 {
482482 #region Order details (customer, totals)
483483
484- //Recurring orders. Load initial order
484+ // Recurring orders. Load initial order
485485 var initialOrder = _orderService . GetOrderById ( processPaymentRequest . InitialOrderId ) ;
486486 if ( processPaymentRequest . IsRecurringPayment )
487487 {
@@ -491,20 +491,20 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
491491 processPaymentRequest . PaymentMethodSystemName = initialOrder . PaymentMethodSystemName ;
492492 }
493493
494- //customer
494+ // customer
495495 var customer = _customerService . GetCustomerById ( processPaymentRequest . CustomerId ) ;
496496 if ( customer == null )
497497 throw new ArgumentException ( T ( "Customer.DoesNotExist" ) ) ;
498498
499- //affilites
499+ // affilites
500500 var affiliateId = 0 ;
501501 var affiliate = _affiliateService . GetAffiliateById ( customer . AffiliateId ) ;
502502 if ( affiliate != null && affiliate . Active && ! affiliate . Deleted )
503503 {
504504 affiliateId = affiliate . Id ;
505505 }
506506
507- //customer currency
507+ // customer currency
508508 string customerCurrencyCode = "" ;
509509 decimal customerCurrencyRate = decimal . Zero ;
510510 if ( ! processPaymentRequest . IsRecurringPayment )
@@ -523,7 +523,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
523523 customerCurrencyRate = initialOrder . CurrencyRate ;
524524 }
525525
526- //customer language
526+ // customer language
527527 Language customerLanguage = null ;
528528 if ( ! processPaymentRequest . IsRecurringPayment )
529529 {
@@ -539,28 +539,28 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
539539 customerLanguage = _workContext . WorkingLanguage ;
540540 }
541541
542- //check whether customer is guest
542+ // check whether customer is guest
543543 if ( customer . IsGuest ( ) && ! _orderSettings . AnonymousCheckoutAllowed )
544544 throw new SmartException ( T ( "Checkout.AnonymousNotAllowed" ) ) ;
545545
546546 var storeId = _storeContext . CurrentStore . Id ;
547547
548- //load and validate customer shopping cart
548+ // load and validate customer shopping cart
549549 IList < OrganizedShoppingCartItem > cart = null ;
550550 if ( ! processPaymentRequest . IsRecurringPayment )
551551 {
552- //load shopping cart
552+ // load shopping cart
553553 cart = customer . GetCartItems ( ShoppingCartType . ShoppingCart , processPaymentRequest . StoreId ) ;
554554
555555 if ( cart . Count == 0 )
556556 throw new SmartException ( T ( "ShoppingCart.CartIsEmpty" ) ) ;
557557
558- //validate the entire shopping cart
558+ // validate the entire shopping cart
559559 var warnings = _shoppingCartService . GetShoppingCartWarnings ( cart , customer . GetAttribute < string > ( SystemCustomerAttributeNames . CheckoutAttributes ) , true ) ;
560560 if ( warnings . Count > 0 )
561561 throw new SmartException ( string . Join ( " " , warnings ) ) ;
562562
563- //validate individual cart items
563+ // validate individual cart items
564564 foreach ( var sci in cart )
565565 {
566566 var sciWarnings = _shoppingCartService . GetShoppingCartItemWarnings ( customer , sci . Item . ShoppingCartType ,
@@ -572,7 +572,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
572572 }
573573 }
574574
575- //min totals validation
575+ // min totals validation
576576 if ( ! processPaymentRequest . IsRecurringPayment )
577577 {
578578 var minOrderSubtotalAmountOk = ValidateMinOrderSubtotalAmount ( cart ) ;
@@ -590,7 +590,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
590590 }
591591 }
592592
593- //tax display type
593+ // tax display type
594594 var customerTaxDisplayType = TaxDisplayType . IncludingTax ;
595595 if ( ! processPaymentRequest . IsRecurringPayment )
596596 {
@@ -601,7 +601,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
601601 customerTaxDisplayType = initialOrder . CustomerTaxDisplayType ;
602602 }
603603
604- //checkout attributes
604+ // checkout attributes
605605 string checkoutAttributeDescription , checkoutAttributesXml ;
606606 if ( ! processPaymentRequest . IsRecurringPayment )
607607 {
@@ -614,15 +614,15 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
614614 checkoutAttributeDescription = initialOrder . CheckoutAttributeDescription ;
615615 }
616616
617- //applied discount (used to store discount usage history)
617+ // applied discount (used to store discount usage history)
618618 var appliedDiscounts = new List < Discount > ( ) ;
619619
620- //sub total
620+ // sub total
621621 decimal orderSubTotalInclTax , orderSubTotalExclTax ;
622622 decimal orderSubTotalDiscountInclTax = 0 , orderSubTotalDiscountExclTax = 0 ;
623623 if ( ! processPaymentRequest . IsRecurringPayment )
624624 {
625- //sub total (incl tax)
625+ // sub total (incl tax)
626626 decimal orderSubTotalDiscountAmount1 = decimal . Zero ;
627627 Discount orderSubTotalAppliedDiscount1 = null ;
628628 decimal subTotalWithoutDiscountBase1 = decimal . Zero ;
@@ -634,11 +634,11 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
634634 orderSubTotalInclTax = subTotalWithoutDiscountBase1 ;
635635 orderSubTotalDiscountInclTax = orderSubTotalDiscountAmount1 ;
636636
637- //discount history
637+ // discount history
638638 if ( orderSubTotalAppliedDiscount1 != null && ! appliedDiscounts . Any ( x => x . Id == orderSubTotalAppliedDiscount1 . Id ) )
639639 appliedDiscounts . Add ( orderSubTotalAppliedDiscount1 ) ;
640640
641- //sub total (excl tax)
641+ // sub total (excl tax)
642642 decimal orderSubTotalDiscountAmount2 = decimal . Zero ;
643643 Discount orderSubTotalAppliedDiscount2 = null ;
644644 decimal subTotalWithoutDiscountBase2 = decimal . Zero ;
@@ -657,7 +657,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
657657 }
658658
659659
660- //shipping info
660+ // shipping info
661661 bool shoppingCartRequiresShipping = false ;
662662 if ( ! processPaymentRequest . IsRecurringPayment )
663663 {
@@ -687,7 +687,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
687687 }
688688 }
689689
690- //shipping total
690+ // shipping total
691691 decimal ? orderShippingTotalInclTax , orderShippingTotalExclTax = null ;
692692 decimal orderShippingTaxRate = decimal . Zero ;
693693 if ( ! processPaymentRequest . IsRecurringPayment )
@@ -848,22 +848,22 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
848848
849849 #region Payment workflow
850850
851- //skip payment workflow if order total equals zero
851+ // skip payment workflow if order total equals zero
852852 var skipPaymentWorkflow = false ;
853853 if ( orderTotal . Value == decimal . Zero )
854854 {
855855 skipPaymentWorkflow = true ;
856856 }
857857
858- //payment workflow
858+ // payment workflow
859859 Provider < IPaymentMethod > paymentMethod = null ;
860860 if ( ! skipPaymentWorkflow )
861861 {
862862 paymentMethod = _paymentService . LoadPaymentMethodBySystemName ( processPaymentRequest . PaymentMethodSystemName ) ;
863863 if ( paymentMethod == null )
864864 throw new SmartException ( T ( "Payment.CouldNotLoadMethod" ) ) ;
865865
866- //ensure that payment method is active
866+ // ensure that payment method is active
867867 if ( ! paymentMethod . IsPaymentMethodActive ( _paymentSettings ) )
868868 throw new SmartException ( T ( "Payment.MethodNotAvailable" ) ) ;
869869 }
@@ -872,7 +872,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
872872 processPaymentRequest . PaymentMethodSystemName = "" ;
873873 }
874874
875- //recurring or standard shopping cart?
875+ // recurring or standard shopping cart?
876876 var isRecurringShoppingCart = false ;
877877 if ( ! processPaymentRequest . IsRecurringPayment )
878878 {
@@ -897,15 +897,15 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
897897 isRecurringShoppingCart = true ;
898898 }
899899
900- //process payment
900+ // process payment
901901 ProcessPaymentResult processPaymentResult = null ;
902902 if ( ! skipPaymentWorkflow )
903903 {
904904 if ( ! processPaymentRequest . IsRecurringPayment )
905905 {
906906 if ( isRecurringShoppingCart )
907907 {
908- //recurring cart
908+ // recurring cart
909909 var recurringPaymentType = _paymentService . GetRecurringPaymentType ( processPaymentRequest . PaymentMethodSystemName ) ;
910910 switch ( recurringPaymentType )
911911 {
@@ -921,19 +921,19 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
921921 }
922922 else
923923 {
924- //standard cart
924+ // standard cart
925925 processPaymentResult = _paymentService . ProcessPayment ( processPaymentRequest ) ;
926926 }
927927 }
928928 else
929929 {
930930 if ( isRecurringShoppingCart )
931931 {
932- //Old credit card info
932+ // Old credit card info
933933 processPaymentRequest . CreditCardType = initialOrder . AllowStoringCreditCardNumber ? _encryptionService . DecryptText ( initialOrder . CardType ) : "" ;
934934 processPaymentRequest . CreditCardName = initialOrder . AllowStoringCreditCardNumber ? _encryptionService . DecryptText ( initialOrder . CardName ) : "" ;
935935 processPaymentRequest . CreditCardNumber = initialOrder . AllowStoringCreditCardNumber ? _encryptionService . DecryptText ( initialOrder . CardNumber ) : "" ;
936- //MaskedCreditCardNumber
936+ // MaskedCreditCardNumber
937937 processPaymentRequest . CreditCardCvv2 = initialOrder . AllowStoringCreditCardNumber ? _encryptionService . DecryptText ( initialOrder . CardCvv2 ) : "" ;
938938
939939 try
@@ -967,7 +967,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
967967 }
968968 else
969969 {
970- //payment is not required
970+ // payment is not required
971971 if ( processPaymentResult == null )
972972 {
973973 processPaymentResult = new ProcessPaymentResult ( ) ;
@@ -1331,7 +1331,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
13311331
13321332 #region Notifications, notes and attributes
13331333
1334- //notes, messages
1334+ // notes, messages
13351335 _orderService . AddOrderNote ( order , T ( "Admin.OrderNotice.OrderPlaced" ) ) ;
13361336
13371337 //send email notifications
@@ -1347,10 +1347,10 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
13471347 _orderService . AddOrderNote ( order , T ( "Admin.OrderNotice.CustomerEmailQueued" , orderPlacedCustomerNotificationQueuedEmailId ) ) ;
13481348 }
13491349
1350- //check order status
1350+ // check order status
13511351 CheckOrderStatus ( order ) ;
13521352
1353- //reset checkout data
1353+ // reset checkout data
13541354 if ( ! processPaymentRequest . IsRecurringPayment )
13551355 {
13561356 _customerService . ResetCheckoutData ( customer , processPaymentRequest . StoreId , clearCouponCodes : true , clearCheckoutAttributes : true ) ;
@@ -1365,7 +1365,7 @@ public virtual PlaceOrderResult PlaceOrder(ProcessPaymentRequest processPaymentR
13651365 //uncomment this line to support transactions
13661366 //scope.Complete();
13671367
1368- //raise event
1368+ // raise event
13691369 _eventPublisher . PublishOrderPlaced ( order ) ;
13701370
13711371 if ( ! processPaymentRequest . IsRecurringPayment )
0 commit comments