Git Product home page Git Product logo

gosell-jslib-documentation's Introduction

Table of Contents

Brief Description

goSell Payment Gateway accepts online payments. You can integrate with it in a different way based on your app's specifications.

The new version of goSell Payment Gateway provides:

goSell Checkout: It's a simple way to integrate goSell with a few client side code.

goSell Checkout includes two different integrations based on your preferences:

  • goSell LightBox: open a light box / modal dialog inside your store.

  • goSell Payment Page: open goSell payment gateway directly without server side code or making any REST API Requests.

goSell Elements: two-step process, with a client-side and a server-side actions. goSell securely will collect your customer’s payment information and returns a card token, then your server-side code can make an API request from the available REST APIs on https://tap.company/developers to complete the process based on your needs (by create a charge / authorize or saving the customer card).

Demo

https://jslib.gosell.io/demo/

Documentations

Author

gosell-jslib-documentation's People

Contributors

ali-tap avatar halaq avatar osamarabie avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

gosell-jslib-documentation's Issues

error modal doesn't close

Hello, when I'm trying to use the live publicKey from localhost or http I get an error like that:
code: "2110"
description: "goSell integrations must use HTTPS. You’re using live public key, which should be used with ssl certificate."
I'm okay with that. Problem is: that modal doesn't close ( close "إغلاق" button does nothing )

Screen Shot 2021-09-16 at 12 25 06 PM

Can anyone please tell me what to or what did I do wrong?
@halaq
Thanks.

Saving the charge id before redirection

We need to save the charge id at the beginning of the payment process before redirecting to the 3D-secure page.
We tried using the callback function but apparently that's intended for after the payment is completed and the user is redirected back to the redirect URL.

Is there a way to obtain the charge id before redirecting the user to the 3D-secure page?
Ideally, there would be a callback function the library returns the charge object to after the user enters their card details and clicks on pay in the case of goSell.openLightBox(), then we can save the charge id and redirect the user to the 3D-secure URL (transaction.url)

Integration with Nextjs

Hey Tap team,

I've tried to integrate your package with our Nextjs application however I've come across this issue by importing GoSell import { GoSell } from "@tap-payments/gosell";

Screen Shot 2021-04-14 at 14 59 25

Does your package not work well with SSR? any pointers would be very much appreciated.

Error: getaddrinfo ENOTFOUND api.tap.company api.tap.company:443

