Search code examples
androidpaypalpayment-gatewaypaypal-sandbox

What is the PaymentActivity.EXTRA_CLIENT_ID in the Paypal integration development


What i am doing ,

simply i am copying code from the https://developer.paypal.com/webapps/developer/docs/integration/mobile/android-integration-guide/ site .

Intent intent = new Intent(this, PaymentActivity.class);
intent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, PaymentActivity.ENVIRONMENT_NO_NETWORK);
intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, "");
intent.putExtra(PaymentActivity.EXTRA_PAYER_ID, "");
intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, "");
intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment);

For this i have created two accounts in the paypal , one for receiver second for sandbox test account ( because i am developing an app and using this id ) So , after implmenting this , i have got , with the help of tushar.2april@gmail.com).

Receiver account :

with the help of tushar.pandey1991@gmail.com

Sandbox account :

After login with tushar.2april@gmail.com i have created business and personal account .

iam2ndstan@yahoo.com ( personal account )

tushar.2april-facilitator@gmail.com (business account )

Problem , what i am facing :

in which basis i define

:- PaymentActivity.EXTRA_CLIENT_ID

:-``PaymentActivity.EXTRA_PAYER_ID

PaymentActivity.EXTRA_RECEIVER_EMAIL : `tushar.pandey1991@gmail.com'

:- if i am attempting any hit & try and after it i am getting Json also enter image description here

:- i will Email ( for proof ) automatically or i have to implement the code for it .

Edited Section :

07-01 17:35:09.068: I/dalvikvm(841): Could not find method android.app.Activity.getActionBar, referenced from method com.paypal.android.sdk.C.a
07-01 17:35:09.068: W/dalvikvm(841): VFY: unable to resolve virtual method 8: Landroid/app/Activity;.getActionBar ()Landroid/app/ActionBar;
07-01 17:35:17.608: I/dalvikvm(841): Could not find method android.view.View.setBackground, referenced from method com.paypal.android.sdk.af.a
07-01 17:35:17.608: W/dalvikvm(841): VFY: unable to resolve virtual method 311: Landroid/view/View;.setBackground (Landroid/graphics/drawable/Drawable;)V
07-01 17:35:36.598: W/KeyCharacterMap(841): No keyboard for id 0
07-01 17:35:36.598: W/KeyCharacterMap(841): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
07-01 17:35:49.257: I/dalvikvm(841): Jit: resizing JitTable from 512 to 1024
07-01 17:36:19.308: I/paymentExample(841): {
07-01 17:36:19.308: I/paymentExample(841):     "payment": {
07-01 17:36:19.308: I/paymentExample(841):         "short_description": "hipster jeans",
07-01 17:36:19.308: I/paymentExample(841):         "amount": "8.75",
07-01 17:36:19.308: I/paymentExample(841):         "currency_code": "USD"
07-01 17:36:19.308: I/paymentExample(841):     },
07-01 17:36:19.308: I/paymentExample(841):     "client": {
07-01 17:36:19.308: I/paymentExample(841):         "platform": "Android",
07-01 17:36:19.308: I/paymentExample(841):         "paypal_sdk_version": "1.0.2",
07-01 17:36:19.308: I/paymentExample(841):         "product_name": "PayPal Android SDK; ",
07-01 17:36:19.308: I/paymentExample(841):         "environment": "mock"
07-01 17:36:19.308: I/paymentExample(841):     },
07-01 17:36:19.308: I/paymentExample(841):     "proof_of_payment": {
07-01 17:36:19.308: I/paymentExample(841):         "adaptive_payment": {
07-01 17:36:19.308: I/paymentExample(841):             "timestamp": "2013-07-01T12:06:11+0000",
07-01 17:36:19.308: I/paymentExample(841):             "payment_exec_status": "COMPLETED",
07-01 17:36:19.308: I/paymentExample(841):             "app_id": "_FAKE_APPLICATION_ID_",
07-01 17:36:19.308: I/paymentExample(841):             "pay_key": "AP-70M68096ML426802W"
07-01 17:36:19.308: I/paymentExample(841):         }
07-01 17:36:19.308: I/paymentExample(841):     }
07-01 17:36:19.308: I/paymentExample(841): }

Solution

  • Intent intent = new Intent(this, PaymentActivity.class);
    intent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, PaymentActivity.ENVIRONMENT_SANDBOX);
    intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, "");
    intent.putExtra(PaymentActivity.EXTRA_PAYER_ID, "");
    intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, ""); 
    intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment);
    

    EXTRA_PAYER_ID : means , who will get the transferred money from your account ( buyers , your personal account ) .

    EXTRA_CLIENT_ID : generated , from the website when you are creating an app , and registering it there in the web .

    EXTRA_RECEIVER_EMAIL : means , business account of yours .

    enter image description here