iOS Paypal Mobile SDK - 付款证明

时间:2015-10-29 13:48:55

标签: ios paypal paypal-rest-sdk paypal-mobile-sdk

我在我的应用程序中集成了适用于iOS的Paypal Mobile 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/

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

THX, 迈克尔

1 个答案:

答案 0 :(得分:0)

在此处使用您的沙盒帐户登录... Sandbox Paypal Site。您将能够在PayPal的沙盒网站上查看Sandbox Env​​irronment上的交易。

查看确认消息,您正在以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;
}

然后,您就可以在上述链接网站中查看交易。