Skip to content

Commit

Permalink
Update onboard entity request, payment contexts and metadata. Fix tes…
Browse files Browse the repository at this point in the history
…t payment sessions response (#395)
  • Loading branch information
armando-rodriguez-cko authored Mar 15, 2024
1 parent 72bae48 commit dbed79a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.checkout.accounts;

import com.checkout.common.Currency;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.Data;
Expand All @@ -19,4 +20,6 @@ public class EntityFinancialDetails {

private EntityFinancialDocuments documents;

private Currency currency;

}
3 changes: 3 additions & 0 deletions src/main/java/com/checkout/accounts/Individual.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ public final class Individual {
private PlaceOfBirth placeOfBirth;

private Identification identification;

@SerializedName("financial_details")
private EntityFinancialDetails financialDetails;

}
2 changes: 2 additions & 0 deletions src/main/java/com/checkout/accounts/Representative.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ public final class Representative {

private List<EntityRoles> roles;

private OnboardSubEntityDocuments documents;

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class MetadataClientImpl extends AbstractClient implements MetadataClient {

public MetadataClientImpl(final ApiClient apiClient, final CheckoutConfiguration configuration) {
super(apiClient, configuration, SdkAuthorizationType.OAUTH);
super(apiClient, configuration, SdkAuthorizationType.SECRET_KEY_OR_OAUTH);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.checkout.payments.contexts;

import com.checkout.common.Currency;
import com.checkout.common.CustomerRequest;
import com.checkout.payments.PaymentType;
import com.checkout.payments.ShippingDetails;
import com.google.gson.annotations.SerializedName;
Expand All @@ -22,8 +23,13 @@ public class PaymentContexts {
@SerializedName("payment_type")
public PaymentType paymentType;

@SerializedName("authorization_type")
private String authorizationType;

public boolean capture;

private CustomerRequest customer;

public ShippingDetails shipping;

public PaymentContextsProcessing processing;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
package com.checkout.payments.sessions;

import com.checkout.common.Currency;
import com.checkout.common.CustomerResponse;
import com.checkout.common.Resource;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public final class PaymentSessionsResponse extends Resource {

private String id;

private Long amount;

private String locale;

private Currency currency;

private CustomerResponse customer;

@SerializedName("payment_methods")
private List<PaymentMethods> paymentMethods;

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CardMetadataClientImplTest {

@BeforeEach
void setUp() {
when(sdkCredentials.getAuthorization(SdkAuthorizationType.OAUTH)).thenReturn(authorization);
when(sdkCredentials.getAuthorization(SdkAuthorizationType.SECRET_KEY_OR_OAUTH)).thenReturn(authorization);
when(configuration.getSdkCredentials()).thenReturn(sdkCredentials);
client = new MetadataClientImpl(apiClient, configuration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ void shouldMakeAPaymentSessionsRequest() {

assertNotNull(response);
assertNotNull(response.getId());
assertEquals("en-GB", response.getLocale());
assertEquals(Currency.GBP, response.getCurrency());
assertNotNull(response.getPaymentMethods());
assertNotNull(response.getLinks());

}
Expand Down

0 comments on commit dbed79a

Please sign in to comment.