paypay / paypayopa-sdk-node

With PayPay's Payment SDK, you can build a custom Payment checkout process to suit your unique business needs and branding guidelines
http://developer.paypay.ne.jp/
Apache License 2.0
35 stars 17 forks source link

Custom endpoint url #500

Closed terrierscript closed 2 years ago

terrierscript commented 2 years ago

Is your feature request related to a problem? Please describe. In some case (e.g. testing, proxy), we need to set custom SDK endpoint but this SDK cannot set this.

Describe the solution you'd like In python-sdk, we can set custom endpoint url with base_url option. https://github.com/paypay/paypayopa-sdk-python/blob/7074930f4bf1700b0dc53a41fb1fff700cbdec32/paypayopa/client.py#L77-L79

Describe alternatives you've considered If you append PayPayRestSDK.setConfig interface, we can change endpoint like (PayPayRestSDK.setHttpsClient)

Additional context

curtisfennerpaypay commented 2 years ago

SDK version 2.1.0 was released with an updated Configure method.

You can use it to set a custom host name and port for the SDK:

const PAYPAY = require('@paypayopa/paypayopa-sdk-node');
PAYPAY.Configure({
    // Use custom base url and port
    conf: new PAYPAY.Conf({ hostName: "stg-api.sandbox.paypay.ne.jp", portNumber: 443 }),

    // Specify your sandbox API key and sandbox API secret.
    clientId: API_KEY,
    clientSecret: API_SECRET,
});