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