#vinod_api

1 messages ¡ Page 1 of 1 (latest)

elder anchorBOT
#

👋 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/1304345423745388594

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

halcyon mulch
#

Hi @daring barn

#

Can you help me with the paypal integration

#

@elder anchor can you please request @daring barn to reply me?

daring barn
#

There's no need to tag me in every message, I'd get back to you eventually

halcyon mulch
#

Yes I have gone through that, and have added the Paypal method in my stripe dashboard

#

When I visit my payment page in desktop I can see "Pay with Link"

#

if I were to use my mobile I can see Gpay

#

but I can;t see Paypal payment button

daring barn
#

Can you share with me the PaymentIntent ID?

#

And looks like you are using Card Element, not PaymentElement in your page. Card Element doesn't support Paypal

halcyon mulch
#

I don't have a PaymentIntent ID yet

#

I have card element, I also have the following code so it can show the available payment buttons

#

let me provide you the code

daring barn
#

As I said, card element doesn't support Paypal, you should use Payment element,

halcyon mulch
#

var settings = {
"url": "/aapi/stripe/getcartdetail",
"method": "GET",
"timeout": 0,
"headers": {
"shoppingguid": $('#shoppingguid').val()
}
};

          $.ajax(settings).done(function (response) {
            console.log(response);

            var requestCountry = response.country;
            var requestCurrency = response.currency;
            var requestAmount = response.amount;
    
            var requestJson = {
                country: requestCountry,
                currency: requestCurrency,
                total: {
                    label: "Total",
                    amount: requestAmount
                }
            };
            var paymentRequest = Alyka.Stripe.Cache.$stripe.paymentRequest(requestJson);
    
            var elements = Alyka.Stripe.Cache.$stripe.elements();
            const prButton = elements.create("paymentRequestButton", {
                paymentRequest: paymentRequest
            });
    
            paymentRequest.canMakePayment().then(function (result) {
                if (result) {
                    prButton.mount("#awpaymentrequest");
                } else {
                    $("#applepayrow").hide();
                    $("#awpaymentrequest").hide();
                    // $('#awstripeapplepayerror').append('apple pay unavaliable<br>');
                    // $('#awstripeapplepayerror').show();
                }
            });
#

var elements = Alyka.Stripe.Cache.$stripe.elements();
const prButton = elements.create("paymentRequestButton", {
paymentRequest: paymentRequest
});

is this not creating a Payment element?

daring barn
#

No, that's payment request button for Link, Apple Pay and Google Pay

halcyon mulch
#

I see

#

if I were to use Payment Element, do the customers redirect to Stripe payment page, do the payment and redirect back to my site?

#

at the moment using Card Element, customer stay on our website

daring barn
#

Yes, your customer will be redirected back

halcyon mulch
#

Does that mean my code must be changed right?
I mean I had to migrate from "Card Element" to Payment Element

#

does Link supported by Payment Element?

#

at the moment my website payment page intializes Card Element and Payment Request buttons seperately

#

Can you please recommend what's the proper way to handle my situation?

daring barn
halcyon mulch
#

We support Card, Gpay, ApplePay, Link and may accept more payment methods in future

#

Paypal

daring barn
halcyon mulch
#

thank you

#

can you please confirm one more thing?

#

??

#

Can you please help me understand how the user will be with Card vs Paypal

daring barn
halcyon mulch
#

The reason why I am asking these question is,
my client doesn't like to redirect to other website
doen't like the look, it doen't match our website branding(theme)

daring barn
halcyon mulch
#

yeah I saw that, that's good

#

so choosing Card over the Payment Element, will the customer redirect to stripe payment page?

daring barn
#

Yes and I believe I've already answered the same question.

halcyon mulch
#

Thanks Jack, I think I will have to paly with my javascript

#

please keep this thread open, if I have any questions further so I can reach out

daring barn
#

The thread will be closed after some time. Feel free to create a new thread from #help

halcyon mulch
#

that's fine thank you