#cogniDNA-elements-styling

1 messages ยท Page 1 of 1 (latest)

worthy spear
#

Hello! So it looks like you're trying to add styling to the card element? Is that correct?

#

What are you trying to get it to look like (if you have a link to the doc you're referencing that'd be great)

warm oasis
#

Yes. We want payment section to be more beautiful and professional looking. I took that screenshot from Stripe website

#

Many people visit our payment page after seeing price but few pay. We think a better looking payment page will increase trust so they give credit card info

worthy spear
#

I need to head out, but @pale valve can keep helping you. The big thing here is that the latest screenshot you've shared is a completely different element (the Payment Element), while your first screenshot uses the card element

#

You'll need to change your migration if you want to have it look like that

warm oasis
#

Yes. We would like to have our credit card payment section beautiful like that

pale valve
#

Hi @warm oasis, I'm taking over from @worthy spear

warm oasis
#

We tried but somehow could not make it work. What is the best way to get feedback from you to find out what we are doing wrong. Screenshot of code, error, summary of what we did, something else?

pale valve
#

Could you share the issue that you're facing? Code and error will help

warm oasis
#

OK. I will meet my cofounder in couple hours and we will look into it and share then. Thank you very much ๐Ÿ™‚

pale valve
#

No problem! Let me know if you need more help

quasi vapor
#

hi river, thanks for being so responsive; I have a few more details:
we started with the card element, and I thought we could style it, but changing the styling doesn't seem to take effect.
I've started trying to use the Payment Request Element, but so far I can't get the button to appear.

warm oasis
#

@pale valve I think we are ready with our more specific questions now ๐Ÿ™‚

quasi vapor
#

it looks like the element is mounting correctly, but it's invisible

pale valve
#

could you share your test site or code for me to take a look?

quasi vapor
#

should I just paste here? I'm actually worried that it's not working on my test site because r.stripe.com is failing HSTS security checks from my browser

#

so far I have:

   var paymentRequest = stripe.paymentRequest({
          country: 'US',
          currency: 'usd',
          total: {
              label: 'total',
              amount: 1000,
          },  
          requestPayerName: false,
          requestPayerEmail: true,
      }); 
  
      var prButton = elements.create('paymentRequestButton', {
          paymentRequest: paymentRequest,
      }); 
     prButton.mount("#payment-request-button");
pale valve
#

What is the exact error that you're seeing when you mentioned "r.stripe.com is failing HSTS security checks from my browser"?

quasi vapor
#

here's the last few errors from my console

#

showing the #payment-request-button element on the page looks like:

#

oh, it didn't capture, but that blank space ebtween "order total" and "payment details" does contain the element

warm oasis
quasi vapor
pale valve
#

I'm confused here! Payment request is for wallet payment such as Apple Pay and Google Pay, which is totally different from Payment Element

quasi vapor
#

that's what we're trying to achieve: wallet payment

#

I guess there's two things: wallet payment and styling; I'm more concerned about getting wallet payment to work though

pale valve
#

Ah I see

#

I'm a bit confused how's the styling related to wallet payment

quasi vapor
#

it's not

pale valve
#

Currently, it looks like you use separate elements for different payment methods, i.e. card element and payment request

quasi vapor
#

I thought the PaymentRequest element would also handle cards? I might be mistaken, but it's no trouble to keep the card element separately

pale valve
#

Nope. Payment request is only for wallet payment only. The one with both cards and wallet is Payment Element

quasi vapor
#

or I guess you've said that the Payment element can replace the Card element for card payments? is that right?

#

oh

#

that's useful information, thanks!

pale valve
quasi vapor
#

so really I should be focusing on Payment rather than PaymentRequest

pale valve
#

Yes, you're right

quasi vapor
#

that should be pretty quick to change...

#

just a minute

#

omg, looks like it actually worked:

pale valve
#

Please ignore the integration part in this doc which it's specific for wallet payment, but you will still need those pre-requisites and requirements for wallet to appear in Payment Element

quasi vapor
#

do you know what the "Not a valid URL" error means from the payment_intents confirm api?

opal torrent
#

๐Ÿ‘‹ stepping in for river

#

"Not a valid URL" sounds like a parameter error. I can take a closer look if you share the request id (req_xxx) for that confirmation call

quasi vapor
#

does the return_url parameter to confirmPayment need to be absolute?

opal torrent
#

yes, as a normal URL

warm oasis
#

Sorry for late response. We have been trying to make URL valid in django template

opal torrent
#

Yeah the value passed in is not a valid URL /stripe_fulfill/

#

You would need to build a full URL using django before passing in this parameter

warm oasis
#

We will back next week for Apple pay help ๐Ÿ˜†