While using @tap-payments/gosell checkout module,it gives us tap_id in URL while we are sending get request using this URL = (https://api.tap.company/v2/charges/tap_id) to get response.
const response = await axios.get('https://api.tap.company/v2/charges/' + tap_id, {
headers: {
'Authorization': 'Bearer sk_test_xxx'
}
})
Following error has been occured in IIS Server using Nodejs library and template engine (Ejs);

Error: getaddrinfo ENOTFOUND api.tap.company api.tap.company:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

How to display the value of callback in a page

Hello.
I just want to ask on how to display the callback value on the webpage, not in the console after the payment is successful?

    goSell.showResult({
       callback: response => {
       console.log("callback", response);
      }
    });

For example display the following in the redirect page:
Customer Name, Email, Phone, Amount, Etc.

webpack v5 not supported

webpack v5 doesn't support polyfills.

since packages like create-react-app already upgraded to webpack v5 whoever that is trying to use @tap-payments/gosell in their website cannot do so.

can you please move away from polyfills.
i had to upgrade to webpack v5 and after downgrading it has a conflict with core-js.

Server Error in '/test_gosell/v2' Application.

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /test_gosell/v2/payment/undefined

The browser path, https://sandbox.payments.tap.company/test_gosell/v2/payment/undefined?

I am getting this error while testing all payments types, after I fill in the card information and finish the transactions.

Getting 2106 error code after payment

We have tried to make the payment in our local environment and your demo, but every time we got a 2106 error code. We used charge mode, and we tried the public key that you gave and the one in the documentation, in both cases we had the same result. We used 5123450000000008 card number in the test with 01/39 ex and 100 cvv

MarketPlace Key

Hello,
Hope you are doing well,
I am trying to integrate with your payment.
I want to create a marketplace and create businesses in my marketplace.
your docs are very useful, yet I can not obtain the Marketplace Keys.
I asked the support team in the chat for these keys and they refer me to the documentation page.
In the documentation:

You have to request for a test marketplace account to Tap. Tap will create a Marketplace account for your business and share two sets of credentials. One for creating businesses, and another for performing transactions.

Am I missing something or doing something wrong?
When I try to add a new business with my Keys that in Tab dashboard. it response with 401
{ "status": "fail", "type": "api_key_not_authorized", "message": "Api key is unauthorized to perform the operation" }
Thanks.
How can I create a Marketplace account?

Add onLoad props in react version

I did read your documentation carefully and i noticed that there's isn't anything tells me that your checkout component is loaded because i did face an issue when i try to call your component and it only shows loading indicator then i noticed that you console a value (hey loaded) whenever the component is ready
Tap
FYI i modified your code but in a bad way to solve this issue

Lightbox double scroll

Screen Shot 2020-11-19 at 9 32 05 AM

When adding alot of products or some products with long names, a second scroll appear. How can we fix this?

Callback on dialog closed when using openLightBox

Usage

<body onload="goSell.openLightBox()">

<script th:inline="javascript">
  goSell.config({
        containerID: "root",
        gateway: {
            publicKey: "pk_test_Vlk842B1EA7tDN5QbrfGjYzh",
            language: "en",
            contactInfo: true,
            supportedCurrencies: ["USD"],
            supportedPaymentMethods: "all",
            saveCardOption: false,
            customerCards: true,
            notifications: 'standard',
            callback:function(response)  {
                console.log('callBack', response);
            },
            onClose:function ()  {
                console.log("onClose Event");
            },
            backgroundImg: {
                url: 'imgURL',
                opacity: '0.5'
            },
            style: {
                base: {
                    color: '#0061ff',
                    lineHeight: '18px',
                    fontFamily: 'sans-serif',
                    fontSmoothing: 'antialiased',
                    fontSize: '16px',
                    '::placeholder': {
                        color: 'rgba(55,234,199,0.26)',
                        fontSize: '15px'
                    }
                },
                invalid: {
                    color: 'red',
                    iconColor: '#fa755a '
                }
            }
        },

        order: {
            amount: 100,
            currency: "USD",
            shipping: null,
            taxes: null
        },
        transaction: {
            mode: 'charge',
            charge: {
                saveCard: false,
                threeDSecure: true,
                description: "Checkout",
                statement_descriptor: "Order descriptor",
                reference: {
                    transaction: "",
                    order: ""
                },
                metadata: {},
                receipt: {
                    email: false,
                    sms: false
                },
                redirect: "",
                post: null,
            }
        }
    });

</script>


Problem

onClose function property not getting called when dialog close is triggered

Expected result

onClose function property (or any other callback) get called when the dialog is closed

Trying to find callback through inspect element

UIStore.js closeNotification function not triggering any callback function, I may be wrong, lines 64 - 74:


  closeNotification(){
    var self = this;

    if(self.delete_card === null && self.errorHandler.options == null) {
      this.errorHandler.visable = false;
      setTimeout(function(){
        self.errorHandler = {};
      },
      500);
    }
  }



Cannot call a class as a function

I followed the example exactly and created a class component (TapCardForm) to render the GoSellElements component. When using TapCardForm inside of functional component I get this error

Cannot call class as a function

getting error in React

whenever i import the react component i get this error

./node_modules/@babel/polyfill/lib/noConflict.js
Module not found: Can't resolve 'core-js/modules/web.url' in 'E:\production\project78\node_modules@babel\polyfill\lib'

goSell + TypeScript (TSX) 2119 error code

Hi,

Im using the gosell lib by including the script tag in the html file but I cannot call goSell.config or any other goSell functions within the typescript application because they are not defined there.

I tried to work through this by defining a window function

window.goSellConfig = function(config) {
      goSell.config(config);
};

and the same with the lightbox function and they seem to fire but the generate api request body has an empty customer object even when it is not empty. (I console.log it before calling goSell.config).

I get this response from the config-log api call:

{
   "status":200,
   "message":{
      "public_key":"pk_test_Zt5PqCwbBRsAIJcHXLE84UVh",
      "error_code":"2119",
      "error_msg":"Something went wrong! Please check the customer details",
      ...
      ...
      "backend_session_token":"5f3aa2ae01896800d4116a53",
      "created_at":"2020-08-17T15:30:56.301Z",
      "time_zone":"8/17/2020, 6:30:56 PM",
      ...
   }
}

What's confusing is two things:

  • The fact that the customer object is not empty but gets sent as empty.
  • "error_code":"2119" which is not preset here under Response Codes --> Error Codes.

Test Card Numbers are not working

Hello there,
I am trying to test my integration but when I test the cards in Cards Number
it gives me this error
response: { code: '503', message: 'Declined, 3D Security - Incorrect' }, acquirer: { response: { code: '?', message: '901' } },
i test it with all the cards, still getting 503 as response code.
any idea how to make a valid testing payment?
thnks

Test cards have expired.

CleanShot 2022-10-20 at 21 29 16

The key test cards (for successful payments) have expired which makes testing impossible.

Had to contact support to get a working test card, so docs need updating.

They advised using 01/39, for example:

4508750015741019
01/39
cvv: 100

How to setup Apple Pay for web?

Hi,

I need some help on "Apple Pay" integration for the website payment page. I've tried supportedPaymentMethods = ["Apple Pay"] or "all" but it does not show the Apple pay button.
I've tested on iPhone 6s safari browser from India. Here is demo code I'm following

`

<title>goSell Demo</title> <script type="text/javascript" src="https://goSellJSLib.b-cdn.net/v1.4.1/js/gosell.js"></script>
<div id="root"></div>
<button id="openLightBox" onclick="goSell.openLightBox()">open goSell LightBox</button>
<button id="openPage" onclick="goSell.openPaymentPage()">open goSell Page</button>

<script>

goSell.config({
  containerID:"root",
  gateway:{
    publicKey:"pk_test_Vlk842B1EA7tDN5QbrfGjYzh",
    language:"en",
    contactInfo:true,
    supportedCurrencies:"all",
    supportedPaymentMethods: "all",
    saveCardOption:false,
    customerCards: true,
    notifications:'standard',
    callback:(response) => {
        console.log('response', response);
    },
    onClose: () => {
        console.log("onClose Event");
    },
    labels:{
        cardNumber:"Card Number",
        expirationDate:"MM/YY",
        cvv:"CVV",
        cardHolder:"Name on Card",
        actionButton:"Pay"
    }
  },
 transaction:{
   mode: 'token'
 }
});

</script>
`

err_http2_protocol_error

error ocurred some times in

<script type="text/javascript" src="https://goSellJSLib.b-cdn.net/v1.6.1/js/gosell.js"></script>

err_http2_protocol_error

Installation requires private package

Hello!

I try to install goSell lib, but npm i @tap-payments/gosell says:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@tap-payments%2floader - Not found
npm ERR! 404 
npm ERR! 404  '@tap-payments/loader@^1.0.14' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@tap-payments/gosell'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Can you publish @tap-payments/loader to npm too?

There is also reference to npm i @tap-payments/goSell and because npm is case-sensitive it can't find the package. It looks to me like these packages are the same (at least the CDN address is the same). I can make a PR with this tiny fix.

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.