Skip to content

Commit

Permalink
updates based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
deryacakmak committed Nov 10, 2023
1 parent f3d2a2a commit 33bda32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions adapter/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ type BnplPaymentCartItem struct {
Quantity int64 `json:"quantity"`
}

type OfferBnplPaymentRequest struct {
type BnplPaymentOfferRequest struct {
ApmType ApmType `json:"apmType"`
MerchantApmId int64 `json:"merchantApmId,omitempty"`
Price float64 `json:"price"`
Expand Down Expand Up @@ -1548,7 +1548,7 @@ type InitBnplPaymentResponse struct {
PaymentError PaymentError `json:"paymentError"`
}

type OfferBnplPaymentResponse struct {
type BnplPaymentOfferResponse struct {
OfferId string `json:"offerId"`
Price *float64 `json:"price"`
BnplBankOffers *[]BnplBankOffer `json:"nnplBankOffers"`
Expand Down
4 changes: 2 additions & 2 deletions adapter/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,13 @@ func (api *Payment) DisapprovePaymentTransactions(ctx context.Context, request P
return response.Data, nil
}

func (api *Payment) RetrieveBnplOffers(ctx context.Context, request OfferBnplPaymentRequest) (*DataResponse[OfferBnplPaymentResponse], error) {
func (api *Payment) RetrieveBnplOffers(ctx context.Context, request BnplPaymentOfferRequest) (*DataResponse[BnplPaymentOfferResponse], error) {
newRequest, err := api.Client.NewRequest(ctx, http.MethodPost, "/payment/v1/bnpl-payments/offers", request)
if err != nil {
return nil, err
}

response := &Response[DataResponse[OfferBnplPaymentResponse]]{}
response := &Response[DataResponse[BnplPaymentOfferResponse]]{}
err = api.Client.Do(ctx, newRequest, response)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions tests/payment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ func TestPayment_NotVerify3DSCallback(t *testing.T) {
require.False(t, is3DSecureCallbackVerified)
}

func TestPayment_OfferBnplPayment(t *testing.T) {
request := adapter.OfferBnplPaymentRequest{
func TestPayment_BnplPaymentOffer(t *testing.T) {
request := adapter.BnplPaymentOfferRequest{
ApmType: craftgate.ApmType_MASLAK,
Price: 10000,
Currency: craftgate.Currency_TRY,
Expand Down

0 comments on commit 33bda32

Please sign in to comment.