diff --git a/Craftgate/Adapter/PaymentAdapter.cs b/Craftgate/Adapter/PaymentAdapter.cs index 51ad22c..7b70aef 100644 --- a/Craftgate/Adapter/PaymentAdapter.cs +++ b/Craftgate/Adapter/PaymentAdapter.cs @@ -123,6 +123,20 @@ public Task RetrieveCheckoutPaymentAsync(string token) CreateHeaders(path, RequestOptions)); } + public void ExpireCheckoutPayment(string token) + { + var path = "/payment/v1/checkout-payments/" + token; + RestClient.Delete(RequestOptions.BaseUrl + path, + CreateHeaders(path, RequestOptions)); + } + + public Task ExpireCheckoutPaymentAsync(string token) + { + var path = "/payment/v1/checkout-payments/" + token; + return AsyncRestClient.Delete(RequestOptions.BaseUrl + path, + CreateHeaders(path, RequestOptions)); + } + public DepositPaymentResponse CreateDepositPayment(CreateDepositPaymentRequest createDepositPaymentRequest) { var path = "/payment/v1/deposits"; diff --git a/Craftgate/Request/InitCheckoutPaymentRequest.cs b/Craftgate/Request/InitCheckoutPaymentRequest.cs index bd4b2c4..e1e5252 100644 --- a/Craftgate/Request/InitCheckoutPaymentRequest.cs +++ b/Craftgate/Request/InitCheckoutPaymentRequest.cs @@ -29,6 +29,7 @@ public class InitCheckoutPaymentRequest public bool AllowInstallmentOnlyCommercialCards { get; set; } public bool ForceThreeDS { get; set; } public bool ForceAuthForNonCreditCards { get; set; } + public long? Ttl { get; set; } public IList CustomInstallments { get; set; } public IList Items { get; set; } } diff --git a/Craftgate/Response/InitCheckoutPaymentResponse.cs b/Craftgate/Response/InitCheckoutPaymentResponse.cs index 0069c3b..aefc6c1 100644 --- a/Craftgate/Response/InitCheckoutPaymentResponse.cs +++ b/Craftgate/Response/InitCheckoutPaymentResponse.cs @@ -1,8 +1,11 @@ +using System; + namespace Craftgate.Response { public class InitCheckoutPaymentResponse { public string Token { get; set; } public string PageUrl { get; set; } + public DateTime TokenExpireDate { get; set; } } } \ No newline at end of file diff --git a/Samples/PaymentSample.cs b/Samples/PaymentSample.cs index bb6ee4c..0f34364 100644 --- a/Samples/PaymentSample.cs +++ b/Samples/PaymentSample.cs @@ -743,6 +743,7 @@ public void Init_Checkout_Payment() var response = _craftgateClient.Payment().InitCheckoutPayment(request); Assert.NotNull(response.Token); Assert.NotNull(response.PageUrl); + Assert.NotNull(response.TokenExpireDate); } [Test] @@ -1348,6 +1349,14 @@ public void Retrieve_Checkout_Payment() Assert.NotNull(response.CardToken); } + [Test] + public void Delete_Payout_Account() + { + var token = "456d1297-908e-4bd6-a13b-4be31a6e47d5"; + + _craftgateClient.Payment().ExpireCheckoutPayment(token); + } + [Test] public void Refund_Payment() {