@@ -14,49 +14,39 @@ def initialize(client, version = DEFAULT_VERSION)
1414
1515 # Create a boarding token - merchant level
1616 def generate_payments_app_boarding_token_for_merchant ( request , merchant_id , headers : { } )
17- endpoint = '/merchants/{merchantId}/generatePaymentsAppBoardingToken' . gsub ( /{.+?}/ , '%s' )
18- endpoint = endpoint . gsub ( %r{^/} , '' )
19- endpoint = format ( endpoint , merchant_id )
17+ endpoint = build_endpoint ( '/merchants/{merchantId}/generatePaymentsAppBoardingToken' , merchant_id )
2018
2119 action = { method : 'post' , url : endpoint }
2220 @client . call_adyen_api ( @service , action , request , headers , @version )
2321 end
2422
2523 # Create a boarding token - store level
2624 def generate_payments_app_boarding_token_for_store ( request , merchant_id , store_id , headers : { } )
27- endpoint = '/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken' . gsub ( /{.+?}/ , '%s' )
28- endpoint = endpoint . gsub ( %r{^/} , '' )
29- endpoint = format ( endpoint , merchant_id , store_id )
25+ endpoint = build_endpoint ( '/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken' , merchant_id , store_id )
3026
3127 action = { method : 'post' , url : endpoint }
3228 @client . call_adyen_api ( @service , action , request , headers , @version )
3329 end
3430
3531 # Get a list of Payments Apps - merchant level
3632 def list_payments_app_for_merchant ( merchant_id , headers : { } , query_params : { } )
37- endpoint = '/merchants/{merchantId}/paymentsApps' . gsub ( /{.+?}/ , '%s' )
38- endpoint = endpoint . gsub ( %r{^/} , '' )
39- endpoint = format ( endpoint , merchant_id )
33+ endpoint = build_endpoint ( '/merchants/{merchantId}/paymentsApps' , merchant_id )
4034 endpoint += create_query_string ( query_params )
4135 action = { method : 'get' , url : endpoint }
4236 @client . call_adyen_api ( @service , action , { } , headers , @version )
4337 end
4438
4539 # Get a list of Payments Apps - store level
4640 def list_payments_app_for_store ( merchant_id , store_id , headers : { } , query_params : { } )
47- endpoint = '/merchants/{merchantId}/stores/{storeId}/paymentsApps' . gsub ( /{.+?}/ , '%s' )
48- endpoint = endpoint . gsub ( %r{^/} , '' )
49- endpoint = format ( endpoint , merchant_id , store_id )
41+ endpoint = build_endpoint ( '/merchants/{merchantId}/stores/{storeId}/paymentsApps' , merchant_id , store_id )
5042 endpoint += create_query_string ( query_params )
5143 action = { method : 'get' , url : endpoint }
5244 @client . call_adyen_api ( @service , action , { } , headers , @version )
5345 end
5446
5547 # Revoke Payments App instance authentication
5648 def revoke_payments_app ( merchant_id , installation_id , headers : { } )
57- endpoint = '/merchants/{merchantId}/paymentsApps/{installationId}/revoke' . gsub ( /{.+?}/ , '%s' )
58- endpoint = endpoint . gsub ( %r{^/} , '' )
59- endpoint = format ( endpoint , merchant_id , installation_id )
49+ endpoint = build_endpoint ( '/merchants/{merchantId}/paymentsApps/{installationId}/revoke' , merchant_id , installation_id )
6050
6151 action = { method : 'post' , url : endpoint }
6252 @client . call_adyen_api ( @service , action , { } , headers , @version )
0 commit comments