Commit 03bb3d39 authored by rszrama's avatar rszrama

Properly identify the payment application for PayPal Payments Standard and Pro transactions.

parent 1f72e060
......@@ -67,6 +67,7 @@ function commerce_paypal_wpp_commerce_payment_method_info() {
'short_title' => t('PayPal WPP'),
'display_title' => t('Credit card'),
'description' => t('PayPal Website Payments Pro'),
'buttonsource' => 'CommerceGuys_Cart_PPP',
);
return $payment_methods;
......@@ -313,6 +314,7 @@ function commerce_paypal_wpp_submit_form_submit($payment_method, $pane_form, $pa
'METHOD' => 'DoDirectPayment',
'PAYMENTACTION' => commerce_paypal_payment_action($payment_method['settings']['txn_type']),
'NOTIFYURL' => commerce_paypal_ipn_url($payment_method['instance_id']),
'BUTTONSOURCE' => $payment_method['buttonsource'],
'CREDITCARDTYPE' => commerce_paypal_wpp_card_type($pane_values['credit_card']['type']),
'ACCT' => $pane_values['credit_card']['number'],
......
......@@ -20,6 +20,12 @@ function commerce_paypal_wps_commerce_payment_method_info() {
'terminal' => FALSE,
'offsite' => TRUE,
'offsite_autoredirect' => TRUE,
// Because the order form generation code does not have access to a payment
// method info array, we set the bn directly there instead of making use of
// this buttonsource variable. It's here for consistency with other payment
// methods in this package.
'buttonsource' => 'CommerceGuys_Cart_PPS',
);
return $payment_methods;
......@@ -190,6 +196,9 @@ function commerce_paypal_wps_redirect_form($form, &$form_state, $order, $payment
// Specify the current payment method instance ID in the notify_url
'payment_method' => $payment_method['instance_id'],
// Include the application indicator
'bn' => $payment_method['buttonsource'],
);
return commerce_paypal_wps_order_form($form, $form_state, $order, $payment_method['settings'] + $settings);
......@@ -419,6 +428,9 @@ function commerce_paypal_wps_order_form($form, &$form_state, $order, $settings)
// The path PayPal should send the IPN to
'notify_url' => commerce_paypal_ipn_url($settings['payment_method']),
// The application generating the API request
'bn' => 'CommerceGuys_Cart_PPS',
// Set the correct character set
'charset' => 'utf-8',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment