Created
July 11, 2018 10:10
-
-
Save eaponiente/fb3b263a95d2197a38be49829ba195af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
package="com.munchbakery.app"> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.CAMERA" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.CALL_PHONE" /> | |
<!--TODO remove android:largeHeap="true" later this is only a temporary fix until a more stable one is found--> | |
<application | |
android:name=".BaseApplication" | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="true" | |
android:largeHeap="true" | |
android:theme="@style/AppTheme"> | |
<meta-data android:name="com.facebook.sdk.ApplicationId" | |
android:value="@string/facebook_app_id"/> | |
<activity android:name="com.facebook.FacebookActivity" | |
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" | |
android:label="@string/app_name" /> | |
<activity android:name="com.facebook.CustomTabActivity" | |
android:exported="true"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="@string/fb_login_protocol_scheme" /> | |
</intent-filter> | |
</activity> | |
<activity | |
android:name=".MainActivity" | |
android:screenOrientation="portrait"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
</intent-filter> | |
</activity> | |
<activity | |
android:name=".SplashScreen" | |
android:screenOrientation="portrait"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> | |
<activity | |
tools:replace="android:theme" | |
android:name="com.oppwa.mobile.connect.checkout.dialog.CheckoutActivity" | |
android:theme="@style/Theme.Checkout.Light" | |
android:windowSoftInputMode="adjustPan" | |
android:exported="false" | |
android:launchMode="singleTop" /> | |
<activity | |
android:name=".checkout.CheckoutActivity" | |
android:screenOrientation="portrait" | |
android:launchMode="singleTask"> | |
<intent-filter> | |
<data android:scheme="@string/checkout_ui_callback_scheme" /> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
</intent-filter> | |
</activity> | |
<meta-data | |
android:name="com.google.android.geo.API_KEY" | |
android:value="@string/google_api_key_data" /> | |
<service | |
android:name=".location.FetchAddressIntentService" | |
android:exported="false"/> | |
<service | |
android:name="com.oppwa.mobile.connect.service.ConnectService" | |
android:exported="false" /> | |
<receiver | |
android:name=".checkout.payment.CheckoutBroadcastReceiver" | |
android:exported="false" /> | |
</application> | |
</manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void generateCheckoutId(double amount, String email, final ApiListener.GenerateCheckoutIdListener listener) | |
{ | |
ApiConnector connector = ApiConnector.init(); | |
ApiHandler handler = connector.createService(ApiHandler.class); | |
JSONObject obj = new JSONObject(); | |
try | |
{ | |
obj.put("amount", amount); | |
obj.put("email", email); | |
} catch (JSONException e) | |
{ | |
e.printStackTrace(); | |
} | |
JsonParser parser = new JsonParser(); | |
JsonObject body = (JsonObject) parser.parse(obj.toString()); | |
String url = Values.BASE_URL + "hyperpay/checkout"; | |
mCall = handler.post(url, DevUtil.getHeaders(mContext, false), body); | |
mCall.enqueue(new Callback < ResponseBody > () | |
{ | |
@Override | |
public void onResponse(@NonNull Call < ResponseBody > call, @NonNull Response < ResponseBody > response) | |
{ | |
try | |
{ | |
if (response.isSuccessful()) | |
{ | |
String serverResponse = response.body().string(); | |
JSONObject jsonObject = new JSONObject(serverResponse); | |
String checkoutId = jsonObject.getString(" checkoutId"); | |
if (StringUtils.isNotBlank(checkoutId)) | |
{ | |
listener.onCheckoutIdGenerated(checkoutId); | |
} else | |
{ | |
AppLogger.error(TAG, "Null or Empty Checkout ID"); | |
listener.onError(); | |
} | |
} else | |
{ | |
String serverResponse = response.errorBody().string(); | |
JSONObject errorObject = new JSONObject(serverResponse); | |
AppLogger.printErrorJSON(TAG, errorObject); | |
listener.onError(); | |
} | |
} catch (IOException | JSONException | NullPointerException e) | |
{ | |
e.printStackTrace(); | |
listener.onError(); | |
} | |
} | |
@Override | |
public void onFailure(@NonNull Call < ResponseBody > call, @NonNull Throwable t) | |
{ | |
t.printStackTrace(); | |
listener.onError(); | |
} | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the error | |
{ | |
"code":"200.300.404", | |
"description":"invalid or missing parameter", | |
"parameterErrors":[ | |
{ | |
"name":"shopperResultUrl", | |
"value":null, | |
"message":"missing parameter" | |
}, | |
{ | |
"name":"notificationUrl", | |
"value":null, | |
"message":"Notification url must be present if shopperResultUrl is not a valid url" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are facing the same issue. Were you able to resolve it?