Search code examples
androidpaymentadyen

How to find out my Adyen token?


I'm trying out Adyen for mobile payments and got stuck on step 1...

I made a demo activity with a button that will launch the PaymentActivity. Here's some code to elaborate:

    btnCheckout = (Button) findViewById(R.id.btn_checkout);
    btnCheckout.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            CheckoutRequest checkoutRequest = new CheckoutRequest();
            try {
                checkoutRequest.setBrandColor(R.color.adyen_green);
                checkoutRequest.setBrandLogo(R.drawable.pay_button);
                checkoutRequest.setCheckoutAmount(1.01f);
                checkoutRequest.setCurrency(Currency.EUR);
                //checkoutRequest.setToken(your_token);
                checkoutRequest.setToken("thisISmyToken");
                checkoutRequest.setTestBackend(true);//default is set to false. Set it to true if you want to use Adyen's test back-end.

                Intent intent = new PaymentActivity.PaymentActivityBuilder(checkoutRequest).build(MainActivity.this, getBaseContext());
                startActivity(intent);
            } catch (CheckoutRequestException e) {
                Log.e("SHARK", e.getMessage(), e);
            }
        }
    });

how and where exactly do I find out this your_token ? I've read about finding it under CA -> Settings/Users but.... I don't see a token I should use anywhere. and I lost the link as well :/

Please, kindly help as I can't even try out the sample code without the token.


Solution

  • After contacting support and messing around, I realized I was an idiot.

    The easiest way to do it is, quoting from the support email:

    The token can be found via:

    Settings >> Users >> System Users >> Click on the 'ws' user. You will find the link to the library:

    https://test.adyen.com/hpp/cse/js/1234567890123456.shtml

    So your token is: 1234567890123456

    It's the link that has a "Copy" button next to it.