iOS Paypal Mobile SDK - Proof of Payment

467 Views Asked by At

i integrated the Paypal Mobile SDK for iOS in my App.

In the delegate Methode completePayment i get this json:

CurrencyCode: EUR
Amount: 39.95
Short Description: Michaels Test
Intent: sale
Processable: Already processed
Display: €39.95
Confirmation: {
    client =     {
        environment = mock;
        "paypal_sdk_version" = "2.12.3";
        platform = iOS;
        "product_name" = "PayPal iOS SDK";
    };
    response =     {
        "create_time" = "2015-10-29T13:18:02Z";
        id = "PAY-NONETWORKPAYIDEXAMPLE123";
        intent = sale;
        state = approved;
    };
    "response_type" = payment;
}
Details: (null)
Shipping Address: (null)
Invoice Number: (null)
Custom: (null)
Soft Descriptor: (null)
BN code: (null)

It says successfully created. But when look at my dashboard in developer.paypal.com i can't see any transactions. For environment i use the paypal-sandbox.

In the documentation it says i have to use the rest-api to verify the immediate payment: https://developer.paypal.com/docs/integration/mobile/verify-mobile-payment/

So do i need a backendservice that verifies my payment that was created from the client or what do i have to do at this point?

Thx, Michael

1

There are 1 best solutions below

3
On BEST ANSWER

Login with your Sandbox Account here... Sandbox Paypal Site. You will be able to see transactions made on Sandbox Envirronment on sandbox site of the paypal.

Looking at your confirmation message, you are running your app in PayPalEnvironmentNoNetwork mode.

/// Production (default): Normal, live environment. Real money gets moved.
/// This environment MUST be used for App Store submissions.
extern NSString *const PayPalEnvironmentProduction;
/// Sandbox: Uses the PayPal sandbox for transactions. Useful for development.
extern NSString *const PayPalEnvironmentSandbox;
/// NoNetwork: Mock mode. Does not submit transactions to PayPal. Fakes successful responses. Useful for unit tests.
extern NSString *const PayPalEnvironmentNoNetwork;

You need to run your app in SandBox Environment. Get YOUR_CLIENT_ID_FOR_SANDBOX and initialize your PayPal with it.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  [PayPalMobile initializeWithClientIdsForEnvironments:@{PayPalEnvironmentSandbox : @"YOUR_CLIENT_ID_FOR_SANDBOX"}];
  return YES;
}

You will then be able to see transactions in the above linked site.