Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/main/java/io/craftgate/adapter/PaymentAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ public BnplLimitInquiryResponse bnplLimitInquiry(BnplLimitInquiryRequest bnplLim
return HttpClient.post(requestOptions.getBaseUrl() + path, createHeaders(bnplLimitInquiryRequest, path, requestOptions), bnplLimitInquiryRequest, BnplLimitInquiryResponse.class);
}

public InstantTransferBanksResponse retrieveActiveBanks() {
String path = "/payment/v1/instant-transfer-banks";
public CompayBanksResponse retrieveActiveBanks() {
String path = "/payment/v1/compay/banks";
return HttpClient.get(requestOptions.getBaseUrl() + path, createHeaders(path, requestOptions),
InstantTransferBanksResponse.class);
CompayBanksResponse.class);
}

public InitMultiPaymentResponse initMultiPayment(InitMultiPaymentRequest initMultiPaymentRequest) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/craftgate/model/ApmType.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum ApmType {
GOOGLEPAY,
CASH_ON_DELIVERY,
FUND_TRANSFER,
INSTANT_TRANSFER,
COMPAY,
BIZUM,
PAYLANDS_MB_WAY,

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/craftgate/model/PaymentMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum PaymentMethod {
PAYPAL,
KLARNA,
AFTERPAY,
INSTANT_TRANSFER,
COMPAY,
STRIPE,
HEPSIPAY,
GARANTI_PAY,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/craftgate/model/PaymentProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum PaymentProvider {
HEPSIPAY,
STRIPE,
KASPI,
INSTANT_TRANSFER,
COMPAY,
MASLAK,
TOMPAY,
TOM_FINANCE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.*;

@Data
public class InstantTransferBank {
public class CompayBank {

private String bankCode;
private String bankName;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/io/craftgate/response/CompayBanksResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.craftgate.response;

import lombok.Data;

import java.util.List;

@Data
public class CompayBanksResponse {

private List<CompayBank> items;

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import io.craftgate.request.InitApmPaymentRequest;
import io.craftgate.request.dto.PaymentItem;
import io.craftgate.response.ApmPaymentInitResponse;
import io.craftgate.response.InstantTransferBank;
import io.craftgate.response.InstantTransferBanksResponse;
import io.craftgate.response.CompayBank;
import io.craftgate.response.CompayBanksResponse;
import org.junit.jupiter.api.Test;

import java.math.BigDecimal;
Expand All @@ -17,20 +17,20 @@

import static org.junit.jupiter.api.Assertions.*;

public class InstantTransferPaymentSample {
public class CompayPaymentSample {

private final Craftgate craftgate = new Craftgate("api-key", "secret-key", "https://sandbox-api.craftgate.io");

@Test
void retrieve_active_banks() {
InstantTransferBanksResponse response = craftgate.payment().retrieveActiveBanks();
CompayBanksResponse response = craftgate.payment().retrieveActiveBanks();
assertNotNull(response.getItems());
InstantTransferBank instantTransferBank = response.getItems().get(0);
assertNotNull(instantTransferBank);
CompayBank compayBank = response.getItems().get(0);
assertNotNull(compayBank);
}

@Test
void init_instant_transfer_apm_payment() {
void init_compay_apm_payment() {
List<PaymentItem> items = new ArrayList<>();

items.add(PaymentItem.builder()
Expand All @@ -46,7 +46,7 @@ void init_instant_transfer_apm_payment() {
.build());

InitApmPaymentRequest request = InitApmPaymentRequest.builder()
.apmType(ApmType.INSTANT_TRANSFER)
.apmType(ApmType.COMPAY)
.price(BigDecimal.valueOf(1))
.paidPrice(BigDecimal.valueOf(1))
.currency(Currency.TRY)
Expand All @@ -56,6 +56,8 @@ void init_instant_transfer_apm_payment() {
.callbackUrl("https://www.your-website.com/craftgate-apm-callback")
.additionalParams(new HashMap() {{
put("bankCode", "0");
put("shopUrl", "your-website.com");
put("receiptDescription", "your-receipt-description");
}})
.items(items)
.build();
Expand Down
Loading