checkdeliverytime url changed

This commit is contained in:
cimenmus
2018-06-14 19:05:18 +03:00
parent 3fb62541ec
commit 649a7938c8
6 changed files with 10 additions and 132 deletions

View File

@@ -62,9 +62,6 @@
<activity
android:name=".activity.CampaignProductDetailsActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.PaymentActivity"
android:screenOrientation="portrait"/>
<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:launchMode="singleTask">

View File

@@ -1,118 +0,0 @@
package ch.pizzapp.android.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.braintreepayments.api.BraintreeFragment;
import com.braintreepayments.api.Card;
import com.braintreepayments.api.PayPal;
import com.braintreepayments.api.exceptions.BraintreeError;
import com.braintreepayments.api.exceptions.ErrorWithResponse;
import com.braintreepayments.api.exceptions.InvalidArgumentException;
import com.braintreepayments.api.interfaces.BraintreeCancelListener;
import com.braintreepayments.api.interfaces.BraintreeErrorListener;
import com.braintreepayments.api.interfaces.ConfigurationListener;
import com.braintreepayments.api.interfaces.PaymentMethodNonceCallback;
import com.braintreepayments.api.interfaces.PaymentMethodNonceCreatedListener;
import com.braintreepayments.api.interfaces.PaymentMethodNoncesUpdatedListener;
import com.braintreepayments.api.models.CardBuilder;
import com.braintreepayments.api.models.Configuration;
import com.braintreepayments.api.models.PayPalRequest;
import com.braintreepayments.api.models.PaymentMethodNonce;
import java.util.List;
import butterknife.ButterKnife;
import ch.pizzapp.android.R;
import ch.pizzapp.android.api.ApiConstants;
import ch.pizzapp.android.helper.DialogHelper;
public class PaymentActivity extends BaseActivity
implements PaymentMethodNonceCreatedListener,
PaymentMethodNoncesUpdatedListener, ConfigurationListener,
BraintreeCancelListener, PaymentMethodNonceCallback,
BraintreeErrorListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment);
ButterKnife.bind(this);
showBraintreePaymentFragment();
}
@Override
public void onPaymentMethodNonceCreated(PaymentMethodNonce paymentMethodNonce) {
// Send this nonce to your server
String nonce = paymentMethodNonce.getNonce();
}
@Override
public void onConfigurationFetched(Configuration configuration) {
}
@Override
public void onPaymentMethodNoncesUpdated(List<PaymentMethodNonce> paymentMethodNonces) {
}
@Override
public void onCancel(int requestCode) {
// Use this to handle a canceled activity, if the given requestCode is important.
// You may want to use this callback to hide loading indicators, and prepare your UI for input
}
@Override
public void success(PaymentMethodNonce paymentMethodNonce) {
}
@Override
public void failure(Exception exception) {
}
@Override
public void onError(Exception error) {
if (error instanceof ErrorWithResponse) {
ErrorWithResponse errorWithResponse = (ErrorWithResponse) error;
BraintreeError cardErrors = errorWithResponse.errorFor("creditCard");
if (cardErrors != null) {
// There is an issue with the credit card.
BraintreeError expirationMonthError = cardErrors.errorFor("expirationMonth");
if (expirationMonthError != null) {
// There is an issue with the expiration month.
DialogHelper.showAlertDialog(this, expirationMonthError.getMessage());
}
}
}
}
private void showBraintreePaymentFragment(){
try {
BraintreeFragment braintreeFragment =
BraintreeFragment.newInstance(
BaseActivity.currentActivity, ApiConstants.BRAINTREE_TOKENIZATION_KEY_SANDBOX);
/*
// create paypal payment
PayPal.requestBillingAgreement(braintreeFragment, new PayPalRequest());
*/
CardBuilder cardBuilder = new CardBuilder()
.cardNumber("4111111111111111")
.expirationMonth("08")
.expirationYear("2018");
Card.tokenize(braintreeFragment, cardBuilder);
}catch (InvalidArgumentException e){
e.printStackTrace();
}
}
}

View File

@@ -38,6 +38,6 @@ public class ApiEndPoints {
public static final String API_CHECK_COUPON = PREFIX + "checkCoupon" + SUFFIX + "&token=";
public static final String API_CHECK_CAMPAIGN_PIZZAPASS = PREFIX + "detectPizzaPassCampaign" + SUFFIX + "&token=";
public static final String API_CHECK_CAMPAIGN_CHAMPAGNE = PREFIX + "detectChampagneCampaign" + SUFFIX + "&token=";
public static final String API_CHECK_DELIVERY_TIME = PREFIX + "checkDeliveryTimeService" + SUFFIX + "&token=";
public static final String API_CHECK_DELIVERY_TIME = PREFIX + "checkDeliveryTimeService" + SUFFIX;
public static final String API_CREATE_PAYMENT = PREFIX + "createPayment" + SUFFIX + "&token=";
}

View File

@@ -512,7 +512,6 @@ public class CreateOrderSummaryFragment extends CreateOrderBaseFragment {
// CVV kodu default olarak gozukmuyor.
// Gozukmesi için braintree'ye login ol
// Go to Settings --> Processing --> CVV --> Click on Edit --> Check option 'CVV not provided(l)', Enable option 'for any transaction'
//
DropInRequest paymentRequest = new DropInRequest()
.tokenizationKey(ApiConstants.BRAINTREE_TOKENIZATION_KEY_SANDBOX)

View File

@@ -143,9 +143,18 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
private void fillAndNotifyAdapter(ArrayList<PaymentMethodModel> paymentMethodModels){
PaymentMethodModel.checkNull(paymentMethodModels);
for(PaymentMethodModel paymentMethodModel : paymentMethodModels){
if(paymentMethodModel.getPaymentMethodType() == PaymentMethodModel.PaymentMethodType.APPLE_PAY){
paymentMethodModels.remove(paymentMethodModel);
break;
}
}
for(PaymentMethodModel paymentMethodModel : paymentMethodModels){
if(paymentMethodModel.getPaymentMethodType() == PaymentMethodModel.PaymentMethodType.ANDROID_PAY){
paymentMethodModels.remove(paymentMethodModel);
break;
}
}

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ch.pizzapp.android.activity.PaymentActivity">
</android.support.constraint.ConstraintLayout>