Skip to content

Commit

Permalink
Merge pull request #345 from capacitor-community/feat/google_pay_requ…
Browse files Browse the repository at this point in the history
…ire_payment_false

feat(payment): add google_pay_existing_payment_method_required to Manifest at Google Pay
  • Loading branch information
rdlabo authored Mar 27, 2024
2 parents 6b21064 + 15e94da commit 705c00d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 2 deletions.
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_existing_payment_method_required"/>

<!-- <meta-data-->
<!-- android:name="com.getcapacitor.community.stripe.stripe_account"-->
<!-- android:value="@string/stripe_account"/>-->
Expand Down
1 change: 1 addition & 0 deletions demo/angular/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<string name="country_code">US</string>
<string name="merchant_display_name">Widget Store</string>
<bool name="google_pay_is_testing">true</bool>
<bool name="google_pay_existing_payment_method_required">false</bool>
<!-- <string name="stripe_account"></string>-->
</resources>
4 changes: 4 additions & 0 deletions demo/react/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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_existing_payment_method_required"/>

<!-- <meta-data-->
<!-- android:name="com.getcapacitor.community.stripe.stripe_account"-->
<!-- android:value="@string/stripe_account"/>-->
Expand Down
1 change: 1 addition & 0 deletions demo/react/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<string name="country_code">US</string>
<string name="merchant_display_name">Widget Store</string>
<bool name="google_pay_is_testing">true</bool>
<bool name="google_pay_existing_payment_method_required">false</bool>
<!-- <string name="stripe_account"></string>-->
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public void load() {
? GooglePayLauncher.BillingAddressConfig.Format.Full
: GooglePayLauncher.BillingAddressConfig.Format.Min,
metaData.phoneNumberRequired
)
),
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
2 changes: 1 addition & 1 deletion packages/payment/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor-community/stripe",
"version": "5.5.0",
"version": "5.5.1-beta.0",
"engines": {
"node": ">=16.0.0"
},
Expand Down

0 comments on commit 705c00d

Please sign in to comment.