11using BuckarooSdk . DataTypes . RequestBases ;
22using BuckarooSdk . Logging ;
3- using BuckarooSdk . Tests . Constants ;
3+ using BuckarooSdk . Services . Afterpay ;
44using Microsoft . VisualStudio . TestTools . UnitTesting ;
55using System ;
6- using System . Diagnostics ;
76using System . Globalization ;
8- using BuckarooSdk . Services . Afterpay ;
9- using BuckarooSdk . DataTypes . ParameterGroups . Afterpay ;
7+ using BuckarooSdk . Tests . Constants ;
108
119namespace BuckarooSdk . Tests . Services . Afterpay
1210{
@@ -53,6 +51,7 @@ public void CancelAuthorizeTest()
5351 // Process.Start(response.RequiredAction.RedirectURL);
5452 // Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
5553 }
54+
5655 [ TestMethod ]
5756 public void PayTest ( )
5857 {
@@ -81,8 +80,9 @@ public void PayTest()
8180 // Process.Start(response.RequiredAction.RedirectURL);
8281 // Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
8382 }
83+
8484 [ TestMethod ]
85- public void RefundTest ( )
85+ public void RefundUndefinedTest ( )
8686 {
8787 var request =
8888 this . _buckarooClient . CreateRequest ( new StandardLogger ( ) ) // Create a request.
@@ -102,13 +102,72 @@ public void RefundTest()
102102 Order = $ "SDK_{ TestName } _{ DateTime . Now . Ticks } ",
103103 } )
104104 . Afterpay ( ) // Choose the paymentmethod you want to use
105- . Refund ( Mocks . Afterpay . AfterpayRefundMock ) ; // choose the action you want to use and provide the payment method specific info.
105+ . Refund ( Mocks . Afterpay . AfterpayRefundMock ( "Undefined" ) ) ; // choose the action you want to use and provide the payment method specific info.
106106
107107 var response = request . Execute ( ) ;
108108
109109 // Process.Start(response.RequiredAction.RedirectURL);
110110 // Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
111111 }
112+
113+ [ TestMethod ]
114+ public void RefundReturnTest ( )
115+ {
116+ var request =
117+ this . _buckarooClient . CreateRequest ( new StandardLogger ( ) ) // Create a request.
118+ . Authenticate ( TestSettings . WebsiteKey , TestSettings . SecretKey , false , new CultureInfo ( "nl-NL" ) )
119+ . TransactionRequest ( ) // One of the request type options.
120+ . SetBasicFields ( new TransactionBase // The transactionbase contains the base information of a transaction.
121+ {
122+ Currency = "EUR" ,
123+ Description = $ "SDK_{ TestName } _{ DateTime . Now . Ticks } ",
124+ ReturnUrl = TestSettings . ReturnUrl ,
125+ ReturnUrlCancel = TestSettings . ReturnUrlCancel ,
126+ ReturnUrlError = TestSettings . ReturnUrlError ,
127+ ReturnUrlReject = TestSettings . ReturnUrlReject ,
128+ Invoice = $ "SDK_{ TestName } _{ DateTime . Now . Ticks } ",
129+ OriginalTransactionKey = "" ,
130+ AmountCredit = 2 ,
131+ Order = $ "SDK_{ TestName } _{ DateTime . Now . Ticks } ",
132+ } )
133+ . Afterpay ( ) // Choose the paymentmethod you want to use
134+ . Refund ( Mocks . Afterpay . AfterpayRefundMock ( "Return" ) ) ; // choose the action you want to use and provide the payment method specific info.
135+
136+ var response = request . Execute ( ) ;
137+
138+ // Process.Start(response.RequiredAction.RedirectURL);
139+ // Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
140+ }
141+
142+ [ TestMethod ]
143+ public void RefundTest ( )
144+ {
145+ var request =
146+ this . _buckarooClient . CreateRequest ( new StandardLogger ( ) ) // Create a request.
147+ . Authenticate ( TestSettings . WebsiteKey , TestSettings . SecretKey , false , new CultureInfo ( "nl-NL" ) )
148+ . TransactionRequest ( ) // One of the request type options.
149+ . SetBasicFields ( new TransactionBase // The transactionbase contains the base information of a transaction.
150+ {
151+ Currency = "EUR" ,
152+ Description = $ "SDK_{ TestName } _{ DateTime . Now . Ticks } ",
153+ ReturnUrl = TestSettings . ReturnUrl ,
154+ ReturnUrlCancel = TestSettings . ReturnUrlCancel ,
155+ ReturnUrlError = TestSettings . ReturnUrlError ,
156+ ReturnUrlReject = TestSettings . ReturnUrlReject ,
157+ Invoice = $ "SDK_{ TestName } _{ DateTime . Now . Ticks } ",
158+ OriginalTransactionKey = "" ,
159+ AmountCredit = 2 ,
160+ Order = $ "SDK_{ TestName } _{ DateTime . Now . Ticks } ",
161+ } )
162+ . Afterpay ( ) // Choose the paymentmethod you want to use
163+ . Refund ( Mocks . Afterpay . AfterpayRefundMock ( "Refund" ) ) ; // choose the action you want to use and provide the payment method specific info.
164+
165+ var response = request . Execute ( ) ;
166+
167+ // Process.Start(response.RequiredAction.RedirectURL);
168+ // Console.WriteLine(response.BuckarooSdkLogger.GetFullLog());
169+ }
170+
112171 [ TestMethod ]
113172 public void AuthorizeTest ( )
114173 {
0 commit comments