#arthuryueh

1 messages · Page 1 of 1 (latest)

frosty lynxBOT
red roost
#

Probably you didn't have any card Payment Methods? Have you checked on your requests log in Stripe Dashboard?

empty merlin
#

Sorry I was trying PayNow

#

I'm using the test key from SG account, the paynow method was also turned on in the Setting.

red roost
#

Yes but did you have transactions using paynow?

#

Could you provide some examples?

empty merlin
#

I don't have transactions

#

Need transactions to get a payment method id ? I thought it was a payment method list query, and it will return id, that's all.

red roost
#

No it will returns all PaymentMethod was actually used in a transaction. The results would be like pm_xxx, pm_yyy .... and the Payment Method objects

empty merlin
#

But The doucment said

Returns a list of PaymentMethods attached to the StripeAccount.  For listing a customer’s payment methods, you should use List a Customer’s PaymentMethods

I just need the payment methods that available for the StripeAccount, and then attach it to a stirpe customer.

red roost
#

Sorry if the wording is confusing, but it means the payment methods has actually been used.

empty merlin
#

Sorry could you explain to me what's the meaning of attaching payment method to a stripe customer ?

I'm currently trying to follow a old process to implement paynow integration. And in the process it will attach a payment method to a stripe customer before create payment intent.

So I think there is no transactions before the customer pays right?

If need transactions to get payment method id, then I don't know how the old process get the payment method id first.

Thank you

red roost
#

Sure, do you have a specific doc that you are following?

#

If it says to attach a payment method to a stripe customer, then you need to somehow collect that payment method beforehand, which is the missing piece here

empty merlin
#

Sorry only got codes.... 🙏

red roost
#

Okie, so you should think "a payment method" is an object, has an ID of pm_xxx and various properties inside. You don't suddenly have that object, you need to collect it beforehand using client-side somehow

empty merlin
#

ok I'll do more research about the process and this document, thank you 🙏

red roost
#

The PaymentMethod and the customer will be bounded (sorry sounds obvious but that's really what it means)

empty merlin
#

Sorry one last question, what will happen if we attach a payment method to a stripe customer ?

Will it show some informations on the stripe customer page ?

If we have created a stripe customer, and when creating payment intent, adding this customer to it. Then the payment method relates to the payment intent and payment intent relates to the customer.

Why there is a way to attach payment method to a stripe customer ?

@red roost

Thank you

red roost
#

Will it show some informations on the stripe customer page ?
Yes

If we have created a stripe customer, and when creating payment intent, adding this customer to it. Then the payment method relates to the payment intent and payment intent relates to the customer.
No the payment method is not attached to the customer after this flow. You would need to either call the Attach Payment Method Id yourself, or in step 2 of creating Payment Intent specify setup_future_usage

Why there is a way to attach payment method to a stripe customer ?
It's a step and merchant can choose to call it or not to call it, based on their preference.

empty merlin
#

Hi @red roost I know why the old process can have payment method id first, it first calls POST /v1/payment_methods and get the id from response.

Thanks

red roost
#

But what information you pass in in that call?

empty merlin
#

@red roost

red roost
#

That's to pass a card and it's really insecure because it have Card Number directly on your server. It's only a demonstrate purpose code and should never be used

#

unless you are PCI DSS compliant

empty merlin
#

But if I use this with type=paynow, then it's ok right ? @red roost

red roost
#

Then what do you pass in along side with it?

#

Do you have sample request id? req_xxx

empty merlin
#

I just need the payment method id, so I've tried

curl https://api.stripe.com/v1/payment_methods \                
  -u sk_test_xxxxxx: \
  -d type=paynow

And I got the id from the response.

{
  "id": "pm_1LmuL2AZHN2I64zmNxI46eJX",
  "object": "payment_method",
  "billing_details": {
    "address": {
      "city": null,
      "country": null,
      "line1": null,
      "line2": null,
      "postal_code": null,
      "state": null
    },
    "email": null,
    "name": null,
    "phone": null
  },
  "created": 1664348748,
  "customer": null,
  "livemode": false,
  "metadata": {},
  "paynow": {},
  "type": "paynow"
}
red roost
#

Oh I see. But I think later when you create and confirm the PaymentIntent, it won't success until your customer scan the generated QR code

#

You can try at Test mode