I was trying to adjust the 'return to site' links on PayPal so that they didn't say 'Return to *business-name*' because the business name in my paypal account does not match the name of my website. The only way I could do this was by adding a 'cbt' item to the data array being sent to paypal in the commerce_paypal_wps_order_form() in commerce_paypal_wps.module

By adding a drupal_alter after the data array is built would allow other modules to add items to this array for maximum customization. I noticed this is already happening in the WPP module, but not in WPS.

Here's a patch.

Comments

andyg5000’s picture

Status: Active » Needs review
StatusFileSize
new1.38 KB

@sonictruth,
Thanks for the patch. Here's an update that adds the order object and api documentation.

rszrama’s picture

Status: Needs review » Fixed

After reviewing this and realizing it was just for PayPal WPS, I almost decided against committing since hook_form_alter() would suffice to customize the form. However, we have hooks like this for other types of payment API requests, so may as well do it here. Additionally, this will allow us to support WPS form encryption at a later date where altering the generated form data would prove impossible without this hook.

rszrama’s picture

Title: Add ability for custom API data to be passed to PayPal » Allow PayPal WPS order form data to be altered prior to form creation

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.