Giter VIP home page Giter VIP logo

paymaya-js-sdk-v2's People

Contributors

antonimatusz avatar arkadiuszkrykm avatar barayantan avatar hubertursua avatar jhnferraris avatar jlpoklay avatar jorrelang avatar rjarce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

paymaya-js-sdk-v2's Issues

Invalid authentication credentials

image

still getting the issue even after the fix. I am using the script tags method to implement. This code works on sandbox mode but not in production. we already supplied the live API keys. even Android and iOS SDKs has this problem.

This is how I implemented on web, I am using vanilla JS for this.

 <script src="https://unpkg.com/[email protected]/dist/bundle.js"></script>

<script>
	$('#payMayaPay').click(function(){
		const myExampleObject = {
    "totalAmount": {
      "value": paymaya_pay_amount,
      "currency": "PHP",
    },
    "redirectUrl": {
      "success": paymaya_pay,
				"failure": payment_failed,
      "cancel": paymaya_expired
    },
    "requestReferenceNumber": refNum,
    "metadata": {}
  };
 PayMayaSDK.init('pk-live-apikey',false);
 PayMayaSDK.createSinglePayment(myExampleObject);
	})

</script>

Apply styles to iframe and it's content

Hello, everyone ๐Ÿ‘‹
Currently, as I see from documentation - there are a list of styles that I can apply to the button, when I use createCreditCardForm method (color, text color, text);

image

is it possible to allow customise whole form?
For example, in our case - we need to center a button, but we can't because of styles-limitations and we can't change styles inside embed iframe.

image

Thank you!

I can't install the addon using NPM

๐Ÿž Describe the Bug

Within the directory of my project, I was trying to run this command npm install --save paymaya-sdk. The addon was not installed successfully. I tried to install the addon using the npm command in different node versions but I am getting the same error below (Please see the image)
Screen Shot 2020-09-22 at 10 46 22 AM

๐Ÿ”ฌ Minimal Reproduction

Step 1 : cd to the app directory
Step 2: run npm install --save paymaya-sdk

๐Ÿ˜• Actual Behavior

The addon was not installed successfully. Tried in different node versions.

๐Ÿค” Expected Behavior

The addon should be able to install properly without error even the lower versions of node.

๐ŸŒ Environment

ember-cli: 2.6.2
node: [
node/8.11.1
node/8.12.0
node/10.20.1
node/12.0.0
node/12.14.0
]
os: darwin x64

โž• Additional Questions

Is there a possibility that this addon is able to run/use/install using the node version 8.11.1?

Invalid authentication credentials using live API keys

Hi. we followed the integration process using the SDK but upon using the live API keys, we are getting Unauthorized error (401). This is the response we are getting when testing the SDK. We already tried this on all five SDK APIs but to no avail (createCheckout, createWalletLink, createSinglePayment, addTransactionHandler, createCreditCardForm).

This is the response that we get.

POST https://pg-sandbox.paymaya.com/payby/v2/paymaya/link 401 (Unauthorized)
 {
       code: "K003"
       error: "Invalid authentication credentials. Kindly verify if the key you are using is correct."
       reference: "56510e27-30d5-47a6-897c-9adab17f6f33"
  }

seems we are still being redirected to sandbox link.?

This is how we implemented

  const myExampleObject = {
    "totalAmount": {
      "value": paymaya_pay_amount,
      "currency": "PHP",
    },
    "redirectUrl": {
      "success": paymaya_pay_url,
      "failure": payment_failed_url,
      "cancel": paymaya_expired_url
    },
    "requestReferenceNumber": refNum,
    "metadata": {}
  };
  PayMayaSDK.init('pk-our-live-api-key',false);
  PayMayaSDK.createSinglePayment(myExampleObject);

Callback for `addTransactionHandler` doesn't clear itself

I try to use createCreditCardForm within a vue.js component.
Once component mounted - we init PaymayaSDK, then createCreditCardForm and addTransactionHandlerwith a callback (which receive token and save it in DB).

The problem:

  • once we added a card we remove our component from DOM, but we can't clear callback that was added by library within createCreditCardForm method;
  • When we try to add another card, we again open a component, init PaymayaSDK, use createCreditCardForm and addTransactionHandler;
  • Our callback triggers more than 1 time, because previous listeners weren't removed.

Suggested solution:

  • after callback has beed called inside addTransactionHandler, remove old listener.
    public addTransactionHandler(callback: (arg: string) => void) {
        try {
            this.checkIfInitialized();
            this.checkData({}.toString.call(callback) === '[object Function]');
            window.addEventListener('message', (event) => {
                if (event.origin === this.eventOrigin) {
                    const data = JSON.parse(event.data);
                    callback(data.paymentTokenId);
                }
            });
        } catch (e) {
            console.error(e);
            console.error('SDK: addTransactionHandler(callback) - callback must be a function')
        }
    }

Blocked by CORS policy

Creating an app using Paymaya and works before using sandbox API keys. Suddenly, today i got blocked by CORS Policy with message

Access to fetch at 'https://pg-sandbox.paymaya.com/checkout/v1/checkouts' from origin 'http://jularbs.com:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

no code was changed. Is the error on my side or on paymaya?

Issue: problem on testing my own public api key

I have generated my API secret and public at Maya Business Dashboard - Checkout & Invoicing

So I cloned this project and see that you only use the Public Key so what i did is to test it out with my own public key, However it is giving me this kind of error in the console and won't let me proceed.

From URL: https://pg-sandbox.paymaya.com/checkout/v1/checkouts

{
    "error": "Invalid authentication credentials. Kindly verify if the key you are using is correct.",
    "code": "K003",
    "reference": "bdd5260f-f7ef-42a0-9472-dcdf757f6a35"
}

I wonder why the project redirecting me to v1 instead of v2 everytime i use my public key but if i keep the default or the project sample public key it is redirecting to this link: https://payments-web-sandbox.paymaya.com/v2/checkout?id=

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.