Set the locale in the correct communication with PayPal.

This commit is contained in:
Colin Kuskie 2011-06-06 10:48:20 -07:00
parent 3c0cf0f1a5
commit e2a218e6f5

View file

@ -191,7 +191,6 @@ PayPal API spit back.
sub processPayment {
my ( $self, $transaction ) = @_;
my $i18n = WebGUI::International->new($self->session);
my $form = $self->payPalForm(
METHOD => 'DoExpressCheckoutPayment',
PAYERID => $self->session->form->process('PayerId'),
@ -199,7 +198,6 @@ sub processPayment {
AMT => $self->getCart->calculateTotal,
CURRENCYCODE => $self->get('currency'),
PAYMENTACTION => 'SALE',
LOCALECODE => $i18n->getLanguage->{locale},
);
my $response = LWP::UserAgent->new->post( $self->apiUrl, $form );
my $params = $self->responseHash($response);
@ -272,12 +270,14 @@ sub www_sendToPayPal {
my $url = $session->url;
my $base = $url->getSiteURL . $url->page;
my $i18n = WebGUI::International->new($self->session);
my $returnUrl = URI->new($base);
$returnUrl->query_form( {
shop => 'pay',
method => 'do',
do => 'payPalCallback',
paymentGatewayId => $self->getId,
LOCALECODE => $i18n->getLanguage->{locale},
}
);