Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
semihshn committed Mar 20, 2024
1 parent f27292f commit 4d6643f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions adapter/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const (
ApmType_KLARNA ApmType = "KLARNA"
ApmType_AFTERPAY ApmType = "AFTERPAY"
ApmType_KASPI ApmType = "KASPI"
ApmType_COMPAY ApmType = "COMPAY"
ApmType_TOMPAY ApmType = "TOMPAY"
ApmType_MASLAK ApmType = "MASLAK"
ApmType_ALFABANK ApmType = "ALFABANK"
Expand All @@ -109,6 +110,7 @@ const (
PaymentProvider_KLARNA PaymentProvider = "KLARNA"
PaymentProvider_AFTERPAY PaymentProvider = "AFTERPAY"
PaymentProvider_KASPI PaymentProvider = "KASPI"
PaymentProvider_COMPAY PaymentProvider = "COMPAY"
PaymentProvider_TOMPAY PaymentProvider = "TOMPAY"
PaymentProvider_APPLEPAY PaymentProvider = "APPLEPAY"
PaymentProvider_GOOGLEPAY PaymentProvider = "GOOGLEPAY"
Expand Down Expand Up @@ -188,6 +190,7 @@ const (
PaymentMethod_KLARNA PaymentMethod = "KLARNA"
PaymentMethod_AFTERPAY PaymentMethod = "AFTERPAY"
PaymentMethod_KASPI PaymentMethod = "KASPI"
PaymentMethod_COMPAY PaymentMethod = "COMPAY"
PaymentMethod_TOMPAY PaymentMethod = "TOMPAY"
PaymentMethod_STRIPE PaymentMethod = "STRIPE"
)
Expand Down Expand Up @@ -347,6 +350,7 @@ const (
const (
ApmAdditionalAction_REDIRECT_TO_URL ApmAdditionalAction = "REDIRECT_TO_URL"
ApmAdditionalAction_OTP_REQUIRED ApmAdditionalAction = "OTP_REQUIRED"
ApmAdditionalAction_SHOW_HTML_CONTENT ApmAdditionalAction = "SHOW_HTML_CONTENT"
ApmAdditionalAction_WAIT_FOR_WEBHOOK ApmAdditionalAction = "WAIT_FOR_WEBHOOK"
ApmAdditionalAction_APPROVAL_REQUIRED ApmAdditionalAction = "APPROVAL_REQUIRED"
ApmAdditionalAction_NONE ApmAdditionalAction = "NONE"
Expand Down Expand Up @@ -987,6 +991,7 @@ type InitCheckoutPaymentResponse struct {
type InitApmPaymentResponse struct {
PaymentId *int64 `json:"paymentId"`
RedirectUrl *string `json:"redirectUrl"`
HtmlContent *string `json:"htmlContent"`
PaymentStatus *PaymentStatus `json:"paymentStatus"`
ApmAdditionalAction *ApmAdditionalAction `json:"additionalAction"`
PaymentError *PaymentError `json:"paymentError"`
Expand Down Expand Up @@ -1319,6 +1324,16 @@ type InstallmentResponse struct {
InstallmentPrices []InstallmentPrice `json:"installmentPrices"`
}

type InstantTransferBanksResponse struct {
Items []InstantTransferBank `json:"items"`
}

type InstantTransferBank struct {
BankCode *string `json:"bankCode"`
BankName *string `json:"bankName"`
BankLogoUrl *string `json:"bankLogoUrl"`
}

type RetrieveBinNumberResponse struct {
BinNumber *string `json:"binNumber"`
CardType *string `json:"cardType"`
Expand Down
14 changes: 14 additions & 0 deletions adapter/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,20 @@ func (api *Payment) ApproveBnplPayment(ctx context.Context, paymentId int64) err
return nil
}

func (api *Payment) RetrieveActiveBanks(ctx context.Context) (*InstantTransferBanksResponse, error) {
newRequest, err := api.Client.NewRequest(ctx, http.MethodGet, "/payment/v1/instant-transfer-banks", nil)
if err != nil {
return nil, err
}
response := &Response[InstantTransferBanksResponse]{}
err = api.Client.Do(ctx, newRequest, response)
if err != nil {
return nil, err
}

return response.Data, nil
}

func (c *Payment) Is3DSecureCallbackVerified(threeDSecureCallbackKey string, params map[string]string) bool {
hash := params["hash"]
hashString := strings.Join([]string{threeDSecureCallbackKey,
Expand Down

0 comments on commit 4d6643f

Please sign in to comment.