Tabnine Logo
PaymentMethodInfoBuilder.method
Code IndexAdd Tabnine to your IDE (free)

How to use
method
method
in
io.sphere.sdk.payments.PaymentMethodInfoBuilder

Best Java code snippets using io.sphere.sdk.payments.PaymentMethodInfoBuilder.method (Showing top 8 results out of 315)

origin: com.commercetools.payment/common

public static CreatePaymentDataBuilder of(final SphereClient client,
                     final String paymentInterface,
                     final String paymentMethod,
                     final Cart cart,
                     final String reference) {
  return new CreatePaymentDataBuilder(
      client,
      PaymentMethodInfoBuilder.of().paymentInterface(paymentInterface).method(paymentMethod).build(),
      cart, reference);
}
origin: com.commercetools.sunrise.payment/common

public static CreatePaymentDataBuilder of(final SphereClient client,
                     final String paymentInterface,
                     final String paymentMethod,
                     final Cart cart,
                     final String reference) {
  return new CreatePaymentDataBuilder(
      client,
      PaymentMethodInfoBuilder.of().paymentInterface(paymentInterface).method(paymentMethod).build(),
      cart, reference);
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void withAnonymousId() {
  CustomerFixtures.withCustomerAndCart(client(), ((customer, cart) -> {
    final MonetaryAmount totalAmount = cart.getTotalPrice();
    final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
        .paymentInterface("payment interface X")
        .method("CREDIT_CARD")
        .build();
    final String anonymousId = randomString();
    final PaymentDraftBuilder paymentDraftBuilder = PaymentDraftBuilder.of(totalAmount)
        .paymentMethodInfo(paymentMethodInfo)
        .anonymousId(anonymousId);
    final Payment payment = client().executeBlocking(PaymentCreateCommand.of(paymentDraftBuilder.build()));
    assertThat(payment.getAnonymousId()).isEqualTo(anonymousId);
    assertThat(payment.getPaymentMethodInfo()).isEqualTo(paymentMethodInfo);
    assertThat(payment.getAmountPlanned()).isEqualTo(totalAmount);
    client().executeBlocking(PaymentDeleteCommand.of(payment));
  }));
}
origin: commercetools/commercetools-jvm-sdk

final MonetaryAmount totalAmount = EURO_30;
final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
    .method("INVOICE")
    .name(en("invoice payment"))
    .build();
origin: commercetools/commercetools-jvm-sdk

@Test
public void payingPerCreditCart() {
  CustomerFixtures.withCustomerAndCart(client(), ((customer, cart) -> {
    final MonetaryAmount totalAmount = cart.getTotalPrice();
    final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
        .paymentInterface("payment interface X")
        .method("CREDIT_CARD")
        .build();
    final PaymentDraftBuilder paymentDraftBuilder = PaymentDraftBuilder.of(totalAmount)
        .customer(customer)
        .paymentMethodInfo(paymentMethodInfo)
        ;
    final Payment payment = client().executeBlocking(PaymentCreateCommand.of(paymentDraftBuilder.build()));
    assertThat(payment.getCustomer()).isEqualTo(payment.getCustomer());
    assertThat(payment.getPaymentMethodInfo()).isEqualTo(paymentMethodInfo);
    Assertions.assertThat(payment.getAmountPlanned()).isEqualTo(totalAmount);
    assertEventually(() -> {
      final PagedQueryResult<PaymentCreatedMessage> pagedQueryResult = client().executeBlocking(MessageQuery.of()
          .withPredicates(m -> m.resource().is(payment))
          .forMessageType(PaymentCreatedMessage.MESSAGE_HINT));
      assertThat(pagedQueryResult.head()).isPresent();
      final PaymentCreatedMessage paymentCreatedMessage = pagedQueryResult.head().get();
      assertThat(paymentCreatedMessage.getPayment().getId()).isEqualTo(payment.getId());
      assertThat(paymentCreatedMessage.getResource().getId()).isEqualTo(payment.getId());
    });
    client().executeBlocking(PaymentDeleteCommand.of(payment));
  }));
}
origin: commercetools/commercetools-jvm-sdk

final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
    .paymentInterface(randomKey())
    .method("CREDIT_CARD")
    .build();
final TransactionDraft chargeTransaction = TransactionDraftBuilder
origin: commercetools/commercetools-jvm-sdk

final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
    .paymentInterface("payment interface X")
    .method("CREDIT_CARD")
    .name(randomSlug())
    .build();
origin: commercetools/commercetools-jvm-sdk

final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
    .paymentInterface("payment interface X")
    .method("CREDIT_CARD")
    .name(randomSlug())
    .build();
io.sphere.sdk.paymentsPaymentMethodInfoBuildermethod

Popular methods of PaymentMethodInfoBuilder

  • build
  • of
  • paymentInterface
  • <init>
  • name

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • getApplicationContext (Context)
  • findViewById (Activity)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
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