#citruslime.bank-apple-pay

1 messages · Page 1 of 1 (latest)

buoyant lichen
#

Usually this means you don't have a payment card set up correctly in your apple pay wallet

#

You need to have a real card saved in your wallet before this can work

candid echo
#

I definitely do. I've used apple pay for years.
I don't think you've read the issue correctly.

#

Standard window = broke
Incognito window = working.

I have 3 valid payment cards which I use regularly within my apple pay wallet.

buoyant lichen
#

Incognito mode always returns true by default to avoid exposing personal details, that's expected

#

Private, i mean, for safari

candid echo
#

So even if the device doesn't support apple pay, it will say it does?

buoyant lichen
#

Not working in non-private, is the indication that the payment card isnt set up completely/correctly

candid echo
#

I can't stress this enough.

It is setup correctly.
It is my personal device.
I have used apple pay twice today. Once online, once in store.

buoyant lichen
#

(in a non-private tab)

candid echo
buoyant lichen
#

ok cool, thanks for checking 🙂

candid echo
#

Yes

buoyant lichen
#

Can you share a public URL for your page where i can inspect this myself?

candid echo
#

You can use ridebikes.co.uk

https://www.ridebikes.co.uk/cart/?CartIdToRetrieve=eb821da1-1213-4fb5-ab01-af5f61fdb83c

If you use that link, it'll have a basket containing a "Park Tool".
You can proceed through the checkout using Credit Card or Apple Pay, if you see it.

You can spoof data.

If you want to enter a Postcode you can use United Kingdom and enter "LA12 0AA" and choose "Citrus-Lime Ltd" from the address dropdown.

Once you've confirmed your shipping on the following screen you'll enter the payment stage and you ought to see an apple pay accordion and button to click.

#

To be clear, the payment is LIVE. So do not confirm the payment.

#

I'll also elaborate with some extra information I've been provided which is that, several members of staff are all affected by the same issue, but not all of them. It seems as though the result may be cached.

#

That's the stripe.paymentRequest object from my citrusPayPaymentRequest variable in the original code snippet above.

buoyant lichen
candid echo
#

Yes, if you can see the other payment options, that's where you would find apple pay

buoyant lichen
#

Has this worked for you previously, and stopped, or has not yet worked?

candid echo
#

Right, so ...

Across our platform, we have about 50 websites currently using StripeJS for Apple Pay transactions.

Most of the sites work for everyone, all the time (private and non-private windows).
Some of the sites only work in private some people.

There's no correlation between those who are experiencing the issue across the sites.

Site A may work perfectly for Person X and not Person Y.
But
Site B may work perfectly for Person Y and not Person Z.

I've ruled out that it's device setup.

It seems as though it may have been that apple pay was unavailable on a site for a period of time, perhaps due to domain verification or something like that, and Person X visited it and the result of their "canMakePayment" request was cached. Meaning that when it did become available, the cached result suggested that it wasn't available for their device.

buoyant lichen
#

Can you share your stripe account ID so i can inspect your configuration? like acct_1234

candid echo
#

We have a connect account.

#

I will share the Ride Bikes acc.

buoyant lichen
#

ok can you share this connected account id?

#

i can't find your Stripe.js initialization snippet in the source of the payment page, can you share that too?

candid echo
#

acct_1JcTxn2S2rcmFQqy

#

The entire file ...

var citrusPayParentEl = document.querySelector('.citruspay-wallet');

$(document).ready(function ()
{
    initCitrusPayBasket();
});

function initCitrusPayBasket()
{
    $.getScript("https://js.stripe.com/v3/").done(citrusPaySQKLoaded);
}

function citrusPaySQKLoaded()
{
    var citrusPaySDK = Stripe(citrusPayWalletInit.apiKey, {
        stripeAccount: citrusPayWalletInit.mId
    });

    var citrusPayPaymentRequest = citrusPaySDK.paymentRequest({
        country: ecommerceConfig.DespatchCountry.toUpperCase(),
        currency: ecommerceConfig.LocalCurrencyCode.toLowerCase(),
        total: {
            label: 'Cart total',
            amount: citrusPayWalletInit.total,
        },
        requestPayerName: true,
        requestPayerEmail: true,
    });

    citrusPayPaymentRequest.canMakePayment().then(function (result)
    {
        if (result && result.hasOwnProperty('applePay') && result.applePay === true)
        {
            displayCustomCitrusPayWalletButton('apple');
        }
    });
}

