Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating SDK version its showing loader only #13

Open
parulgarg004 opened this issue May 31, 2022 · 10 comments
Open

After updating SDK version its showing loader only #13

parulgarg004 opened this issue May 31, 2022 · 10 comments

Comments

@parulgarg004
Copy link

parulgarg004 commented May 31, 2022

Simulator Screen Shot - iPhone 13 Pro Max - 2022-05-31 at 16 05 40

I have updated the SDK version and using objective-c. After reading the documentation everything is updated and code is compiling. But the issue is after getting token it keep on showing the initialisation part. Code part is also attached.
I'm attaching code snippet below:

` PayFortController *payFort = [[PayFortController alloc] initWithEnviroment:PayFortEnviromentSandBox];
payFort.presentAsDefault = UIModalPresentationFullScreen;
payFort.isShowResponsePage = YES;
[payFort setPayFortCustomViewNib:@"PayFortView"];
NSMutableDictionary request = [[NSMutableDictionary alloc] init];
[request setValue:[NSString stringWithFormat:@"%.0f",_orderPrice
100] forKey:kPayFortAmount];
[request setValue:vPayFortComandPurchace forKey:kPayFortComand];
[request setValue:vPayFortCurrencySAR forKey:kPayFortCurency];
[request setValue:CurrentUser.email forKey:kPayFortCustomerEmail];
if (layoutRTL) {
[request setValue:vPayFortLanguageArabic forKey:kPayFortLanguage];
}
else {
[request setValue:vPayFortLanguageEnglish forKey:kPayFortLanguage];
}
[request setValue:_orderId forKey:kPayFortOrderIdentifier];
[request setValue:sdkToken forKey:kPayFortSDKToken];

[payFort callPayFortWithRequest:request currentViewController:appDelegate.window.rootViewController success:^(NSDictionary *requestDic, NSDictionary *responeDic) {
    NSError *err1 = nil;
    SARPayFort *paymentResponse = [[SARPayFort alloc] initWithDictionary:responeDic error:&err1];
    if ([paymentResponse.status isEqualToString:@"14"]) {
        appDelegate.callbackBlock(paymentResponse,nil);
    }
    else {
        if(paymentResponse == nil)
            appDelegate.callbackBlock(nil,[NSError errorWithDomain:@"Payment Failed" code:99 userInfo:nil]);
        else
            appDelegate.callbackBlock(nil,[NSError errorWithDomain:paymentResponse.response_message code:99 userInfo:nil]);
    }
} canceled:^(NSDictionary *requestDic, NSDictionary *responeDic) {
    NSError *err1 = nil;
    SARPayFort *paymentResponse = [[SARPayFort alloc] initWithDictionary:responeDic error:&err1];
    if(paymentResponse == nil)
        appDelegate.callbackBlock(nil,[NSError errorWithDomain:@"Payment Cancelled" code:99 userInfo:nil]);
    else
        appDelegate.callbackBlock(nil,[NSError errorWithDomain:paymentResponse.response_message code:99 userInfo:nil]);
} faild:^(NSDictionary *requestDic, NSDictionary *responeDic, NSString *message) {
    NSError *err1 = nil;
    SARPayFort *paymentResponse = [[SARPayFort alloc] initWithDictionary:responeDic error:&err1];
    if(paymentResponse == nil)
        appDelegate.callbackBlock(nil,[NSError errorWithDomain:@"Payment Failed" code:99 userInfo:nil]);
    else
        appDelegate.callbackBlock(nil,[NSError errorWithDomain:paymentResponse.response_message code:99 userInfo:nil]);
}];`

@mohannadsaleh @cetozgen can you please check, thank you.

@parulgarg004
Copy link
Author

@mohannadsaleh @cetozgen can you please check, thank you.

@cetozgen
Copy link
Contributor

cetozgen commented Jun 2, 2022

Hi @parulgarg004

Could you please declare PayFortController *payFort at class level and initialize the object only one time on method such as onload ?

Regards,
Ozgen

@parulgarg004
Copy link
Author

@cetozgen I tried it and seems to load the view now, but there is another crash. We have custom view created which was earlier linked with PayFortView.h and now this class is not available in the new package. Can you provide me solution for this?

Screenshot 2022-06-02 at 5 53 33 PM

@hussainashraf4u
Copy link

Same issue, any update on this?

@parulgarg004
Copy link
Author

@cetozgen I'm working on it again and now the app started crashing after showing an initialization pop-up, can you please help at the earliest?
Simulator Screen Shot - iPhone 14 Pro - 2022-09-22 at 19 22 25

@cetozgen
Copy link
Contributor

@parulgarg004 Are you using custom view approach with inheriting .xib from PayfortSDK? There is a limitation forced by the Apple, newer versions of Xcode does not allow you to associate CustomPayfortView with your view.
In order to overcome this, there is a 2nd approach where each UI element is exposed. You can find it on page 30 (https://m.media-amazon.com/images/G/01/APS/api-reference/APS_Integration_Guide_-_iOS.pdf)

@parulgarg004
Copy link
Author

@cetozgen thanks for quick reply, I will try this and let you know

@parulgarg004
Copy link
Author

@cetozgen is the sample code updated?

@cetozgen
Copy link
Contributor

@parulgarg004 Yes sample code is updated for the latest SDK. If you need further support, kindly create a ticket by sending an email to integration-ps@amazon.com .Our team will be happy to assist you.

@parulgarg004
Copy link
Author

@cetozgen in sample for custom UI it's showing the same steps as I did. Approach mentioned on page 30 is not updated in the sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants