#Vishal0910-payment-link
1 messages ยท Page 1 of 1 (latest)
sure
I'm not sure if its possible to create a payment link with the source API
Are you following a guide or something ?
ya i asked it via support they said you can use same reciept_email same like PaymentIntent and Charge
but it's not working
Do i have to change API ?
sorry about you question , yes i am able to create link with Source
Apologies for the confusion
I'm not sure how you're able to create a link using Source API
can you share your example code and request ID (should look something like req_xxxx) I can take a look at?
source = Stripe::Source.create(
type: 'ach_credit_transfer', currency: plan.currency.downcase,
owner: { email: payment_link.student_email }, metadata: payment_link.as_json,
receipt_email: "mdhull07@gmail.com"
)
stripe_link = Stripe::PaymentLink.create(
{
line_items: [
{
price: plan.meta.dig(:provider_id),
quantity: 1,
}
],
billing_address_collection: 'required',
metadata: payment_link.as_json(except: [:meta])
})
ach_details = source.ach_credit_transfer
payment_link.update!(meta: {
link: stripe_link.url, id: stripe_link.id, ach_details: {
account_number: ach_details.account_number,
routing_number: ach_details.routing_number,
fingerprint: ach_details.fingerprint,
swift_code: ach_details.swift_code,
bank_name: ach_details.bank_name,
}
})
StripeSource.find_or_create_by!(owner: payment_link).update!(
source_id: source.id
)
Ah okay! so you're creating a source first and then creating a payment link. Got it.
What error are you getting?
reciept_email is undefined
basically i want to send email after succesful payment
reciept_email is used in PaymentIntent/charge so can i used it here also or i have to shift api
ah I see. I don't think that you can set reciept_email on source but let me check something quickly
To clarify, you payment link is a shared link and not user/payment specific -- you're linking customer-specififc info in the metadata only so this would be up to you
Stripe can send receipts following successful payment if you set that setting in your dashboard
Yup ^
You can configure that setting here for successful payments
https://dashboard.stripe.com/settings/emails
A heads up that It won't send the email automatically in testmode
ok will check
This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
hi @weary grove @dry daggeryou have seen above code, if possible can you please suggest alternative stripe api for the same ... i am quite new to stripe api , this task is little time sensitive so difficult to go through whole documentation
which will be best for this case PaymentIntent or Charge
catching up here
if you're time sensitive, then using PaymentLink is the quickest
second is Checkout
last is I'd recommend PaymentElement + PaymentIntents, it is most integration intensive
ok thanks any demo code would be helpfull