how to receive Issuer field from payment method of Stripe API - stripe-payments

When I visit show page of Payment Method (pm_1MZe3SEoS7yEEpyZtE8jW9JC) from dashboard.stripe .com then I can see the "Issuer" field that equal "Stripe Payments UK Limited", but CAN NOT receive this data from Stripe API.
use stripe-ruby client
use last api version: 2022-11-15
screenshots:
show page of Payment Method
require 'stripe'
Stripe.api_key = "api_key"
payment_method = Stripe::PaymentMethod.retrieve('pm_1MZe3SEoS7yEEpyZtE8jW9JC')
payment_method.?

could you please insert documentation API are you reading?
generally, it is not obvious that this information is exposed by API, so you have to read documentation before.

Related

Problems in attaching a PaymentMethod to a Customer using Stripe API and cfhttp

Following the Stripe documentation, which uses curl, I have tried the code:
<cfhttp method = "POST" url="https://api.stripe.com/v1/payment_methods/pm_1LCuutGKxC2502V8WNrkE3Ja" result = "result">
<cfhttpparam type="header" name="Authorization" value="Bearer sk_test_51....">
<cfhttpparam type="FormField" name="customer" value = "cust_admin_1">
.....
</cfhttp>
where pm_1LCuutGKxC2502V8WNrkE3Ja is the Payment Method id from the JSON response when the card payment method was set up.
The above code gives the error:
You cannot attach a PaymentMethod to a Customer during PaymentMethod creation. Please instead create the PaymentMethod and then attach it using the attachment method of the PaymentMethods API.
Of course the PaymentMethod had already been created, and indeed if I change the ID slightly I get the message
No such PaymentMethod: pm_1LCuutGKxC2502V8WNrkE3Ja22
as would be expected.
Thanks in advance for any comments.
The customer parameter isn't available when updating an existing Payment Method object. If you're looking to attach a Payment Method to a Customer, you should instead use this endpoint.
Please note that the attach endpoint cannot facilitate 3DS authentication flows in the likely event that the bank/issuer requests authentication. It is therefore not recommended you create and attach Payment Methods this way, but instead use Setup Intents.

Can I fetch Transfers associated with a Stripe Payout?

When I receive a payout created or paid webhook from Stripe, and I have the payout id, is there a way to fetch all the transfers that were created for that payout?
I can fetch the payout like this
var service = new PayoutService();
var payout = await service.GetAsync("po_1KJOuO***********h8S");
It looks like the payout has a "BalanceTransaction" property, but I'm not sure if it would contain "Transfers" as I don't see it in the Stripe docs
For transfers related to a specific Payout you can specify the type attribute in your request to the Balance Transactions API /v1/balance_transactions. You can also expand the source attribute on the Balance Transaction object to get the related payout object as well in a single request.
Below is an example of how you make this request in Python using the official Stripe library
transfers = stripe.BalanceTransaction.list(
payout=payout.id,
type="transfer",
expand=["source"],
)

Stripe TypeError: Cannot read property 'payment_intent' of undefined

I'm integrating the payment methods to the app with Stripe and Paypal and now working on Stripe integration.
The backend is Node, Sails.js, and the frontend is React.js.
I followed the guide they provided but and tested the payment processing using testing card.
But I got the error, which says TypeError: Cannot read property 'payment_intent' of undefined.
Here is my code.
- Frontend
this.props.stripe.createPaymentMethod({
type: 'card',
card: cardElement,
}).then(({paymentMethod}) => {
// API call
})
- Backend
subscribe = await stripe.subscriptions.create({
customer: customerId,
items: [
{price: plan.stripe.stripeId},
],
expand: ['latest_invoice.payment_intent']
});
Please help me to fix this issue.
In my opinion you don't have to create the PaymentIntent per subscrition.
Here is what Stripe API docs says about paymentIntent.
A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session.
So they recommend to create the paymentIntent per transaction and in subscription case, the payment is proceed in background automatically and paymentIntent is also generated in my experience.
But on the other hand in checkout option, you need to create the paymentIntent first before proceeding the payment.
I think you code was not wrong but I think you didn't follow the correct guide from Stripe or used wrong credit card.
Please refer this link:
Stripe API Payment_intents

How to use this Guesty Api and how to get data from it

I m using guesty.com api.
Adding a a payment about reservation
see this link
https://docs.guesty.com/#update-a-reservation
anyone can tell me what is the
"stripePaymentMethodToken" here
In order to create a Stripe token you'll need to send a call to Stripe using Guesty’s public Stripe key: pk_live_P0FSIEtbwU1GSvgvEM3DYuUZ, than send the received object to POST https://api.guesty.com/api/v2/guests//payment-methods

why is the node paypal payer_id is not being returned

In my node app the paypal response is not sending me a payer_id param
[ { field: 'payer_id', issue: 'Required field missing' } ]
what am i missing?
thanks
Ian
#iancrowther If you would not mind elaborating more, what stage are you needing the payer_id?
1) If you were trying to accept a payment via paypal, you direct the user to the approval_url on PayPal so that user can approve the payment. After the user approves the payment, PayPal redirects the user back to the return_url you specified, and appends the payer ID in return url as PayerID. The documentation for the requests are at
https://developer.paypal.com/webapps/developer/docs/integration/web/accept-paypal-payment/#execute-the-payment
2) If you are storing a credit card in vault for secure storage and charging later, you can include a unique payer_id in the request. The docs are at
https://developer.paypal.com/webapps/developer/docs/integration/direct/store-a-credit-card/

Resources