@@ -16,19 +16,15 @@ def initialize(client, version = DEFAULT_VERSION)
1616 #
1717 # Deprecated since Adyen Recurring API v68
1818 def create_permit ( request , headers : { } )
19- endpoint = '/createPermit' . gsub ( /{.+?}/ , '%s' )
20- endpoint = endpoint . gsub ( %r{^/} , '' )
21- endpoint = format ( endpoint )
19+ endpoint = build_endpoint ( '/createPermit' )
2220
2321 action = { method : 'post' , url : endpoint }
2422 @client . call_adyen_api ( @service , action , request , headers , @version )
2523 end
2624
2725 # Disable stored payment details
2826 def disable ( request , headers : { } )
29- endpoint = '/disable' . gsub ( /{.+?}/ , '%s' )
30- endpoint = endpoint . gsub ( %r{^/} , '' )
31- endpoint = format ( endpoint )
27+ endpoint = build_endpoint ( '/disable' )
3228
3329 action = { method : 'post' , url : endpoint }
3430 @client . call_adyen_api ( @service , action , request , headers , @version )
@@ -38,39 +34,31 @@ def disable(request, headers: {})
3834 #
3935 # Deprecated since Adyen Recurring API v68
4036 def disable_permit ( request , headers : { } )
41- endpoint = '/disablePermit' . gsub ( /{.+?}/ , '%s' )
42- endpoint = endpoint . gsub ( %r{^/} , '' )
43- endpoint = format ( endpoint )
37+ endpoint = build_endpoint ( '/disablePermit' )
4438
4539 action = { method : 'post' , url : endpoint }
4640 @client . call_adyen_api ( @service , action , request , headers , @version )
4741 end
4842
4943 # Get stored payment details
5044 def list_recurring_details ( request , headers : { } )
51- endpoint = '/listRecurringDetails' . gsub ( /{.+?}/ , '%s' )
52- endpoint = endpoint . gsub ( %r{^/} , '' )
53- endpoint = format ( endpoint )
45+ endpoint = build_endpoint ( '/listRecurringDetails' )
5446
5547 action = { method : 'post' , url : endpoint }
5648 @client . call_adyen_api ( @service , action , request , headers , @version )
5749 end
5850
5951 # Ask issuer to notify the shopper
6052 def notify_shopper ( request , headers : { } )
61- endpoint = '/notifyShopper' . gsub ( /{.+?}/ , '%s' )
62- endpoint = endpoint . gsub ( %r{^/} , '' )
63- endpoint = format ( endpoint )
53+ endpoint = build_endpoint ( '/notifyShopper' )
6454
6555 action = { method : 'post' , url : endpoint }
6656 @client . call_adyen_api ( @service , action , request , headers , @version )
6757 end
6858
6959 # Schedule running the Account Updater
7060 def schedule_account_updater ( request , headers : { } )
71- endpoint = '/scheduleAccountUpdater' . gsub ( /{.+?}/ , '%s' )
72- endpoint = endpoint . gsub ( %r{^/} , '' )
73- endpoint = format ( endpoint )
61+ endpoint = build_endpoint ( '/scheduleAccountUpdater' )
7462
7563 action = { method : 'post' , url : endpoint }
7664 @client . call_adyen_api ( @service , action , request , headers , @version )
0 commit comments