#luis_07716

1 messages · Page 1 of 1 (latest)

static pilotBOT
#

Hello! We'll be with you shortly. 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.

hardy moth
#

@potent sonnet Let's chat here. Please keep all messages in this thread instead of the main channel

potent sonnet
#

I'm so sorry let me delete those

#

we have using the next code

#

`export async function createPaymentIntent(amount, contactId, paymentMethod) {
const paymentIntentConfig = {
amount,
currency: 'usd',
metadata: {
contactId: contactId
}
};
if (paymentMethod) {
paymentIntentConfig.payment_method_types = [paymentMethod];
}
const paymentIntent = await stripeService.paymentIntents.create(paymentIntentConfig);

return paymentIntent;
}`

#

and

#

`const pay = async (amount) => {
//stripe use cents
const donationIntent = await apiService.createDonationIntent(amount * 100, 'card');
const clientSecret = donationIntent.client_secret;

const { error } = await confirmPlatformPayPayment(clientSecret, {
  applePay: {
    cartItems: [
      {
        label: 'Donation',
        amount: amount.toString(),
        paymentType: PlatformPay.PaymentType.Immediate
      }
    ],
    merchantCountryCode: 'US',
    currencyCode: 'USD',
    requiredShippingAddressFields: [PlatformPay.ContactField.PostalAddress],
    requiredBillingContactFields: [PlatformPay.ContactField.PhoneNumber]
  }
});
console.log(error);
if (error && error.code !== 'Canceled') {
  showErrorToast();
}

};`

#

already tried to change cartItems to paymentSummaryItems but it didn't work , cartItems is required

#

and the intent id is

#

any clue what could be doing wrong ?

hardy moth
#

And you're currently using React Native + Expo 48? Do you still see the "The payment has been canceled" message or are you seeing something else?

potent sonnet
#

we are using react native + expo 48 + eas build managed , i do still see the same error The payment as been canceled

abstract yoke
#

Hi 👋

I'm stepping in to offer some assistance

potent sonnet
#

thank you so much!

abstract yoke
#

The Payment Intent you shared was just created and now needs a payment method. What is it you are trying to do here?

potent sonnet
#

trying to enable apple pay , so first in the server i create the paymentIntent and i provide the intent.client_secret to the confirmPlatformPayPayment

abstract yoke
#

Lets stop right there

#

Do you have an Apple Pay certificate registered with Stripe?

potent sonnet
#

yes

abstract yoke
#

Okay I do see that

#

And how are you presenting the PaymentSheet?

potent sonnet
#

with confirmPlatformPayPayment

#

with this config

#

clientSecret, { applePay: { cartItems: [ { label: 'Donation', amount: amount.toString(), paymentType: PlatformPay.PaymentType.Immediate } ], merchantCountryCode: 'US', currencyCode: 'USD', requiredShippingAddressFields: [PlatformPay.ContactField.PostalAddress], requiredBillingContactFields: [PlatformPay.ContactField.PhoneNumber] } }

abstract yoke
#

And you say this works fine in the simulator. Do you mean when you run this using an iPhone emulator you see the Apple Pay button.

potent sonnet
#

on iOS Simulator works ok , on TestFlight it shows that error straightAway

#

and in both isPlatformPaySupported always returns true

abstract yoke
#

I have no experience with TestFlight. Only the iOS Simulator and actual iOS Devices. What is the difference there?

potent sonnet
#

TestFlight is just the actual iOS Device the final build

abstract yoke
#

Unfortunately I cannot speak to why it may not be appearing in TestFlight. Is the device properly configured with a Payment Method?

potent sonnet
#

yeah i do use the device for apple pay

#

thank you , we will keep trying