I am posting this on behalf of a customer. Customer will like to integrate Payflow Pro into one of HubSpot Form but he is not sure what is the best way of doing so.
Hearing from him, the code used seems to be a php code, hence I am not too sure whether the ‘Submit data to a form’ API is still workable here. Any insights on what is the best way to go about implementing this would be great, I will share them with the customer.
The php code:
$arr = array( 'properties' => array( array( 'property' => 'email', 'value' => 'firstname.lastname@example.org' ), array( 'property' => 'firstname', 'value' => 'hubspot' ), array( 'property' => 'lastname', 'value' => 'user' ), array( 'property' => 'phone', 'value' => '555-1212' ) ) ); $post_json = json_encode($arr); $hapikey = readline("Enter hapikey: (demo for the demo portal): "); $endpoint = 'https://api.hubapi.com/contacts/v1/contact?hapikey=' . $hapikey; $ch = @curl_init();
@curl_setopt($ch, CURLOPT_POST, true);
@curl_setopt($ch, CURLOPT_POSTFIELDS, $post_json);
@curl_setopt($ch, CURLOPT_URL, $endpoint);
@curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’));
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = @curl_exec($ch); $status_code = @curl_getinfo($ch, CURLINFO_HTTP_CODE); $curl_errors = curl_error($ch);
echo "curl Errors: " . $curl_errors; echo "\nStatus code: " . $status_code; echo "\nResponse: " . $response;