public function PayPalPaymentECPaymentMethodController::paymentNVP in PayPal for Payment 7
Returns NPV variables for a Payment.
Parameters
Payment $payment:
Return value
array
2 calls to PayPalPaymentECPaymentMethodController::paymentNVP()
- PayPalPaymentECPaymentMethodController::doExpressCheckoutPayment in paypal_payment_ec/
includes/ PayPalPaymentECPaymentMethodController.inc - Executes a checkout.
- PayPalPaymentECPaymentMethodController::setExpressCheckout in paypal_payment_ec/
includes/ PayPalPaymentECPaymentMethodController.inc - Sets up a PayPal payment.
File
- paypal_payment_ec/
includes/ PayPalPaymentECPaymentMethodController.inc, line 242
Class
- PayPalPaymentECPaymentMethodController
- A PayPal Express Checkout payment method.
Code
public function paymentNVP(Payment $payment) {
$currency = currency_load($payment->currency_code);
$amount = $currency
->roundAmount($payment
->totalAmount(TRUE));
return array(
'PAYMENTREQUEST_0_CURRENCYCODE' => $payment->currency_code,
'PAYMENTREQUEST_0_AMT' => $amount,
'PAYMENTREQUEST_0_PAYMENTACTION' => $payment->method->controller_data['capture'],
'PAYMENTREQUEST_0_DESC' => $payment->description,
'PAYMENTREQUEST_0_INVNUM' => PayPalPaymentIPNController::invoiceID($payment->pid),
'PAYMENTREQUEST_0_NOTIFYURL' => PayPalPaymentIPNController::URL(),
);
}