#donut_code

1 messages ยท Page 1 of 1 (latest)

wintry falconBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1423653075788239002

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

thin wagon
#

hi there!

minor tulip
#

hi

thin wagon
minor tulip
#

yes. on mode payment it displayed but not in subscription mode

wintry falconBOT
lost pasture
#

Hi there, taking over for @thin wagon as they had to step away

minor tulip
#

let me check quick

lost pasture
#

Got it, it looks like Google Pay is set up properly for your account and browser. Can you share the full code to create your checkout elements? If there is any backend code that was used, please share that as well

minor tulip
#

const expressCheckoutOptions = {
buttonHeight: 50,
buttonTheme: { applePay: 'white-outline' },
paymentMethods: {
googlePay: 'always'
},
applePay: {
recurringPaymentRequest: {
paymentDescription: planDescription || '',
regularBilling: {
amount,
label: planName || 'Subscription',
recurringPaymentStartDate: new Date(),
recurringPaymentIntervalUnit: this.mapDurationIdToIntervalUnit(durationId),
recurringPaymentIntervalCount: durationValue
},
billingAgreement: 'billing agreement',
managementURL: 'https://stripe.com'
}
},
googlePay: {
paymentRequest: {
total: {
label: planName || 'Subscription',
amount: (amount / 100).toFixed(2),
currency: currency.toUpperCase()
}
}
}
};

this.expressCheckoutElements = stripe.elements({
  mode: 'subscription',
  amount: amount || 0,
  currency,
  appearance
});

this.paymentElement = this.expressCheckoutElements.create(
  'expressCheckout',
  expressCheckoutOptions
);
this.paymentElement.mount('#express-checkout-button');

this is it

#

no backend code

#

or wait i'll send you the subscription creation properties

#

var paymentSettings = new SubscriptionPaymentSettingsOptions
{
SaveDefaultPaymentMethod = "on_subscription",
};
var createSubscription = new SubscriptionCreateOptions
{
Customer = customer.Id,
Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = price.Id } },
Metadata = createStripeSubscriptionPaymentRequest.Metadata,
Discounts = new List<SubscriptionDiscountOptions> { promotionCode == null ? new SubscriptionDiscountOptions { Coupon = coupon?.Id } : new SubscriptionDiscountOptions { PromotionCode = promotionCode?.Id } },
Currency = price.Currency
};

if (createStripeSubscriptionPaymentRequest.PaymentOptionId == PaymentOptionConstants.PayPal)
{
createSubscription.Expand = new List<string> { "latest_invoice.confirmation_secret" };
createSubscription.OffSession = true;
}
else if (createStripeSubscriptionPaymentRequest.PaymentOptionId == PaymentOptionConstants.ApplePay || createStripeSubscriptionPaymentRequest.PaymentOptionId == PaymentOptionConstants.GooglePay)
{
createSubscription.PaymentBehavior = "default_incomplete";
createSubscription.Expand = new List<string> { "latest_invoice.confirmation_secret" };
createSubscription.PaymentSettings = paymentSettings;
}

#

but all of this happens after the buttons show

#

so you dont really need to look into this

lost pasture
#

Got it, thanks for sending both. Looking into this now

minor tulip
#

Also when apple pay button wasnt showing we had to add this

applePay: {
recurringPaymentRequest: {
paymentDescription: planDescription '',
regularBilling: {
amount,
label: planName 'Subscription',
recurringPaymentStartDate: new Date(),
recurringPaymentIntervalUnit: this.mapDurationIdToIntervalUnit(durationId),
recurringPaymentIntervalCount: durationValue
},
billingAgreement: 'billing agreement',
managementURL: 'https://stripe.com/'
}
},

#

but couldnt find something similar in the doc for google pay

lost pasture
#

Understood. The Apple Pay configuration you're using is for MPANs, which is not a concept that exists for Google Pay

Looking over your code, towards the end there is

    this.expressCheckoutElements = stripe.elements({
      mode: 'subscription',
      amount: amount  0,
      currency,
      appearance
    });

I don't understand the amount: amount 0,. Is that part of your code or was there some weird copy and paste issue?

minor tulip
#

weird copy

#

its amount or 0

lost pasture
#

Is the amount > 0 when loading the page that doesn't show Google Pay?

minor tulip
#

yes

lost pasture
#

Got it. Can you share a published test page so we can try and reproduce on our end?

lost pasture
#

Thanks! Can you DM me a test email and password to log into the site?

wintry falconBOT
lost pasture
#

(got the email and password, deleted the message, thanks!)

minor tulip
#

ahhahahha thank you

vague current
#

Hello
Taking over here ๐Ÿ‘‹

minor tulip
#

hi, okay

vague current
#

So you probably want to remove that from your code

minor tulip
#

we added that thinking it would fix it but even before addinf that the button wasnt displaying

vague current
#

that's fine, let's go back to the previous code

minor tulip
#

do you want me to send you the code again?

#

or do you want us to make the changes on the testing site right away

vague current
#

If you can make the changes right away, that'd be great so I can debug at the same time

#

Right now, I do see an error/warning about the parameter in the console

minor tulip
#

okay i'll let u know when it releases

vague current
#

have you registered the domain on Stripe?

#

It doesn't look like the domain has been registered. Can you register https://portali2.gjirafa.dev/ on your account using the link I shared above?

minor tulip
#

wait a moment

#

oh okay it appeard thanks a lot, we mixed the payment configuration , we enabled it somewhere else

#

thank you for your help

vague current
#

NP! ๐Ÿ™‚ Happy to help