Developers
  • Introduction
  • Integration
    • Spring Boot Starter
      • Overview
      • Setup your project
      • Product search
      • Invoicing
      • Merchant side invoicing
      • Merchant side purchase control
      • Loyalty cards
      • Home delivery
      • Marketing & Offers
    • Custom Integration
      • Overview
      • Connection node
        • Get node version endpoint
        • Get node health endpoint
      • Product search
        • Pageable product list search endpoint
        • Product bacrode search endpoint
        • Product name search endpoint
        • Product category search endpoint
      • Invoicing
        • Receive invoice endpoint
      • Merchant side invoicing
        • Create receipt endpoint
        • Confirm receipt payment endpoint
      • Merchant side purchase control
        • Receive purchase check endpoint
        • Send purchase check result
        • Ask for purchase check data resend
      • Loyalty cards
        • Loyalty card registration endpoint
        • Loyalty card bonus endpoint
      • Home delivery
        • Receive order endpoint
        • Receive order update endpoint
        • Update order status
        • Find order by id
        • Find order by invoice id
        • Find order by institution invoice id
      • Marketing & Offers
        • Find offers endpoint
  • General
    • Data object descriptions
      • HealthStatus
      • DefaultOffer
      • DiscountOffer
      • ProductRelatedOffer
      • OfferType
      • OfferClassification
      • Order
      • OrderStatusChangeLog
      • ColorTheme
      • LoyaltyCard
      • DefaultLoyaltyCard
      • BonusLoyaltyCard
      • LoyaltyCardType
      • LoyaltyCardValidationType
      • Shipment
      • ShipmentStatus
      • Category
      • Addition
      • Address
      • Currency
      • BuyerParty
      • Campaign
      • CampaignCode
      • ClientCard
      • Information
      • Inspection
      • Invoice
      • LangCode
      • Price
      • Product
      • Quantity
      • SellerParty
      • Total
      • TotalVAT
      • Translatable
      • Receipt
      • ReceiptProduct
      • ReceiptLoyaltyCard
      • ReceiptCategory
      • VAT
    • Request & Responses
      • NodeHealthResponse
      • NodeVersionResponse
      • OfferSearchRequest
      • PickupOrderStatusChangeRequest
      • LoyaltyCardBonusResponse
      • LoyaltyCardBonusRequest
      • LoyaltyCardRegistrationResponse
      • LoyaltyCardRegistrationRequest
      • PurchaseControlCheckResendRequest
      • PurchaseControlResult
      • PurchaseControlCheckResponse
      • PurchaseControlCheckRequest
      • ReceiptPaymentConfirmationRequest
      • InstitutionRequest
      • Pageable
      • PageRequest
      • CreateReceiptRequest
      • ProductSearchRequest
    • Campaign standard
Powered by GitBook
On this page
  • General flow
  • Configuration
  • Implementation

Was this helpful?

  1. Integration
  2. Spring Boot Starter

Home delivery

Implementation is OPTIONAL

General flow

Client flow

  • add products into shopping cart

  • choose delivery method and time

  • authorize the payment

Merchant flow

  • confirm or reject order

  • process order and update order status

The payment will be settled after merchant has been sent out the order ! This process is needed because merchant may not be able to fully fill the order due the out of stock products.

The authorized payment will be released when merchant reject the order or authorization will be expired. Authorization expiration time is set by the card network.

Configuration

Configure home delivery via Smarts manager UI. Smarts supports 3 delivery methods: courier, parcel, pickup by myself. Home delivery can be fully customized. You can set delivery price, reaction time for each store, availability time and dates, location and much more.

Implement required SDK methods for home delivery

Smarts Worker App can be used to manage home delivery orders. (optional)

Implementation

You only need to create a new class, implement PickupAdapter interface and fill all required methods. API endpoints for home delivery are created automatically and secured with token.

It is important to add @Component annotation on top of the class. There is no restriction for class name or location in your project. Our SDK will find your implementation based on the interface (DI).

import ee.smarts.common.v1.Entities.pickup.Order;
import ee.smarts.starter.adapter.PickupAdapter;
import org.springframework.stereotype.Component;

@Component
public class PickupAdapterImpl implements PickupAdapter {

    @Override
    public void onUpdate(Order order) {
      // implement this method. Will used when order was update in Smarts system
      // or via Smarts Worker App
    }

    @Override
    public void onCreate(Order order) {
      // implement this method. listener for new Orders
    }
}

Use SmartsPickupExchange to update order status or get information from Smarts.

import ee.smarts.common.global.type.ShipmentStatus;
import ee.smarts.common.v1.Entities.pickup.Order;
import ee.smarts.common.v1.Exceptions.PermissionDeniedException;
import ee.smarts.starter.services.pickup.SmartsPickupExchange;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class PickupOrderServiceImpl {

    private final SmartsPickupExchange pickupExchange;

    void testCommunicationWithSmarts() throws PermissionDeniedException {
        Order order0 = pickupExchange.updateOrderStatus("INSTITUTION_ID", "ORDER_ID", ShipmentStatus.ASSEMBLE_READY);

        Order order1 = pickupExchange.findOrderById("INSTITUTION_ID", "ORDER_ID");
        Order order2 = pickupExchange.findOrderByInstitutionInvoiceId("INSTITUTION_ID", "INSTITUTION_INVOICE_ID");
        Order order3 = pickupExchange.findOrderBySmartsInvoiceId("INSTITUTION_ID", "SMARTS_INVOICE_ID");

    }
}

PreviousLoyalty cardsNextMarketing & Offers

Last updated 5 years ago

Was this helpful?