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

Client app paytm webflow not working correct. #28

Open
IrfanKhatik opened this issue Mar 1, 2022 · 1 comment
Open

Client app paytm webflow not working correct. #28

IrfanKhatik opened this issue Mar 1, 2022 · 1 comment

Comments

@IrfanKhatik
Copy link

Preconditions:
1] Paytm App not installed on device.
2] Not providing any callback url.

Usecase:
1] Fetch transaction token from backend and startPaytmPayment()
2] APIHandler's openPaymentWebVC() invoked and presented from MyPaytmViewController
3] Paytm web view loaded on presented vc.
4] Payment done by user successfully and weird success transaction html response shown by Paytm. (Screenshot) There is no back button, so user only option have to pull-down to dismiss
5] If user pull-down shown web view vc from Paytm
6] APIHandler's didFinish() api invoked from Paytm with "cancel" AIPaymentStatus.

Problem:
It should be success AIPaymentStatus and valid response provided in didFinish() as payment done by user. Please test from QA all use cases.

Codesnippet:
1.
class MyPaytmViewController: UIViewController {
private func startPaytmPayment() {
appInvoke.openPaytm(merchantId: merchantId,
orderId: orderId,
txnToken: transactionToken,
amount: transactionAmount,
callbackUrl: nil,
delegate: self,
environment: paymentEnvironment,
urlScheme: "paytm(AppConfig.domain)(AppConfig.storeId)")
}
}

extension MyPaytmViewController: AIDelegate {

func openPaymentWebVC(_ controller: UIViewController?) {
    //
    if let vc = controller {
        DispatchQueue.main.async { [weak self] in
            guard let strongSelf = self else { return }
            strongSelf.present(vc, animated: false, completion: nil)
        }
    }
    
    func didFinish(with status: AIPaymentStatus, response: [String : Any]) {
    //
    switch status {
    case .success:
        // Sending response to backend for validation
        validateTransaction(status: status, response: response) 
        break
    case .failed:
        print("Failed")
        break
    case .pending:
        print("Pending")
        break
    case .cancel:
        print("Cancelled")
        break
    default:
        print("Paytm unknown payment status")
        break
    }
}

}

Screenshot_2022_03_01T15_21_16_860Z

@Prakash128-lab
Copy link

Hi, Please try with given sample code .Let us know if any issue .

https://github.com/paytm/paytm-all-in-one-sample-app
https://github.com/paytm/Paytm_iOS_All_in_One_SDK

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

No branches or pull requests

2 participants