@@ -24,10 +24,10 @@ final class OrderDetailsDataSource: NSObject {
2424 ///
2525 private( set) var sections = [ Section] ( )
2626
27- /// Is this order processing?
27+ /// Is this order processing? Payment received (paid). The order is awaiting fulfillment.
2828 ///
29- private var isProcessingPayment : Bool {
30- return order. status == OrderStatusEnum . processing
29+ private var isProcessingStatus : Bool {
30+ order. status == OrderStatusEnum . processing
3131 }
3232
3333 /// Is this order fully refunded?
@@ -1025,21 +1025,22 @@ extension OrderDetailsDataSource {
10251025
10261026 var rows : [ Row ] = Array ( repeating: . aggregateOrderItem, count: aggregateOrderItemCount)
10271027
1028- if shouldShowShippingLabelCreation {
1028+ switch ( shouldShowShippingLabelCreation, isProcessingStatus, isRefundedStatus) {
1029+ case ( true , false , false ) :
1030+ // Order completed and eligible for shipping label creation:
10291031 rows. append ( . shippingLabelCreateButton)
1030- }
1031-
1032- if isProcessingPayment {
1033- if shouldShowShippingLabelCreation {
1034- rows. append ( . markCompleteButton( style: . secondary, showsBottomSpacing: false ) )
1035- rows. append ( . shippingLabelCreationInfo( showsSeparator: false ) )
1036- } else {
1037- rows. append ( . markCompleteButton( style: . primary, showsBottomSpacing: true ) )
1038- }
1039- } else if isRefundedStatus == false {
1040- if shouldShowShippingLabelCreation {
1041- rows. append ( . shippingLabelCreationInfo( showsSeparator: true ) )
1042- }
1032+ rows. append ( . shippingLabelCreationInfo( showsSeparator: false ) )
1033+ case ( true , true , false ) :
1034+ // Order processing shippable:
1035+ rows. append ( . shippingLabelCreateButton)
1036+ rows. append ( . markCompleteButton( style: . secondary, showsBottomSpacing: false ) )
1037+ rows. append ( . shippingLabelCreationInfo( showsSeparator: false ) )
1038+ case ( false , true , false ) :
1039+ // Order processing digital:
1040+ rows. append ( . markCompleteButton( style: . primary, showsBottomSpacing: true ) )
1041+ default :
1042+ // Other cases
1043+ break
10431044 }
10441045
10451046 if rows. count == 0 {
0 commit comments