The PaymentIntent object
See original GitHub issueHello, I m trying to get into your Stripe project but have problems with some inconsistencies.
When creating a payment intent the method Stripe.createPaymentSheet expects three variables (paymentIntent, ephemeralKey, customer):
const { paymentIntent, ephemeralKey, customer } = await this.http.post<{
paymentIntent: string;
ephemeralKey: string;
customer: string;
}>(environment.api + 'intent', {}).pipe(first()).toPromise(Promise);
Compared to the expected response found at https://stripe.com/docs/api/payment_intents/object I can not find all appropriate variables.
“id”: “pi_1JKS5a2Tb35ankTn5AFisSig”, “object”: “payment_intent”, “customer”: null, ???
<?php
[…]
\Stripe\Stripe::setApiKey(‘sk_test_…’);
$intent = \Stripe\PaymentIntent::create([ ‘amount’ => 1099, ‘currency’ => ‘eur’, ‘payment_method_types’ => [‘card’], ]);
echo json_encode(array(‘client_secret’ => $intent->client_secret)); ?> ` Which object variables do I have to put into the array for json_encode?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
You re right, sorry. In the meantime I got some help from Stripe und I was able to implement stripe-elements into my project.
@Th-Barth No worries. I’m glad you got it sorted out! Did you use this plugin for production? If yes, please tell us what app. This help development this plugin.
👉 https://github.com/capacitor-community/stripe/issues/145
Thanks.