Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class CreateMerchantPosRequest {
private Boolean enableForeignCard;
private Boolean enableInstallment;
private Boolean enablePaymentWithoutCvc;
private Boolean enableLoyalty;
private Boolean newIntegration;
private Integer orderNumber;
private PosIntegrator posIntegrator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class UpdateMerchantPosRequest {
private Boolean enableForeignCard;
private Boolean enableInstallment;
private Boolean enablePaymentWithoutCvc;
private Boolean enableLoyalty;
private Boolean newIntegration;
private Integer orderNumber;
private List<CardAssociation> supportedCardAssociations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class MerchantPosResponse {
private Boolean enableForeignCard;
private Boolean enableInstallment;
private Boolean enablePaymentWithoutCvc;
private Boolean enableLoyalty;
private Boolean newIntegration;
private Integer orderNumber;
private AutopilotState autopilotState;
Expand Down
36 changes: 36 additions & 0 deletions src/test/java/io/craftgate/sample/MerchantSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,42 @@ void create_merchant_pos() {
assertEquals(response.getPosIntegrator(), PosIntegrator.AKBANK);
}

@Test
void create_merchant_pos_with_enable_loyalty_flag() {
CreateMerchantPosUser createMerchantPosUser = CreateMerchantPosUser.builder()
.posOperationType(PosOperationType.STANDARD)
.posUserType(PosUserType.API)
.posUsername("username")
.posPassword("password")
.build();

CreateMerchantPosRequest request = CreateMerchantPosRequest.builder()
.name("my test pos")
.clientId("client id")
.terminalId("terminal id")
.threedsKey("3d secure key")
.status(PosStatus.AUTOPILOT)
.currency(Currency.TRY)
.orderNumber(1)
.enableInstallment(true)
.enableForeignCard(true)
.enablePaymentWithoutCvc(true)
.enableLoyalty(true)
.posIntegrator(PosIntegrator.AKBANK_VPOS)
.enabledPaymentAuthenticationTypes(Arrays.asList(PaymentAuthenticationType.THREE_DS, PaymentAuthenticationType.NON_THREE_DS))
.merchantPosUsers(Collections.singletonList(createMerchantPosUser))
.build();

MerchantPosResponse response = craftgate.merchant().createMerchantPos(request);
assertNotNull(response.getId());
assertNotNull(response.getHostname());
assertNotNull(response.getAlias());
assertNotNull(response.getPath());
assertNotNull(response.getThreedsPath());
assertEquals(response.getBankName(), "AKBANK T.A.Ş.");
assertEquals(response.getPosIntegrator(), PosIntegrator.AKBANK_VPOS);
}

@Test
void update_merchant_pos() {
Long merchantPosId = 10L;
Expand Down