Skip to content

Commit

Permalink
Sync changes with craftgate-java-client 1.0.42
Browse files Browse the repository at this point in the history
  • Loading branch information
ygunayer committed Oct 6, 2023
1 parent ef5d123 commit c361a89
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Add the `:craftgate` dependency to your `mix.exs` file
```elixir
def deps do
...
{:craftgate, "~> 1.0.41"}
{:craftgate, "~> 1.0.42"}
...
end
```
Expand Down
2 changes: 2 additions & 0 deletions lib/craftgate/adapter/payment_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ defmodule Craftgate.Adapter.PaymentAdapter do

endpoint retrieve_checkout_payment(token: String.t()), get: "/payment/v1/checkout-payments/:token", return: PaymentResponse.t()

endpoint expire_checkout_payment(token: String.t()), delete: "/payment/v1/checkout-payments/:token"

endpoint create_deposit_payment(body: CreateDepositPaymentRequest.t()), post: "/payment/v1/deposits", return: DepositPaymentResponse.t()

endpoint init_3ds_deposit_payment(body: CreateDepositPaymentRequest.t()), post: "/payment/v1/deposits/3ds-init", return: InitThreeDSPaymentResponse.t()
Expand Down
1 change: 1 addition & 0 deletions lib/craftgate/model/apm_type.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defmodule Craftgate.Model.ApmType do
:EDENRED,
:FUND_TRANSFER,
:PAYPAL,
:STRIPE,
:AFTERPAY,
:PAYONEER,
:PAPARA,
Expand Down
1 change: 1 addition & 0 deletions lib/craftgate/model/payment_method.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ defmodule Craftgate.Model.PaymentMethod do
use Craftgate.Enum, [
:EDENRED,
:PAYPAL,
:STRIPE,
:ALIPAY,
:AFTERPAY,
:MASTERPASS,
Expand Down
1 change: 1 addition & 0 deletions lib/craftgate/model/payment_provider.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ defmodule Craftgate.Model.PaymentProvider do
:BANK,
:YKB_WORLD_PAY,
:GOOGLEPAY,
:STRIPE,
:MASTERPASS,
:GARANTI_PAY,
:PAYONEER,
Expand Down
2 changes: 2 additions & 0 deletions lib/craftgate/request/create_member_request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ defmodule Craftgate.Request.CreateMemberRequest do
tax_office: :string,
tax_number: :string,
iban: :string,
settlement_earnings_destination: Craftgate.Model.SettlementEarningsDestination,
negative_wallet_amount_limit: :decimal,
sub_merchant_maximum_allowed_negative_balance: :decimal,
is_buyer: :boolean,
is_sub_merchant: :boolean
]
Expand Down
1 change: 1 addition & 0 deletions lib/craftgate/request/init_checkout_payment_request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ defmodule Craftgate.Request.InitCheckoutPaymentRequest do
allow_installment_only_commercial_cards: :boolean,
force_three_ds: :boolean,
force_auth_for_non_credit_cards: :boolean,
ttl: :integer,
custom_installments: {:array, Craftgate.Request.Dto.CustomInstallment},
items: {:array, Craftgate.Request.Dto.PaymentItem}
]
Expand Down
1 change: 1 addition & 0 deletions lib/craftgate/request/update_member_request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ defmodule Craftgate.Request.UpdateMemberRequest do
iban: :string,
settlement_earnings_destination: Craftgate.Model.SettlementEarningsDestination,
negative_wallet_amount_limit: :decimal,
sub_merchant_maximum_allowed_negative_balance: :decimal,
is_buyer: :boolean,
is_sub_merchant: :boolean
]
Expand Down
3 changes: 2 additions & 1 deletion lib/craftgate/response/init_checkout_payment_response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ defmodule Craftgate.Response.InitCheckoutPaymentResponse do

use Craftgate.Serializable, [
token: :string,
page_url: :string
page_url: :string,
token_expire_date: :naive_datetime
]
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Craftgate.MixProject do
use Mix.Project

@version "1.0.41"
@version "1.0.42"

def project do
[
Expand Down
8 changes: 8 additions & 0 deletions test/craftgate_test/adapter/payment_adapter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ defmodule CraftgateTest.Adapter.PaymentAdapterTest do
]
)

test_endpoint(
"expire_checkout_payment/1",
when: PaymentAdapter.expire_checkout_payment("456d1297-908e-4bd6-a13b-4be31a6e47d5"),
expect: [
delete: "/payment/v1/checkout-payments/456d1297-908e-4bd6-a13b-4be31a6e47d5"
]
)

test_endpoint(
"create_deposit_payment/1",
when:
Expand Down

0 comments on commit c361a89

Please sign in to comment.