workflows: b2b_flow_no_shipping_checkout: entity: Oro\Bundle\CheckoutBundle\Entity\Checkout entity_attribute: checkout steps_display_ordered: true defaults: active: true exclusive_record_groups: - b2b_checkout_flow priority: 150 applications: ['commerce'] attributes: billing_address: property_path: checkout.billingAddress save_billing_address: property_path: checkout.saveBillingAddress po_number: property_path: checkout.poNumber ship_until: property_path: checkout.shipUntil customer_notes: property_path: checkout.customerNotes payment_method: property_path: checkout.paymentMethod billing_address_has_shipping: type: boolean allow_manual_source_remove: type: boolean disallow_billing_address_edit: type: boolean disallow_shipping_address_edit: type: boolean disallow_shipping_method_edit: type: boolean remove_source: type: boolean auto_remove_source: type: boolean source_remove_label: type: string edit_order_link: type: string payment_in_progress: type: bool payment_validate: type: bool payment_save_for_later: type: bool state_token: type: string internal_state_token: type: string order: type: entity options: class: Oro\Bundle\OrderBundle\Entity\Order steps: enter_billing_address: order: 10 allowed_transitions: - continue_to_payment enter_payment: order: 40 allowed_transitions: - payment_error - continue_to_order_review - back_to_billing_address order_review: order: 50 allowed_transitions: - place_order - verify_payment - finish_checkout - payment_error - back_to_billing_address - back_to_payment order_created: order: 60 is_final: true transitions: __start__: is_start: true is_hidden: true step_to: enter_billing_address transition_definition: __start___definition start_from_shoppinglist: is_start: true step_to: enter_billing_address is_unavailable_hidden: true transition_definition: start_from_shoppinglist_definition frontend_options: icon: fa-briefcase init_routes: - oro_shopping_list_frontend_view acl_resource: [CHECKOUT_CREATE, $.result.shoppingList] start_from_quickorderform: is_start: true step_to: enter_billing_address is_unavailable_hidden: true transition_definition: start_from_quickorderform_definition frontend_options: icon: fa-briefcase class: 'btn--action' data: component_name: oro_shopping_list_to_checkout_quick_add_processor page-component-module: oroproduct/js/app/components/quick-add-form-button-component page-component-options: component_name: '[name$="[component]"]' init_routes: - oro_product_frontend_quick_add - oro_product_frontend_quick_add_copy_paste - oro_product_frontend_quick_add_import acl_resource: [CREATE, entity:commerce@Oro\Bundle\CheckoutBundle\Entity\Checkout] continue_to_payment: step_to: enter_payment transition_definition: continue_to_payment_definition frontend_options: is_checkout_continue: true is_checkout_show_errors: true page_component_module: 'orocheckout/js/app/components/shipping-transition-button-component' form_options: form_init: - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.initCheckoutState attribute_fields: billing_address: form_type: oro_checkout_address options: object: $checkout isEditEnabled: true addressType: 'billing' required: true translation_domain: messages constraints: - Valid: ~ - NotBlank: ~ - Oro\Bundle\OrderBundle\Validator\Constraints\OrderAddress: validationGroups: ['Checkout'] disabled: $disallow_billing_address_edit save_billing_address: options: state_token: form_type: hidden options: data: $internal_state_token continue_to_order_review: step_to: order_review transition_definition: continue_to_order_review_definition frontend_options: is_checkout_continue: true is_checkout_show_errors: true page_component_module: 'orocheckout/js/app/components/payment-transition-button-component' form_options: form_init: - '@assign_value': [$payment_validate, true] - '@call_service_method': service: oro_payment.provider.payment_transaction method: getActiveValidatePaymentTransaction method_parameters: [$payment_method] attribute: $.result.validatePaymentTransaction - '@assign_value': conditions: '@not_empty': [$.result.validatePaymentTransaction] parameters: [$payment_validate, false] - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.initCheckoutState attribute_fields: payment_method: ~ payment_validate: form_type: checkbox payment_save_for_later: form_type: checkbox state_token: form_type: hidden options: data: $internal_state_token back_to_billing_address: step_to: enter_billing_address transition_definition: clear_payment_method_and_recalculate_state_definition is_unavailable_hidden: true frontend_options: is_checkout_back: true back_to_payment: step_to: enter_payment transition_definition: recalculate_state_definition is_unavailable_hidden: true frontend_options: is_checkout_back: true verify_payment: step_to: enter_payment transition_definition: verify_payment_definition is_hidden: true frontend_options: is_checkout_verify: true place_order: step_to: order_review transition_definition: place_order_definition display_type: page frontend_options: is_checkout_continue: true is_checkout_show_errors: true form_options: form_init: - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.initCheckoutState attribute_fields: remove_source: ~ po_number: ~ ship_until: ~ customer_notes: form_type: textarea state_token: form_type: hidden options: data: $internal_state_token finish_checkout: step_to: order_created transition_definition: finish_checkout_definition is_hidden: true payment_error: step_to: enter_payment transition_definition: unblock_and_recalculate_definition is_hidden: true transition_definitions: start_from_quickorderform_definition: preactions: - '@call_service_method': attribute: $.result.isAllowed service: oro_shopping_list.processor.quick_add_to_checkout method: isAllowed preconditions: '@and': - '@not_empty': $init_context - '@equal': [true, $.result.isAllowed] start_from_shoppinglist_definition: preactions: - '@find_entity': conditions: '@not_empty': $init_context parameters: class: $init_context.entityClass identifier: $init_context.entityId attribute: $.result.shoppingList preconditions: '@has_elements': $.result.shoppingList.lineItems actions: - '@run_action_group': action_group: start_shoppinglist_checkout parameters_mapping: shoppingList: $.result.shoppingList showErrors: true results: data.checkout: $.checkout result.redirectUrl: $.redirectUrl __start___definition: actions: - '@assign_value': [$payment_save_for_later, true] - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.startCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.startCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token] back_to_billing_address_definition: preconditions: '@equal': [$checkout_finished, false] actions: - '@assign_value': [$billing_address_has_shipping, true] - '@assign_value': [$payment_method, null] - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token] continue_to_payment_definition: preactions: - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.currentCheckoutState - '@get_checkout_state': entity: $checkout token: $state_token attribute: $.result.tokenCheckoutState - '@tree': conditions: '@not': - '@check_checkout_states': entity: $checkout state1: $.result.currentCheckoutState state2: $.result.tokenCheckoutState actions: - '@assign_value': [$.result.savedCheckoutState, $.result.tokenCheckoutState] - '@delete_checkout_state': entity: $checkout token: $state_token - '@save_checkout_state': entity: $checkout state: $.result.currentCheckoutState token: $state_token - '@call_service_method': service: oro_checkout.factory.shipping_context_factory method: create method_parameters: [$checkout] attribute: $.result.shippingContext preconditions: '@and': - '@quote_acceptable': [$checkout.sourceEntity, true] - '@order_line_item_has_count': message: oro.checkout.workflow.condition.order_line_item_has_count.message parameters: entity: $checkout - '@checkout_has_applicable_shipping_methods': message: oro.checkout.workflow.condition.shipping_method_is_not_available.message checkout: $checkout conditions: '@and': - '@or': - '@empty': $.result.savedCheckoutState - '@check_checkout_states': message: oro.checkout.workflow.condition.content_of_order_was_changed.message parameters: entity: $checkout state1: $.result.initCheckoutState state2: $.result.savedCheckoutState actions: - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token] continue_to_order_review_definition: preactions: - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.currentCheckoutState - '@get_checkout_state': entity: $checkout token: $state_token attribute: $.result.tokenCheckoutState - '@run_action_group': action_group: oro_update_shipping_price parameters_mapping: checkout: $checkout - '@tree': conditions: '@not': - '@check_checkout_states': entity: $checkout state1: $.result.currentCheckoutState state2: $.result.tokenCheckoutState actions: - '@assign_value': [$.result.savedCheckoutState, $.result.tokenCheckoutState] - '@delete_checkout_state': entity: $checkout token: $state_token - '@save_checkout_state': entity: $checkout state: $.result.currentCheckoutState token: $state_token - '@call_service_method': service: oro_checkout.factory.payment_context_factory method: create method_parameters: [$checkout] attribute: $.result.paymentContext preconditions: '@and': - '@equal': [$checkout_finished, false] - '@quote_acceptable': [$checkout.sourceEntity, true] - '@order_line_item_has_count': message: oro.checkout.workflow.condition.order_line_item_has_count.message parameters: entity: $checkout - '@checkout_has_applicable_shipping_methods': message: oro.checkout.workflow.condition.shipping_method_is_not_available.message checkout: $checkout - '@has_applicable_payment_methods': message: oro.checkout.workflow.condition.payment_method_is_not_applicable.message context: $.result.paymentContext conditions: '@and': - '@or': - '@empty': $.result.savedCheckoutState - '@check_checkout_states': message: oro.checkout.workflow.condition.content_of_order_was_changed.message parameters: entity: $checkout state1: $.result.initCheckoutState state2: $.result.savedCheckoutState - '@not_empty': message: Payment method was not selected parameters: $checkout.paymentMethod - '@payment_method_applicable': message: oro.checkout.workflow.condition.payment_method_is_not_applicable.message payment_method: $checkout.paymentMethod context: $.result.paymentContext - '@check_request': message: Invalid request parameters: is_ajax: true expected_key: _wid expected_value: ajax_checkout actions: - '@tree': conditions: '@equal': [$payment_validate, true] actions: - '@assign_constant_value': [$.result.validateAction, Oro\Bundle\PaymentBundle\Method\PaymentMethodInterface::VALIDATE] - '@assign_url': attribute: $.result.successUrl route: oro_checkout_frontend_checkout route_parameters: id: $checkout.id - '@assign_url': attribute: $.result.failureUrl route: oro_checkout_frontend_checkout route_parameters: id: $checkout.id transition: 'payment_error' - '@payment_validate': conditions: '@payment_method_supports': payment_method: $checkout.paymentMethod action: $.result.validateAction attribute: $.result.responseData object: $checkout paymentMethod: $checkout.paymentMethod transactionOptions: saveForLaterUse: $payment_save_for_later successUrl: $.result.successUrl failureUrl: $.result.failureUrl - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token] verify_payment_definition: preconditions: '@and': - '@equal': [$checkout_finished, false] - '@order_line_item_has_count': message: oro.checkout.workflow.condition.order_line_item_has_count.message parameters: entity: $checkout - '@require_payment_redirect': payment_method: $payment_method - '@or': - '@not': - '@check_request': is_ajax: true expected_key: _wid expected_value: ajax_checkout - '@not': - '@check_request': is_ajax: true expected_key: transition expected_value: continue_to_order_review actions: - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token] place_order_definition: preactions: - '@flash_message': conditions: '@and': - '@equal': [$payment_in_progress, true] - '@equal': [$checkout.completed, false] message: oro.checkout.workflow.condition.payment_has_not_been_processed.message type: 'warning' - '@tree': conditions: '@not_empty': [$.id] actions: - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.currentCheckoutState - '@get_checkout_state': entity: $checkout token: $state_token attribute: $.result.tokenCheckoutState - '@tree': conditions: '@not': - '@check_checkout_states': entity: $checkout state1: $.result.currentCheckoutState state2: $.result.tokenCheckoutState actions: - '@assign_value': [$.result.savedCheckoutState, $.result.tokenCheckoutState] - '@delete_checkout_state': entity: $checkout token: $state_token - '@save_checkout_state': entity: $checkout state: $.result.currentCheckoutState token: $state_token - '@call_service_method': service: oro_checkout.factory.payment_context_factory method: create method_parameters: [$checkout] attribute: $.result.paymentContext preconditions: '@and': - '@not_empty': $.result.paymentContext - '@quote_acceptable': [$checkout.sourceEntity, true] - '@payment_method_applicable': message: oro.checkout.workflow.condition.payment_method_is_not_applicable.message payment_method: $checkout.paymentMethod context: $.result.paymentContext conditions: '@and': - '@extendable': message: 'oro.checkout.workflow.b2b_flow_checkout.transition.place_order.condition.extendable.message' events: ['extendable_condition.before_order_create'] - '@or': - '@empty': $.result.savedCheckoutState - '@check_checkout_states': message: oro.checkout.workflow.condition.content_of_order_was_changed.message parameters: entity: $checkout state1: $.result.initCheckoutState state2: $.result.savedCheckoutState actions: # Place order - '@get_class_name': object: $checkout.sourceEntity.sourceDocument attribute: $.result.sourceDocumentEntityClassName - '@duplicate': target: $checkout.billingAddress attribute: $.result.billingAddress settings: - [[setNull], [propertyName, [id]]] - [[keep], [propertyName, [customerAddress]]] - [[keep], [propertyName, [customerUserAddress]]] - [[keep], [propertyName, [city]]] - [[keep], [propertyName, [country]]] - [[keep], [propertyName, [region]]] - [[keep], [propertyName, [organization]]] - [[shallowCopy], [propertyType, ['\DateTime']]] - '@flush_entity': $.result.billingAddress - '@call_service_method': service: oro_payment_term.provider.payment_term method: getCurrentPaymentTerm attribute: $.result.paymentTerm - '@get_order_line_items': attribute: $.result.lineItems checkout: $checkout - '@create_order': attribute: $order checkout: $checkout data: billingAddress: $.result.billingAddress sourceEntityClass: $.result.sourceDocumentEntityClassName paymentTerm: $.result.paymentTerm lineItems: $.result.lineItems - '@call_service_method': service: oro_order.handler.order_totals_handler method: fillSubtotals method_parameters: - $order - '@flush_entity': $order - '@tree': actions: - '@assign_url': attribute: $.result.successUrl route: oro_checkout_frontend_checkout route_parameters: id: $checkout.id transition: 'finish_checkout' - '@assign_url': attribute: $.result.failureUrl route: oro_checkout_frontend_checkout route_parameters: id: $checkout.id transition: 'payment_error' - '@assign_url': attribute: $.result.failedShippingAddressUrl route: oro_checkout_frontend_checkout route_parameters: id: $checkout.id transition: 'back_to_shipping_address_on_fail_address' - '@payment_purchase': attribute: $.result.responseData object: $order amount: $order.total currency: $order.currency paymentMethod: $payment_method transactionOptions: successUrl: $.result.successUrl failureUrl: $.result.failureUrl failedShippingAddressUrl: $.result.failedShippingAddressUrl - '@assign_value': [$payment_in_progress, true] - '@extendable': events: [extendable_action.finish_checkout] - '@redirect': conditions: '@and': - '@equal': ["$.result.responseData[purchaseSuccessful]", true] - '@payment_method_supports': payment_method: $payment_method action: 'validate' route: oro_checkout_frontend_checkout route_parameters: id: $checkout.id transition: finish_checkout - '@redirect': conditions: '@and': - '@equal': ["$.result.responseData[purchaseSuccessful]", false] - '@payment_method_supports': payment_method: $payment_method action: 'validate' route: oro_checkout_frontend_checkout route_parameters: id: $checkout.id transition: payment_error - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token finish_checkout_definition: conditions: '@and': - '@not_empty': [$order] - '@equal': [$payment_in_progress, true] actions: # Save billing address if required - '@assign_constant_value': [$.result.typeBillingName, Oro\Bundle\AddressBundle\Entity\AddressType::TYPE_BILLING] - '@tree': conditions: '@and': - '@equal': [$checkout.saveBillingAddress, true] - '@empty': $order.billingAddress.customerAddress - '@empty': $order.billingAddress.customerUserAddress - '@acl_granted': 'oro_order_address_billing_allow_manual' actions: - '@find_entity': class: Oro\Bundle\AddressBundle\Entity\AddressType attribute: $.result.typeBilling identifier: $.result.typeBillingName - '@create_entity': attribute: $.result.customerBillingAddress class: Oro\Bundle\CustomerBundle\Entity\CustomerUserAddress data: frontendOwner: $checkout.customerUser owner: $checkout.owner systemOrganization: $checkout.organization label: $order.billingAddress.label organization: $order.billingAddress.organization street: $order.billingAddress.street street2: $order.billingAddress.street2 city: $order.billingAddress.city postalCode: $order.billingAddress.postalCode country: $order.billingAddress.country region: $order.billingAddress.region regionText: $order.billingAddress.regionText namePrefix: $order.billingAddress.namePrefix firstName: $order.billingAddress.firstName middleName: $order.billingAddress.middleName lastName: $order.billingAddress.lastName nameSuffix: $order.billingAddress.nameSuffix phone: $order.billingAddress.phone - '@call_method': object: $.result.customerBillingAddress method: addType method_parameters: - $.result.typeBilling - '@flush_entity': conditions: '@not_empty': $.result.customerBillingAddress parameters: [$.result.customerBillingAddress] - '@send_email_template': parameters: from: $order.owner.email to: $order.customerUser.email template: 'order_confirmation_email' entity: $order - '@assign_value': [$checkout.completed, true] - '@tree': conditions: '@not_empty': $order actions: - '@count': value: $order.lineItems attribute: $checkout.completedData.itemsCount - '@assign_value': [$.result.orders, []] - '@get_class_name': object: $order attribute: $.result.orderClassName - '@call_service_method': service: oro_entity.entity_alias_resolver method: getAlias method_parameters: [$.result.orderClassName] attribute: $.result.orders[0].entityAlias - '@call_service_method': service: oro_entity.doctrine_helper method: getEntityIdentifier method_parameters: [$order] attribute: $.result.orders[0].entityId - '@assign_value': [$checkout.completedData.orders, $.result.orders] - '@assign_value': [$.result.sourceEntity, $checkout.sourceEntity] - '@tree': conditions: '@not_empty': $.result.sourceEntity actions: - '@assign_value': conditions: '@instanceof': [$.result.sourceEntity, Oro\Bundle\SaleBundle\Entity\QuoteDemand] parameters: attribute: $.result.sourceEntity value: $.result.sourceEntity.quote - '@call_service_method': service: oro_entity.entity_name_resolver method: getName method_parameters: [$.result.sourceEntity] attribute: $checkout.completedData.startedFrom - '@assign_value': - [$checkout.completedData.currency, $order.currency] - [$checkout.completedData.subtotal, $order.subtotalObject.value] - [$checkout.completedData.total, $order.totalObject.value] - '@remove_entity': conditions: '@or': - '@equal': [$auto_remove_source, true] - '@and': - '@equal': [$allow_manual_source_remove, true] - '@equal': [$remove_source, true] parameters: [$checkout.sourceEntity] recalculate_state_definition: preconditions: '@equal': [$checkout_finished, false] actions: - '@assign_value': [$payment_in_progress, false] - '@run_action_group': action_group: oro_update_shipping_price parameters_mapping: checkout: $checkout - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token] clear_payment_method_and_recalculate_state_definition: preconditions: '@equal': [$checkout_finished, false] actions: - '@assign_value': [$payment_method, null] - '@assign_value': [$payment_in_progress, false] - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token] unblock_and_recalculate_definition: actions: - '@assign_value': [$payment_method, null] - '@assign_value': [$payment_in_progress, false] - '@generate_checkout_state_snapshot': entity: $checkout attribute: $.result.actualCheckoutState - '@save_checkout_state': entity: $checkout state: $.result.actualCheckoutState attribute: $state_token - '@assign_value': [$internal_state_token, $state_token]