0

I am using a plugin on my website to accept Stellar tokens. I want to modify this plugin to accept more than what they have built into the plugin. The plugin uses Stellarterm API to get price conversions and it works great but some tokens aren't listed on Stellarterm so even after adding the token to the plugin, it won't convert a price during checkout. It also appears that support for Stellarterm is gone, as well as support for the plugin I'm modifying.

What free api could I use to accomplish this? The plugin I modified is SWplug and can be found here: https://swplug.com/

It's looking like the solution will be to rebuild Stellarterm myself, or maybe we can do that as a community?

Thanks in advance!

1

You're looking at the problem from the wrong end.

The way Stellar solves this is by using cross-asset payments. You can send funds to someone as one asset, and pay it using another, automatically.

You select which asset you want to receive, and the payer can select how they want to pay for it.

  • I understand what you're saying. Someone can send me SLT and I opt to receive it as XLM correct? If that is what you mean, what I was attempting to state in the OP is, I want customers to be able to choose from a list a coin that they want to use. When they choose this coin, it tells them how much they must pay in that coin. I've gotten as far as choosing the coin, but it won't show how much they have to pay due to the StellerTerm API not having that coin listed in there server. – user1821146 Nov 12 '18 at 14:31
  • Take a look at stellar.github.io/js-stellar-sdk/Server.html#paths. I'd get the user address, and then use a path finding call with the asset and amount that you want to receive. You'll get back a list of the different payment options that are available to the user. Display them, let the user select one, and then do a path payment. – Johan Stén Nov 12 '18 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.