Skip to content

Commit

Permalink
BKM Express flow improvements (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
deryacakmak authored Jan 3, 2025
1 parent af9c9a1 commit 5d11ad4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ public PaymentResponse retrievePayment(String ticketId) {
String path = "/payment/v1/bkm-express/payments/" + ticketId;
return HttpClient.get(requestOptions.getBaseUrl() + path, createHeaders(path, requestOptions), PaymentResponse.class);
}

public PaymentResponse retrievePaymentByToken(String token) {
String path = "/payment/v1/bkm-express/" + token;
return HttpClient.get(requestOptions.getBaseUrl() + path, createHeaders(path, requestOptions), PaymentResponse.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public class CompleteBkmExpressRequest {
private boolean status;
private String message;
private String ticketId;
private String bkmExpressPaymentToken;
}
24 changes: 24 additions & 0 deletions src/test/java/io/craftgate/sample/BkmExpressSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ void complete_bkm_express() {
assertNotNull(response.getOrderId());
}

@Test
void complete_bkm_express_by_token() {

CompleteBkmExpressRequest completeBkmExpressRequest = CompleteBkmExpressRequest.builder()
.message("İşlem Başarılı")
.status(true)
.ticketId("7c0f7c89-e954-46d5-ad37-2a5c0b5f0356")
.bkmExpressPaymentToken("23f4e147-2c4e-4a2c-8a67-9c783d813b79")
.build();

PaymentResponse response = craftgate.bkmExpressPaymentAdapter().complete(completeBkmExpressRequest);
assertNotNull(response);
assertNotNull(response.getOrderId());
}

@Test
void retrieve_bkm_express_payment() {

Expand All @@ -81,4 +96,13 @@ void retrieve_bkm_express_payment() {
PaymentResponse response = craftgate.bkmExpressPaymentAdapter().retrievePayment(ticketId);
assertNotNull(response);
}

@Test
void retrieve_bkm_express_payment_by_token() {

String bkmExpressPaymentToken = "23f4e147-2c4e-4a2c-8a67-9c783d813b79";

PaymentResponse response = craftgate.bkmExpressPaymentAdapter().retrievePaymentByToken(bkmExpressPaymentToken);
assertNotNull(response);
}
}

0 comments on commit 5d11ad4

Please sign in to comment.