Skip to content

Commit

Permalink
Add init checkout payments for deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
beratallahverdi committed Jul 4, 2024
1 parent 9e808ce commit 636303a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Craftgate/Request/InitCheckoutPaymentRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class InitCheckoutPaymentRequest
public bool AllowInstallmentOnlyCommercialCards { get; set; }
public bool ForceThreeDS { get; set; }
public bool ForceAuthForNonCreditCards { get; set; }
public bool DepositPayment { get; set; }
public long? Ttl { get; set; }
public IList<CustomInstallment> CustomInstallments { get; set; }
public IList<PaymentItem> Items { get; set; }
Expand Down
20 changes: 20 additions & 0 deletions Samples/PaymentSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,26 @@ public void Init_Checkout_Payment()
Assert.NotNull(response.TokenExpireDate);
}

[Test]
public void Init_Checkout_Payment_For_Deposit()
{
var request = new InitCheckoutPaymentRequest
{
Price = new decimal(100.0),
PaidPrice = new decimal(100.0),
ConversationId = "456d1297-908e-4bd6-a13b-4be31a6e47d5",
Currency = Currency.TRY,
PaymentGroup = PaymentGroup.PRODUCT,
CallbackUrl = "https://www.your-website.com/craftgate-checkout-callback",
DepositPayment = true,
};

var response = _craftgateClient.Payment().InitCheckoutPayment(request);
Assert.NotNull(response.Token);
Assert.NotNull(response.PageUrl);
Assert.NotNull(response.TokenExpireDate);
}

[Test]
public void Create_Deposit_Payment()
{
Expand Down

0 comments on commit 636303a

Please sign in to comment.