1010import net .authorize .sample .RecurringBilling .*;
1111import net .authorize .sample .TransactionReporting .*;
1212import net .authorize .sample .CustomerProfiles .*;
13+ import net .authorize .sample .PaypalExpressCheckout .AuthorizationOnly ;
1314
1415/**
1516 * Created by anetdeveloper on 8/5/15.
@@ -107,8 +108,8 @@ private static void ShowMethods()
107108 System .out .println (" GetHostedProfilePage" );
108109 System .out .println (" UpdateCustomerPaymentProfile" );
109110 System .out .println (" UpdateCustomerShippingAddress" );
111+ System .out .println (" PayPalAuthorizationOnly" );
110112 System .out .println (" PayPalAuthorizeOnlyContinue" );
111- System .out .println (" PayPalCredit" );
112113 }
113114
114115 private static void RunMethod (String methodName )
@@ -117,7 +118,9 @@ private static void RunMethod(String methodName)
117118 // You can create your own keys in seconds by signing up for a sandbox account here: https://developer.authorize.net/sandbox/
118119 String apiLoginId = "5KP3u95bQpv" ;
119120 String transactionKey = "4Ktq966gC55GAX7S" ;
121+ //Update the payedId with which you want to run the sample code
120122 String payerId = "" ;
123+ //Update the transactionId with which you want to run the sample code
121124 String transactionId = "" ;
122125
123126 switch (methodName ) {
@@ -226,32 +229,12 @@ private static void RunMethod(String methodName)
226229 case "UpdateCustomerShippingAddress" :
227230 UpdateCustomerShippingAddress .run (apiLoginId , transactionKey );
228231 break ;
232+ case "PayPalAuthorizationOnly" :
233+ AuthorizationOnly .run (apiLoginId , transactionKey );
234+ break ;
229235 case "PayPalAuthorizeOnlyContinue" :
230- BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
231- System .out .println ("Enter transaction ID: " );
232- try {
233- transactionId = br .readLine ();
234- } catch (IOException e ) {
235- e .printStackTrace ();
236- }
237- System .out .println ("Enter payer ID: " );
238- try {
239- payerId = br .readLine ();
240- } catch (IOException e ) {
241- e .printStackTrace ();
242- }
243236 AuthorizationOnlyContinued .run (apiLoginId , transactionKey , transactionId , payerId );
244237 break ;
245- case "PayPalCredit" :
246- BufferedReader reader = new BufferedReader (new InputStreamReader (System .in ));
247- System .out .println ("Enter transaction ID: " );
248- try {
249- transactionId = reader .readLine ();
250- } catch (IOException e ){
251- e .printStackTrace ();
252- }
253- Credit .run (apiLoginId , transactionKey , transactionId );
254- break ;
255238 default :
256239 ShowUsage ();
257240 break ;
0 commit comments