This commit is contained in:
2023-10-17 17:31:03 +05:30
parent fcb6c7890d
commit 2478725588
2 changed files with 20 additions and 7 deletions

View File

@@ -1,6 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\adity\.android\avd\Samsung_Z3_flip_API_34.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-10-17T08:31:08.829911500Z" />
<runningDeviceTargetsSelectedWithDialog>
<Target>
<type value="RUNNING_DEVICE_TARGET" />

View File

@@ -28,9 +28,6 @@ import com.app.simplitend.cg_subscription.mvp.SubscriptionPresenter;
import com.app.simplitend.databinding.CgSubscriptionLayoutBinding;
import com.app.simplitend.welcome.welcomecg.mvvm.CareGiverData;
import com.stripe.android.PaymentConfiguration;
import com.stripe.android.model.PaymentMethod;
import com.stripe.android.paymentsheet.CreateIntentCallback;
import com.stripe.android.paymentsheet.CreateIntentResult;
import com.stripe.android.paymentsheet.PaymentSheet;
import com.stripe.android.paymentsheet.PaymentSheetResult;
@@ -40,7 +37,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import kotlin.coroutines.Continuation;
import okhttp3.MediaType;
import okhttp3.RequestBody;
@@ -81,7 +77,6 @@ public class CgSubscriptionActivity extends AppCompatActivity
this.careGiverData = careGiverData;
if (careGiverData != null){
if (careGiverData.isCaregiverTakeSubscription != 1){
// not subscribed thus, load plans
loadPlans();
@@ -150,6 +145,7 @@ public class CgSubscriptionActivity extends AppCompatActivity
this.careGiverData = careGiverData1;
if (careGiverData != null){
careGiverData.isCaregiverTakeSubscription = 0;
if (careGiverData.isCaregiverTakeSubscription != 1){
// no sub
loadPlans();
@@ -325,7 +321,6 @@ public class CgSubscriptionActivity extends AppCompatActivity
RequestBody price_id_body = RequestBody.create(this.stripe_price_id, MediaType.parse("text/plain"));
bodyMap.put("price_id", price_id_body);
presenter.createSubscription(bodyMap,
"Bearer " + AppUtil.getCgToken(this),
this);
@@ -475,7 +470,13 @@ public class CgSubscriptionActivity extends AppCompatActivity
final PaymentSheet.Configuration configuration = new PaymentSheet.Configuration.Builder("SimpliTend")
.customer(customerConfig)
.allowsDelayedPaymentMethods(true)
.billingDetailsCollectionConfiguration(new PaymentSheet.BillingDetailsCollectionConfiguration(
PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode.Automatic,
PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode.Automatic,
PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode.Automatic,
PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode.Automatic,
true
))
.build();
paymentSheet.presentWithPaymentIntent(