function displayCustomCitrusPayWalletButton(type)
{
    var newCitrusPayWalletButton = document.createElement('a');
    newCitrusPayWalletButton.href = '/ssl/secure';
    newCitrusPayWalletButton.classList.add('col-1', 'pos-rel', 'button', 'bSquare', 'buttonChkOut', 'ctrMgr8-top', 'ctrMgr8-bottom', 'centralise', 'backgroundblacki', 'text-center');
    newCitrusPayWalletButton.innerHTML = '<img src="/ssl/images/cards/raw-' + type + '.png?height=22" border="0" />';
    newCitrusPayWalletButton.dataset.type = 'citruspaywallet-' + type;
    newCitrusPayWalletButton.setAttribute('onclick', 'GoToCheckout($(this), event);');

    citrusPayParentEl.appendChild(newCitrusPayWalletButton);
}
#

(p.s. Don't judge by the use of Jquery, I'm required to use it ... it brings great dishonour to my family :D)

#

For clarity, the Stripe Account ID is held in this object property.
citrusPayWalletInit.mId

buoyant lichen
#

Looking at this, bear with me

candid echo
#

No worries, I'll be available for a while this evening.

buoyant lichen
#

OK i think this might be a quick fix

candid echo
#

Those are my favourite kind of fixes.

buoyant lichen
#

You don't appear to have this particular domain set up for this connected account for apple pay

#

You have a different domain set up for that account via your platform

#

and every domain must be registered (using the well-known file etc)

candid echo
#

With us being a connected account, the domain is registered against the parent account.

#

So it's registered against our account.

#

Each site on our platform has the well known file on it and was registered via the API during onboarding.

buoyant lichen
#

RIght, but because you are doing direct charges (initializing stripe.js with the connected account):

var citrusPaySDK = Stripe(citrusPayWalletInit.apiKey, {
        stripeAccount: citrusPayWalletInit.mId
    });

this needs to be registered for that account via your platform

#

this is a somewhat annoying config issue we're trying to improve

candid echo
#

The onboarding developers stated that this was the way it needed to be done.

buoyant lichen
#

If you were doing destination charges it would be for your platform, yes, but with that stripe account parameter for direct charges you need to register it for the connected account

candid echo
#

The payment intent is setup with the Destination property.

buoyant lichen
#

oh, you want destination charges?

candid echo
#
{
    PaymentIntentCreateOptions paymentOptions = new PaymentIntentCreateOptions()
    {
        CaptureMethod = "automatic",
        Amount = CalculateFinancialValueForStripe(this.paymentDetailModel.GrandTotal),
        Currency = this.processorInfo.ISOCurrency,
        PaymentMethodTypes = new List<string>(),
        ApplicationFeeAmount = CalculateFinancialValueForStripe(fewFromCalculator),
        Metadata = new Dictionary<string, string>()
        {
            {
                "Billing Customer Name",
                this.paymentDetailModel.BillAddress.FirstName + " " + this.paymentDetailModel.BillAddress.LastName
            },
            {
                "Billing Customer Email",
                this.paymentDetailModel.BillAddress.EMail
            }
        },
        TransferData = new PaymentIntentTransferDataOptions()
        {
            Destination = this.processorInfo.MerchantID
        },
        OnBehalfOf = this.processorInfo.MerchantID
    };
}
buoyant lichen
#

In that case, remove the stripeAccount parameter from the stripe.js initialization

candid echo
#

If I can be explicitly clear.
if I was to pay using the apple pay button, the transaction completes perfectly fine. The payment is taken from our platform account and subsequently transferred from the connected account fine too.

buoyant lichen
#

I'm not sure what you mean by "If i was to pay..."

#

I'm saying if you're trying to use destination charges, then the pattern for initializing stripe.js is currently not set up for that. THe use of the stripeAccount optional param is for direct charge configurations

merry dagger
#

taking over for @buoyant lichen
If you are using destination charges (which your .NET code is doing) you should not do var citrusPaySDK = Stripe(citrusPayWalletInit.apiKey, { stripeAccount: citrusPayWalletInit.mId }); at all

#

instead you should do var citrusPaySDK = Stripe(citrusPayWalletInit.apiKey);

