Skip to content

Commit

Permalink
feat(payment): add existingPaymentMethodRequired to manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Mar 27, 2024
1 parent b74437b commit ff434ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions demo/angular/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
android:name="com.getcapacitor.community.stripe.google_pay_is_testing"
android:value="@bool/google_pay_is_testing"/>

<meta-data
android:name="com.getcapacitor.community.stripe.google_pay_existing_payment_method_required"
android:value="@bool/google_pay_is_testing"/>

<!-- <meta-data-->
<!-- android:name="com.getcapacitor.community.stripe.stripe_account"-->
<!-- android:value="@string/stripe_account"/>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void load() {
: GooglePayLauncher.BillingAddressConfig.Format.Min,
metaData.phoneNumberRequired
),
false
metaData.existingPaymentMethodRequired
),
(boolean isReady) -> this.googlePayExecutor.isAvailable = isReady,
(@NotNull GooglePayLauncher.Result result) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class MetaData {
public String billingAddressFormat;
public GooglePayEnvironment googlePayEnvironment;

public Boolean existingPaymentMethodRequired;

public boolean enableIdentifier;

public MetaData(Supplier<Context> contextSupplier) {
Expand All @@ -40,6 +42,9 @@ public MetaData(Supplier<Context> contextSupplier) {
phoneNumberRequired = appInfo.metaData.getBoolean("com.getcapacitor.community.stripe.phone_number_required");
billingAddressRequired = appInfo.metaData.getBoolean("com.getcapacitor.community.stripe.billing_address_required");
billingAddressFormat = appInfo.metaData.getString("com.getcapacitor.community.stripe.billing_address_format");
existingPaymentMethodRequired = appInfo.metaData.getBoolean("com.getcapacitor.community.stripe.google_pay_existing_payment_method_required");

// @deprecated. will remove at v6.0.0
enableIdentifier = appInfo.metaData.getBoolean("com.getcapacitor.community.stripe.enableIdentifier");

boolean isTest = appInfo.metaData.getBoolean("com.getcapacitor.community.stripe.google_pay_is_testing");
Expand Down

0 comments on commit ff434ef

Please sign in to comment.