Skip to content

Commit

Permalink
feat: add new fields and update tests for payments processing
Browse files Browse the repository at this point in the history
- Added `storeForFutureUse` field to `RequestNetworkTokenSource` with constructor support.
- Added `panTypeProcessed` and `ckoNetworkTokenAvailable` fields to `ProcessingData`.
- Updated `TestHelper` to include `displayName` in test setup for payments.
- Marked `shouldGetBankAccountFieldFormatting` test as disabled with a note in `BankAccountFieldFormattingTestIT`.
- Refined `RequestApmPaymentsIT` to validate non-null payment response in tests.
  • Loading branch information
armando-rodriguez-cko committed Jan 24, 2025
1 parent 172fbfc commit 3333a11
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public final class RequestNetworkTokenSource extends AbstractRequestSource {

private Boolean stored;

@SerializedName("store_for_future_use")
private Boolean storeForFutureUse;

private String name;

private String cvv;
Expand All @@ -56,6 +59,7 @@ private RequestNetworkTokenSource(final String token,
final String cryptogram,
final String eci,
final Boolean stored,
final Boolean storeForFutureUse,
final String name,
final String cvv,
final Address billingAddress,
Expand All @@ -69,6 +73,7 @@ private RequestNetworkTokenSource(final String token,
this.cryptogram = cryptogram;
this.eci = eci;
this.stored = stored;
this.storeForFutureUse = storeForFutureUse;
this.name = name;
this.cvv = cvv;
this.billingAddress = billingAddress;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.checkout.payments.response;

import com.checkout.common.CountryCode;
import com.checkout.payments.PanProcessedType;
import com.checkout.payments.PreferredSchema;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
Expand Down Expand Up @@ -71,4 +72,10 @@ public final class ProcessingData {
@SerializedName("scheme_merchant_id")
private String schemeMerchantId;

@SerializedName("pan_type_processed")
private PanProcessedType panTypeProcessed;

@SerializedName("cko_network_token_available")
private Boolean ckoNetworkTokenAvailable;

}
1 change: 1 addition & 0 deletions src/test/java/com/checkout/TestHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public static HostedPaymentRequest createHostedPaymentRequest(final String refer
.amount(1000L)
.reference(reference)
.currency(Currency.GBP)
.displayName("Payment Test Company")
.description("Payment for Gold Necklace")
.customer(createCustomer())
.shipping(ShippingDetails.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.checkout.instruments.get.BankAccountFieldQuery;
import com.checkout.instruments.get.BankAccountFieldResponse;
import com.checkout.instruments.get.PaymentNetwork;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertFalse;
Expand All @@ -21,6 +22,7 @@ class BankAccountFieldFormattingTestIT extends SandboxTestFixture {
}

@Test
@Disabled("unavailable")
void shouldGetBankAccountFieldFormatting() {
final BankAccountFieldQuery query = BankAccountFieldQuery.builder()
.accountHolderType(AccountHolderType.INDIVIDUAL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ void shouldMakeKnetPayment() {
.failureUrl("https://testing.checkout.com/failure")
.build();

checkErrorItem(() -> paymentsClient.requestPayment(paymentRequest), PAYEE_NOT_ONBOARDED);
final PaymentResponse paymentResponse = blocking(() -> paymentsClient.requestPayment(paymentRequest));
assertNotNull(paymentResponse);

}

@Test
Expand Down

0 comments on commit 3333a11

Please sign in to comment.