stellar / stellar-protocol

Developer discussion about possible changes to the protocol.
525 stars 303 forks source link

SEP-6 / SEP-24: Add support for extra values #593

Closed yuriescl closed 4 years ago

yuriescl commented 4 years ago

There's currently no mention of extra values to be passed to deposit and withdraw endpoints in SEP-6 and SEP-24. For example, if the Wallet wants to pass some additional fields (ex: payment_method, beneficiary_first_name, etc) to /withdraw (SEP-6) or /transactions/deposit/withdraw (SEP-24), there's no standard way of doing it. It might be a good idea to add a field like extras, or put a note saying Anchors are free to specify extra fields.

marcinx commented 4 years ago

Hey @yuriescl !

I think you can do that by specifying your additional parameters in the fields attribute of the /info endpoint on your transfer server: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md#info (Or maybe I am misunderstanding something :)

Cowrie is doing it like this (https://api.cowrie.exchange/transfer/info):

{
   "deposit":{
      "NGNT":{
         "enabled":true,
         "authentication_required":false,
         "fee_fixed":100,
         "fields":{
            "email_address":{
               "description":"your email address for transaction notifications",
               "optional":true
            },
            "amount":{
               "description":"amount in NGN that you plan to deposit",
               "optional":true
            },
            "type":{
               "description":"type of deposit to make",
               "choices":[
                  "bank"
               ]
            }
         }
      }
   },
   "withdraw":{
      "NGNT":{
         "enabled":true,
         "authentication_required":false,
         "fee_fixed":200,
         "types":{
            "bank_account":{
               "fields":{
                  "email_address":{
                     "description":"your email address to send notifications",
                     "optional":true
                  },
                  "dest":{
                     "description":"your NUBAN bank account number"
                  },
                  "dest_extra":{
                     "description":"your bank name",
                     "choices":[
                        "AccessBank",
                        "CitiBank",
                        "DiamondBank",
                        "Ecobank",
                        "EnterpriseBank",
                        "FCMB",
                        "FidelityBank",
                        "FirstBank",
                        "GTBank",
                        "Heritage",
                        "JaizBank",
                        "KeystoneBank",
                        "ProvidusBank",
                        "SkyeBank",
                        "Stanbic",
                        "StandardChartered",
                        "SterlingBank",
                        "SuntrustBank",
                        "UBA",
                        "UnionBank",
                        "UnityBank",
                        "WemaBank",
                        "ZenithBank"
                     ]
                  }
               }
            }
         }
      }
   },
   "transactions":{
      "enabled":true
   }
}
yuriescl commented 4 years ago

@marcinx Thanks!