chesscoders / netopia-card

Lightweight NodeJS library to integrate Netopia mobilPay payment gateway in your projects
https://npmjs.com/package/netopia-card
MIT License
7 stars 2 forks source link

Expose language config constructor #16

Closed 0x963D closed 2 weeks ago

0x963D commented 4 weeks ago

Hello guys,

Great work with the package, its working like a charm! One question/request: is it possible to access or expose the language config setting which is defaulted to "ro" at the moment:

this.config = { language: 'ro' };

I would like to customize the checkout experience for each client based on his preferred language.

All the best, Dan

mihai-dulgheru commented 2 weeks ago

Hello Dan,

Thank you for your kind words and for using our package!

We’re happy to inform you that we’ve implemented your requested functionality. Starting with version 2.1.1, you can now customize the language setting for the checkout experience.

By default, the language is still set to "ro", but you can now easily override this by passing the language parameter when initializing the Netopia instance. Here's how you can do it:

const netopia = new Netopia({
  apiKey: 'your-api-key',
  notifyUrl: 'https://your-notify-url',
  posSignature: 'your-pos-signature',
  redirectUrl: 'https://your-redirect-url',
  language: 'en', // Set the language to 'en' or any other supported language
});

We hope this enhancement helps you tailor the checkout experience to your client's preferences.

All the best, Mihai

0x963D commented 2 weeks ago

Hello Mihai,

Thank you so much, I appreciate your work to get this published! I've just deployed it to production and its working as expected.

All the best, Dan