Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

iOS 13 Compatibility #67

Open
iiummel opened this issue Nov 11, 2019 · 0 comments
Open

iOS 13 Compatibility #67

iiummel opened this issue Nov 11, 2019 · 0 comments

Comments

@iiummel
Copy link

iiummel commented Nov 11, 2019

Is this URL scheme still supported for the latest iOS (13.2.2) and app (3.7.4) versions?

I was using the example data found here. When PPH opens from my app, all the items, payment, and taxes show up correctly. However, when I insert any chip card, the Do not remove card alert flashes multiple times and the payment is always declined. The return URL becomes myapp://takePayment/?Type=UNKNOWN.

This issue does not happen when PPH is opened by itself, so I know it's not a card/reader issue. Here is the formed JSON which is taken from the readme example. Using Base64 or URL encoding made no difference.

let itemDict1: [String: String] = [
            "taxRate": "8.5000",
            "name": "Curtains",
            "description": "Blue curtains",
            "unitPrice": "29.99",
            "taxName": "Tax",
            "quantity": "1"
        ]
        
        let itemDict2: [String: String] = [
            "taxRate": "0",
            "name": "Delivery Fee",
            "description": "Delivery Fee",
            "unitPrice": "5.0",
            "taxName": "Tax",
            "quantity": "1"
        ]

        let invoiceDict: [String: Any] = [
            "paymentTerms": "DueOnReceipt",
            "discountPercent": "0",
            "currencyCode": "USD",
            "number": "1457",
            "payerEmail": "[email protected]",
            "itemList": ["item" : [itemDict1, itemDict2]]
        ]
        
        let returnURL = "myapp://takePayment/{result}?Type={Type}&InvoiceId={InvoiceId}&Tip={Tip}&TxId={TxId}"
        let returnString = encodeString(string: returnURL)
        
        do {
            let jsonData = try JSONSerialization.data(withJSONObject: invoiceDict)
            let jsonString = String(data: jsonData, encoding: .utf8)!
            let dataString = encodeString(string: jsonString)
            let url = "paypalhere://takePayment?accepted=cash,card,paypal"
                + "&returnUrl=" + returnString
                + "&invoice=" + dataString
                + "&step=choosePayment"
                + "&payerPhone=4155551212"
            openApp(urlString: url)
        }
        catch {
            //Handle Error...
        }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant