- From: Rouslan Solomakhin <notifications@github.com>
- Date: Mon, 21 Dec 2015 10:44:02 -0800
- To: w3c/webpayments <webpayments@noreply.github.com>
- Message-ID: <w3c/webpayments/issues/42/166386694@github.com>
I think that native apps will connect through OS-specific means, like intents on Android. Here's how user agent code would look like on Android, I imagine:
````java
Intent intent = new Intent("org.w3.intent.action.PAY", Uri.parse("https://bobpay.xyz"));
intent.putExtra("Details", "{\"price\": 5500, \"currency\": \"USD\", \"merchant\": \"superstore1\"}");
intent.putExtra("SchemeData", "{\"bobPaySpecificField\": \"foo\"}");
startActivityForResult(intent, 0);
````
The payment app should send back the result as a string (or HashMap) plus the result code. Like so:
````java
Intent result = new Intent("org.w3.intent.action.PAY");
result.putExtra("InstrumentDetails", "{\n"
+ " \"cardNumber\": \"4111111111111111\",\n"
+ " \"nameOnCard\": \"Bob J. Paymentman\",\n"
+ " \"expMonth\": \"12\",\n"
+ " \"expYear\": \"2016\",\n"
+ " \"cvv2\": \"123\"\n"
+"}");
setResult(Activity.RESULT_OK, result);
finish();
````
We would need similar examples for the other platforms, but I am less familiar with them.
*Should we pass in a generic data structure like HashMap or the unparsed string to the payment app?*
---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments/issues/42#issuecomment-166386694
Received on Monday, 21 December 2015 18:44:33 UTC