congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PaymentMethodInfoBuilder
Code IndexAdd Tabnine to your IDE (free)

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

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

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: com.commercetools.sdk.jvm.core/commercetools-models

public static PaymentMethodInfoBuilder of() {
  return new PaymentMethodInfoBuilder();
}
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: commercetools/commercetools-jvm-sdk

public static PaymentMethodInfoBuilder of() {
  return new PaymentMethodInfoBuilder();
}
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: io.sphere.sdk.jvm/sphere-models

public static PaymentMethodInfoBuilder of() {
  return new PaymentMethodInfoBuilder();
}
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

withStateByBuilder(client(), stateBuilder -> stateBuilder.initial(true).type(PAYMENT_STATE), paidState -> {
  final MonetaryAmount totalAmount = EURO_30;
  final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
      .method("INVOICE")
      .name(en("invoice payment"))
      .build();
  final PaymentStatus paymentStatus = PaymentStatusBuilder.of()
      .interfaceCode("300")
origin: commercetools/commercetools-jvm-sdk

withCustomerAndFilledCart(client(), (customer, cart) -> {
  final MonetaryAmount totalAmount = cart.getTotalPrice();
  final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
      .paymentInterface(randomKey())
      .method("CREDIT_CARD")
      .build();
  final TransactionDraft chargeTransaction = TransactionDraftBuilder
      .of(TransactionType.CHARGE, totalAmount, ZonedDateTime.now())
origin: commercetools/commercetools-jvm-sdk

final MonetaryAmount totalAmount = cart.getTotalPrice();
final PaymentStatus paymentStatus = PaymentStatusBuilder.of().interfaceCode(randomKey()).interfaceText(randomString()).state(paidState).build();
final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
    .paymentInterface("payment interface X")
    .method("CREDIT_CARD")
    .name(randomSlug())
    .build();
final TransactionDraft transactionDraft = TransactionDraftBuilder
    .of(TransactionType.CHARGE, totalAmount, ZonedDateTime.now())
origin: commercetools/commercetools-jvm-sdk

final MonetaryAmount totalAmount = cart.getTotalPrice();
final PaymentStatus paymentStatus = PaymentStatusBuilder.of().interfaceCode(randomKey()).interfaceText(randomString()).state(paidState).build();
final PaymentMethodInfo paymentMethodInfo = PaymentMethodInfoBuilder.of()
    .paymentInterface("payment interface X")
    .method("CREDIT_CARD")
    .name(randomSlug())
    .build();
final TransactionType transactionType = TransactionType.CHARGE;
final List<TransactionDraft> transactions = Collections.singletonList(TransactionDraftBuilder
io.sphere.sdk.paymentsPaymentMethodInfoBuilder

Most used methods

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

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Menu (java.awt)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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