#Custom payment Provider
113 messages Β· Page 1 of 1 (latest)
you are missing static identifier = "wallet-provider" or the name you want
Also, I suggest you to look at the stripe plugin if you feel like it
i added it but still not working i am also using stripe plugin in addition to it is there any restriction on multiple payment providers and also i can directly run the backend or do i need to do something before starting the backend? @civic delta
you need to build and then start
got it after i build and started its working i am using nodemon for dev seems like its not working for this current scenario
nodemon --watch './src/**/*.ts' --exec ts-node ./src/main.ts
You should exec build and run. Also, run from dist/main.js
Thank you!
this.options_ = options
it showing a linter error if i trying to access this option in extended payment service
is it normal or am i doing something wrong?
And what does the error says?
@civic delta if i am using the custom payment provider should i use custom store front or next js will support. i just dupliacted the manual payment service from the code and excecuted.. the store front throws the error with no "paymenSession.provider_id" ?
You might need to update your store to display the payment element/component linked to your provider
In my side, i was able to add payment provider in admin setting.
but in the frontend, I am getting issue "paymentSession"..
This is error screen after I put billing address and click checkout.
have you updated your payment info map?
where should I update it?
you can look where it is imported from and it just open
I have not changed storefront code. I just added payment service in the backend.
Like this
Yes, but you have to update your store front to display your provider and give the user the ability to select it
@civic delta May I ask one more thing?
After that, what should I do? can you please explain some next steps that I need to pass?
Now, you should be able to select the provider, it will set it has active on your cart and set it has initiated while communicating with the provider. But you should be able to use it now unless there is a bug in your implementation
may i know in which file it is loacted @balmy ridge
okayyy!
Now when I click "my custom provider item", it does not show any element, but before that, it has 500 server issue.
@civic delta is there any issue here? thank you
Does this require "createPayment" method in backend service?
Yes you need to implement all the methods
okay, then do you think everything should be ok once I finalize all the methods only?
It should yes
I don't see anything else to do as of now
Once the 1.8 is released, you might want to migrate to the payment processor API (easier to implement) and you will be able to look at stripe and paypal plugins that will have been migrated
awesome but when is eta of release 1.8?
I don't have the exact ETA but it should be in the coming weeks
that's great. π₯³
Here, I have one question.
How to pass option values into contructor? which means is where I should call this class?
the second argument of the constructor are the plugin options π
You would need to create a plugin from your service.
so in your medusa-config, in the plugins, you have your plugin and you can pass the options
the second option is to create a new object in project-config. the second arg of the constructor will be the config. and you can then retrieve it from there. If I am right
oh. so I need to create on plugin... but basically I am going to start on backend itself. in this case, I need to put option variables directly on constructor right?
You can hardcode them now if you want, yes.
Very nice π
Hi, Here, I found wired thing.
In the storefront, I can see 10$ as subtotal and 20$ as total, but I can see 2000, 1000 in session.
what's wrong?
also, as you can see, its payment amount is always 2500 EURO
even though I changed currency EUR to USD.
The payment number is also wrong..
it should be 20$.
I am not sure what's my wrong.
The amount are always manipulated as cents on the server, so all amounts are cents, if your provider expect the amount in the currency you should divide by 100. Stripe and paypal take the amount in cents for example (https://stripe.com/docs/api/payment_intents)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok..
how about this?
I changed it in admin panel
Yes, I did it
but in admin panel, if admin change currency from EUR to USD, the payment intent session is also need updated?
if your region change its currency there is an issue, in France the last time the currency has changed was in 2000
but yes indeed, in that case you can create a subscriber and get all active carts and update the initiated payment session. But I think that if the currency changed, you need to inform your customer first as they have paid in one currency and then it is another one
Not sure this is a case that happen
ah, I understand..
in that case, we need to notice maintaneous at least to customers..
ok, I got you.
thank you a lot.
I want to change product from EU to NA..
I selected NA option, but product price does not change to NA.
what is the wrong?
It's not relevant to this discussion topic
But probably your cart is in different region
ok. sorry.
Or region is different in local storage.
Can't remember now how nextjs starter sets that.
π I was able to finalize the integration of my custom payment gateway on medusa.
Thank you for all your support.
@civic delta @modern verge @cobalt jetty
I need some help regarding this. I have both the storefront and backend admin code.
I want to create a custom provider for my app and Iβm using Medusa version 1.20.9. I have attached the code files.
Do I need to pull the backend code, or should I only be working in the backend admin code?
Additionally, when creating a custom provider, how can I integrate a payment gateway into the storefront?
I really need serious assistance with this issue. Any help would be greatly appreciated.
Do not ping and DM (π‘) for help. Creating your own thread is enough.
which version of Medusa are you using, I've updated to the latest version and it is different than screenshot. Edit: my bad I thought I was looking at a new thread. It was from 2023.
Sorry π for that