iOS 贝宝移动 SDK - 付款证明

iOS Paypal Mobile SDK - Proof of Payment

我在我的应用程序中集成了 iOS 的 Paypal 移动 SDK。

在委托 Methode completePayment 中我得到这个 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)

提示创建成功。但是当在 developer.paypal.com 中查看我的仪表板时,我看不到任何交易。 对于环境,我使用 paypal-sandbox。

在文档中它说我必须使用 rest-api 来验证即时付款:https://developer.paypal.com/docs/integration/mobile/verify-mobile-payment/

那么我是否需要一个后端服务来验证我从客户端创建的付款或者此时我必须做什么?

谢谢, 迈克尔

在此处使用您的 Sandbox 帐户登录...Sandbox Paypal Site。您将能够在 paypal 的沙盒网站上看到在沙盒环境中进行的交易。

查看您的确认消息,您正在 运行在 PayPalEnvironmentNoNetwork 模式下安装您的应用程序。

/// 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;

您需要在 SandBox 环境中 运行 您的应用。获取 YOUR_CLIENT_ID_FOR_SANDBOX 并用它初始化你的 PayPal

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

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

然后您将能够在上面的链接站点中看到交易。