简体   繁体   English

Paypal ios SDK即使调用[PayPalMobile clearAllUserData]也不会清除以前使用的信用卡

[英]Paypal ios SDK not clearing previously used credit cards even after call to [PayPalMobile clearAllUserData]

I'm integrating Paypal ios SDK version 2.1 into my app but have run into a problem. 我正在将Paypal ios SDK版本2.1集成到我的应用程序中,但是遇到了问题。 The SDK seems to keep past payment cards in memory even though i call [PayPalMobile clearAllUserData] after the payment has been completed. 即使付款完成后我调用[PayPalMobile clearAllUserData] ,SDK似乎[PayPalMobile clearAllUserData]过去的付款卡保留在内存中。

@interface AirliftCartViewController : AirliftViewController <AVCaptureMetadataOutputObjectsDelegate, UITableViewDelegate, AirliftCartTotalsChangeDelegate, PayPalPaymentDelegate>
    @property (strong) AVCaptureSession * captureSession;
    @property (strong, nonatomic) UIView *cameraPreview;
    @property (nonatomic, strong, readwrite) PayPalConfiguration *payPalConfiguration;
    - (IBAction)initiateCreditCardCheckout:(id)sender;
@end
...
@implementation AirliftCartViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil timeout:(NSUInteger)timeoutInSeconds screenName:(NSString *)screenName
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil timeout:timeoutInSeconds screenName:@"AirliftCartView"];
    if (self) {
        // Custom initialization
        self.payPalConfiguration = [[PayPalConfiguration alloc] init];
        self.payPalConfiguration.rememberUser = NO;
    }

    return self;
}



- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController
{
    NSLog(@"payment cancelled!");
    // The payment was canceled; dismiss the PayPalPaymentViewController.
    [paymentViewController dismissViewControllerAnimated:YES completion:^{
        // clear all paypal user information
        [PayPalMobile clearAllUserData];
    }];
}

- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment
{
    NSLog(@"Payment was successful");
    // Payment was processed successfully; send to server for verification and fulfillment.
    [self verifyCompletedPayment:completedPayment];

    // Dismiss the PayPalPaymentViewController.
    [paymentViewController dismissViewControllerAnimated:YES completion:^{

    // clear all paypal user information
    [PayPalMobile clearAllUserData];

    // emptycart
    [self.cartController emptyCart];

    // reset metadata
    [self.metaDataFound removeAllObjects];

}

- (IBAction)initiateCheckout:(id)sender {
    NSLog(@"checkout requested!");
    [PayPalMobile preconnectWithEnvironment:PayPalEnvironmentSandbox];

    // present paypal payment
    PayPalPaymentViewController * payPalVC = [[PayPalPaymentViewController alloc]
                                          initWithPayment:[self.cartController getPayPalPaymentFromCart]
                                          configuration:self.payPalConfiguration delegate:self];

    [self presentViewController:payPalVC animated:YES completion:^{
        [self.captureSession stopRunning];
        [self.cameraPreview removeFromSuperview];
    }];
}


@end

I present the PayPalPaymentViewController like this (so there's no strong reference to it that i can tell) 我以这种方式显示PayPalPaymentViewController(因此我无法说出对此的强烈引用)

Its not acceptable that any card information is kept retained for my app, any ideas anyone? 将任何卡信息保留为我的应用程序保留任何想法是不可接受的吗?

Edit: Adding user steps as requested: 编辑:根据要求添加用户步骤:

  • the user selects products to buy and then clicks on checkout button which has initiateCheckout as its Action. 用户选择要购买的产品,然后单击以initialCheckout作为其操作的结帐按钮。
  • this brings up the paypalpaymentviewcpntroller which shows the previously used card as the only payment option (the first time I launch the controller provides a choice of either logging into paypal or using a card) 这会弹出paypalpaymentviewcpntroller,它将先前使用的卡显示为唯一的付款选项(我第一次启动控制器时,可以选择登录Paypal或使用卡)

Edit 2: Added property declarations for captureSession and cameraPreview and expanded init definition 编辑2:为captureSessioncameraPreview添加了属性声明,并扩展了init定义

Edit 3: Added screenshots 编辑3:添加了屏幕截图

初始结帐第二次结帐

Dave from PayPal here. Dave来自PayPal。

A few questions: 几个问题:

(1) What's going on with your captureSession and cameraPreview ? (1)您的captureSessioncameraPreview怎么cameraPreview

(2) Could you please provide a series of specific steps, from the user's perspective, that reproduce your problem? (2)您能否从用户角度提供一系列重现您的问题的特定步骤?

(3) What is the indication that the SDK is keeping card data in memory? (3)这表示SDK正在将卡数据保留在内存中?

(4) Which version of the SDK are you running? (4)您正在运行哪个版本的SDK? I'm guessing that it's the one of the most recent versions, 2.1.5 or 2.1.6? 我猜它是2.1.5或2.1.6的最新版本之一?

* EDIT (1 August 2014): The originally described bug has been fixed in our latest release . *编辑(2014年8月1日):最初描述的错误已在我们的最新版本中修复。 * *

您还可以在PayPalConfiguration https://github.com/paypal/PayPal-iOS-SDK/blob/master/PayPalMobile/PayPalConfiguration.h#L57中设置remeberUser = NO,这样SDK甚至不会尝试保存任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM