Tabnine Logo
OrderExpansionModel.paymentInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
paymentInfo
method
in
io.sphere.sdk.orders.expansion.OrderExpansionModel

Best Java code snippets using io.sphere.sdk.orders.expansion.OrderExpansionModel.paymentInfo (Showing top 2 results out of 315)

origin: com.commercetools.sunrise/shopping-cart

protected CompletionStage<Optional<Order>> findOrderById(final String orderId) {
  final OrderByIdGet baseRequest = OrderByIdGet.of(orderId).plusExpansionPaths(m -> m.paymentInfo().payments());
  final OrderByIdGet orderByIdGet = OrderByIdGetHook.runHook(hooks(), baseRequest);
  return sphere().execute(orderByIdGet)
      .thenApplyAsync(nullableOrder -> {
        if (nullableOrder != null) {
          OrderLoadedHook.runHook(hooks(), nullableOrder);
        }
        return Optional.ofNullable(nullableOrder);
      }, defaultContext());
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void addPayment() {
  withPayment(client(), payment -> {
    withOrder(client(), order -> {
      //add payment
      final OrderUpdateCommand orderUpdateCommand = OrderUpdateCommand.of(order, AddPayment.of(payment))
          .withExpansionPaths(m -> m.paymentInfo().payments());
      final Order orderWithPayment = client().executeBlocking(orderUpdateCommand);
      final Reference<Payment> paymentReference = orderWithPayment.getPaymentInfo().getPayments().get(0);
      assertThat(paymentReference).isEqualTo(payment.toReference());
      assertThat(paymentReference).is(expanded(payment));
      //remove payment
      final Order orderWithoutPayment = client().executeBlocking(OrderUpdateCommand.of(orderWithPayment, RemovePayment.of(payment)));
      assertThat(orderWithoutPayment.getPaymentInfo()).isNull();
      return orderWithoutPayment;
    });
    return payment;
  });
}
io.sphere.sdk.orders.expansionOrderExpansionModelpaymentInfo

Popular methods of OrderExpansionModel

  • of
  • <init>
  • cart
  • customerGroup
  • expansionPath
  • lineItems
  • pathExpression
  • syncInfo

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • BoxLayout (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now