I am using the PayPal REST API WebProfile class to configure how a PayPal site should open for a client. There are some things that are not clear to me. Based on the recommendations of PayPal, I create a WebProfile object, get a unique experience_profile_id and use it when creating the Payment object (which opens the PayPal site for payment). Snippets (lots of code, including try blocks, etc., removed for brevity):
$my_web_profile = new WebProfile(); $create_profile_response = $my_web_profile->create($my_paypal); $my_web_profile_id = $create_profile_response->getId(); $my_payment = new Payment(); $my_payment->setExperienceProfileId($my_web_profile_id); $my_payment->create($my_paypal);
All of this works great.
My questions:
The WebProfile class enables you to update the created web profile object and delete it. When should you use update and delete methods? What time is right for creating a WebProfile object? Can it be created when the website is launched and simply reused for each customer who is trying to make a payment? Or should it be created for each payment (when the customer clicks the Buy button) and is deleted after each payment?
Diana source share