diff --git a/modules/wps/commerce_paypal_wps.module b/modules/wps/commerce_paypal_wps.module index 0e17f5c28..16885ec0a 100644 --- a/modules/wps/commerce_paypal_wps.module +++ b/modules/wps/commerce_paypal_wps.module @@ -136,7 +136,7 @@ function commerce_paypal_wps_payment_refund_qualify($transaction) { return FALSE; } - // Return FALSE if it is more than 30 days past the order payment. + // Return FALSE if it is more than 120 days past the order payment. if (REQUEST_TIME - $transaction->created > 86400 * 120) { return FALSE; } @@ -515,7 +515,7 @@ function commerce_paypal_wps_paypal_ipn_process($order, $payment_method, &$ipn) // Looks like this is first transaction for this series // then, need to create new transaction - if (!$transaction) { + if (empty($transaction)) { // Create a new payment transaction for the order. $transaction = commerce_payment_transaction_new('paypal_wps', $order->order_id); $transaction->instance_id = $payment_method['instance_id']; @@ -525,9 +525,10 @@ function commerce_paypal_wps_paypal_ipn_process($order, $payment_method, &$ipn) if ($ipn['payment_status'] !== 'Refunded') { $transaction->amount = commerce_currency_decimal_to_amount($ipn['mc_gross'], $ipn['mc_currency']); $transaction->remote_id = $ipn['txn_id']; - $transaction->currency_code = $ipn['mc_currency']; } + $transaction->currency_code = $ipn['mc_currency']; + $transaction->payload[REQUEST_TIME . '-ipn'] = $ipn; // Set the transaction's statuses based on the IPN's payment_status. @@ -909,6 +910,7 @@ function commerce_paypal_wps_payment_refund($transaction, $amount = NULL, $order 'METHOD' => 'RefundTransaction', 'TRANSACTIONID' => $transaction->remote_id, 'AMT' => $amount, + 'CURRENCYCODE' => $transaction->currency_code, 'REFUNDTYPE' => $order_total_amount - $amount ? 'Partial' : 'Full', ); diff --git a/modules/wps/includes/commerce_paypal_wps.admin.inc b/modules/wps/includes/commerce_paypal_wps.admin.inc index fba2203b2..81de469a5 100644 --- a/modules/wps/includes/commerce_paypal_wps.admin.inc +++ b/modules/wps/includes/commerce_paypal_wps.admin.inc @@ -154,7 +154,7 @@ function commerce_paypal_wps_refund_form_validate($form, &$form_state) { // Ensure the amount is less than or equal to the payment amount. if ($amount > $form_state['default_amount']) { - form_set_error('amount', t('You cannot refund more than you payed through Paypal.')); + form_set_error('amount', t('You cannot refund more than you paid through Paypal.')); } // If the refund period has expired, display an error message and redirect.