paypal/PayPal-Cordova-Plugin

I can't see the payments in the sandbox

maxlinux2000 opened this issue · 8 comments

General information

  • SDK/Library version:3.4.0
  • Environment: sandbox
  • PayPal-Debug-ID values:
  • Platforms: android
  • Device OS Version and Device: android 6

Issue description

Help me to understand how this plugin works with paypal sandobox.

I've created a cordova app, which works fine and I can make payments on my account in sandbox environment.

To do this, I created an app in the Rest API section at: https://developer.paypal.com/developer/applications/

In the field "Sandbox account" I have a test account: max-facilitator@example.com

Then, I have taken the string from the "Client ID" field, to paste it into the javascript (in the sandbox variable of index.js) of my cordova app.

Now I can make payments from my app and apparently everything is going well.

But if I login in https://www.sandbox.paypal.com/ with the test account: max-facilitator@example.com, I can not see the payments.

Am I making a mistake? Do I have to see these payments elsewhere? Or this is a sandbox issues?

regards,
MaX

in the console inspector i can see:

payment success: {
    "client": {
        "environment": "mock",
        "paypal_sdk_version": "2.15.3",
        "platform": "Android",
        "product_name": "PayPal-Android-SDK"
    },
    "response": {
        "create_time": "2014-07-18T18:46:55Z",
        "id": "PAY-18X32451H0459092JKO7KFUI",
        "intent": "sale",
        "state": "approved"
    },
    "response_type": "payment"

Today I created another account in the sandbox, and another application of rest API.
The result is the same.
In the inspector's log, it tells me that payment has been made, but I can not see that in my account.

Your console output still says that the environment is mock and not sandbox.

What are you passing into function PayPalMobile.prepareToRender()?

mock? where can I change it?

I'm using as base the demo app https://github.com/romk1n/MyCordovaShop

changing the

    var clientIDs = {
      "PayPalEnvironmentProduction": "YOUR_PRODUCTION_CLIENT_ID",
      "PayPalEnvironmentSandbox": "AfVa--blablablablablabla-PS5"
    };

then

  createPayment: function() {
    var UserEmail = localStorage.getItem('useremail');
    var UserName = localStorage.getItem('username');
    var Number = localStorage.getItem('PedidoNum');
    var OrderList = localStorage.getItem('Pedido');
    var Total = localStorage.getItem('Tot');      
      
    // for simplicity use predefined amount
    var paymentDetails = new PayPalPaymentDetails("0.00", "0.00", "0.00");
    var payment = new PayPalPayment(Total, "EUR", "Order #" + Number , "Sale",
      paymentDetails);
    return payment;
  },

and finally I leave as founded the PayPalMobile.prepareToRender() function


  onPayPalMobileInit: function() {
    // must be called
    // use PayPalEnvironmentNoNetwork mode to get look and feel of the flow
    PayPalMobile.prepareToRender("PayPalEnvironmentNoNetwork", app.configuration(),
      app.onPrepareRender);
  },
  onUserCanceled: function(result) {
    console.log(result);
  }
};

Try PayPalMobile.prepareToRender("PayPalEnvironmentSandbox" instead of "PayPalEnvironmentNoNetwork",

Thats is!! It's works!! :)

Can I suggest to change the argument "PayPalEnvironmentNoNetwork" in something like "PayPalEnvironmentNoNetwork-MOCK" ?

So it's more easy to identify for the beginner, and according to paypal documentation

regards
MaX

I'm glad that worked for you. It might be worth adding a bit more to the docs about the environment options at least.