PayPal Checkout experience localizations

adam_richard
Contributor
Contributor

Hi, everyone,

Looks like /v2/checkout/orders from PHP Checkout SDK's OrdersCreateRequest object fails to set PayPal Checkout experience UI localization texts when returned from Smart Payment Button's createOrder server callback.

 

For reference, locale property of application_context object is setted as follow:

 

 

$request = new OrdersCreateRequest();

$request->body = [
    // ...
    
    'application_context' => [
        'user_action' => 'PAY_NOW'
        'shipping_preference' => 'NO_SHIPPING',
        // tested with 'en-US', 'es-ES' and 'pt-BR'
        'locale' => $UI_LANG_VARIABLE
    ]
];

$request->prefer('return=representation');
$response = $client->execute($request);

 

 

 

Button UI's texts respects locale query parameter tho.

Have anyone succeed to set locale dynamically? or ... maybe willing to suggest some insight about this?
Thanks, guys.

Login to Me Too
1 REPLY 1

1233fsdfsdg
Contributor
Contributor

I did it in Java SDK, no problem with it.

ApplicationContext applicationContext = new ApplicationContext().brandName(BRAND_NAME).landingPage(LANDING_PAGE)
.cancelUrl(cancelUrl).returnUrl(returnUrl).userAction(USER_ACTION).locale(locale)

 


Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.