File tree Expand file tree Collapse file tree
app/services/subscriptions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def initialize(endpoint_url:)
1717 def call ( form_payload :)
1818 return missing_configuration_result if endpoint_url . blank?
1919
20- response = faraday . post ( endpoint_url , form_payload )
20+ response = faraday . post ( endpoint_url , provider_payload ( form_payload ) )
2121 Rails . logger . info (
2222 "[subscriptions#provider] status=#{ response . status } " \
2323 "location=#{ redirect_location ( response ) } " \
@@ -55,6 +55,14 @@ def missing_configuration_result
5555 )
5656 end
5757
58+ def provider_payload ( form_payload )
59+ # Map internal API contract to Pardot Form Handler external field names.
60+ {
61+ 'email' => form_payload [ 'email' ] ,
62+ 'Tester' => form_payload [ 'test_opt_in' ]
63+ } . compact
64+ end
65+
5866 def classify_response ( response )
5967 return reject_result unless SUCCESS_STATUS_CODES . include? ( response . status )
6068 return Result . new ( success? : true ) if response . status == 200
You can’t perform that action at this time.
0 commit comments