candid echo
#

OK, so if I click on the apple pay button on ride bikes ...
Pay via apple pay ...
The payment intent completes correctly. Debiting monies from the correct locations.

#

He is one of the partner onboarding developers (or something of that ilk).

candid echo
merry dagger
#

@candid echo the person who told you was confused/incorrect, it happens as Connect + Apple Pay is really complex.
You use Destination Charges right now per your .NET code, if that's expected please change the Stripe.js code

#

If you are not supposed to use Destination Charges, then change your .NET code

candid echo
#

I appreciate I may be coming off as difficult here, but I'm just trying to sanity check the conflicting information.

candid echo
merry dagger
#

I can tell you 100% that it's impossible it works with the current code you have

candid echo
#

This payment intent is from yesterday ...
pi_3Juj84ECYMgji7vm1dzbCJE2

merry dagger
#

(removed the pictures as they don't really help)
Looking at that id

candid echo
#

I understand

#

Thanks

merry dagger
#

Okay so that payment is a destination charge. So it's impossible that your code explicitly passes the connected account id in the Stripe.js initialization

#

Do you have a live URL where I can test this/confirm?

candid echo
#

Specifically, for the website related to the payment intent you just inspected ...

#

You can use that link, I created a shareable cart for you.

merry dagger
#

where do I click to find the Apple Pay button or the Google Pay button?

candid echo
#

So the Apple Pay button would be down the page in the cart.

#

You can use ridebikes.co.uk

https://www.ridebikes.co.uk/cart/?CartIdToRetrieve=eb821da1-1213-4fb5-ab01-af5f61fdb83c

If you use that link, it'll have a basket containing a "Park Tool".
You can proceed through the checkout using Credit Card or Apple Pay, if you see it.

You can spoof data.

If you want to enter a Postcode you can use United Kingdom and enter "LA12 0AA" and choose "Citrus-Lime Ltd" from the address dropdown.

Once you've confirmed your shipping on the following screen you'll enter the payment stage and you ought to see an apple pay accordion and button to click.

merry dagger
#

There's no button anywhere for me so I'm struggling to help you unfortunately

candid echo
#

That’s my exact point. The button only shows in incognito on some of our sites but not all of them.

#

Some sites it works fine.

#

But it’s mixed results for everyone.

merry dagger
#

yeah but I am 100% sure you code just can't work at all

#

the only way it works is to remove that stripeAccount thing

candid echo
#

I’ll definitely try it, thanks m just stumped as to why the payments are working fine if the code shouldn’t work at all

merry dagger
#

Maybe that's not the real code or the exact page? It's hard to say unfortunately without more context on what you built. The way your code is build, the code would 100% error even if the button appeared

candid echo
#

All those transactions in the images I sent are from live sites, running the same code and within the last week or so

#

It’s a globally deployed app

#

So all 500 of our sites run the same code base

#

When we release a new version they’re all updated at the same time

#

I’m telling you 100% that’s the code driving those sales, as hard as it may be to believe.

merry dagger
#

Just to clarify: I work for Stripe, I've been here for years, I know our products extensively. The code you shared literally means "please confirm the PaymentIntent on the connected account" it would 100% error with a 404 if the PaymentIntent is on the platform

candid echo
#

And I understand.

#

I wrote the code

merry dagger
#

The only thing I can think of is a bug where your code will pass your own platform account id in that hash

candid echo
#

That must be the case then, since I’d bet very good money on that working.

#

I genuinely do believe you (that our code is wrong) but I also am 1000% confident that the same code is also, somehow working.

#

Im going to test it on Monday morning using your code. Shall I DM you on here with the results?

merry dagger
#

no need to DM no but you can circle back in the channel. But yeah okay if you think you might be passing your own account id sometimes it'd explain everything. And if you remove the entire stripeAccount option you should be all set!

candid echo
#

No we definitely are not passing our ID.

#

We read the customers account ID.

#

But as I said, I’ll definitely try your code. It makes sense that it would work how you said. My confusion came from it actually working with the customers account.

merry dagger
#

sounds good

candid echo
#

Thanks for your help!
Do you want me to report back to this thread on Monday or just in the general channel?

merry dagger
#

the thread will be archived, but just post in the main channel and mention your thread and we can reopen it (or create a new one)

candid echo
#

Cheers fella!

#

Have a great weekend.