#rdsdaw2022-url-encoding

1 messages ยท Page 1 of 1 (latest)

static root
#

@cosmic fog all parameters need to be url encoded, we don't accept JSON as input

#

really you should use one of our official client libraries to solve that issue for you

cosmic fog
#

where can I find that? I have been able to successfully send payments and payment element gets rendered correctly and paid as well. But we want to add the metadata information. I am having trouble doing this.

#

I followed custom payment steps. it was simple, but I do not know about the client libraries.

static root
#

where can you find what?

#

I'm sorry I'm lost

cosmic fog
#

'really you should use one of our official client libraries to solve that issue', custom client libraries

static root
#

"client libraries" is just how we call our server-side libraries for your language, like stripe-php, stripe-python, etc.

cosmic fog
#

hmm...we do not use php or python. I make request to stripe using plsql

static root
#

let me digest that for a minute

#

how are you hitting our API in PLSQL exactly? Like waht code do you use?

cosmic fog
#

apex_web_service.make_rest_request(
p_url => 'https://api.stripe.com/v1/payment_intents',
p_http_method => 'POST',
p_wallet_path => '################################',
p_wallet_pwd => '#######',
p_parm_name => l_parm_names,
p_parm_value => l_parm_values
);

#

like this

#

I have amount, currency etc as param names and the values in l_param_values

static root
#

hum

cosmic fog
#

apex_web_service.make_rest_request is oracle apex

static root
#

what is p_wallet_path and such what does that even mean?

cosmic fog
#

oh it is oracle permission/path to send request

static root
#

gotcha, can you show me a concrete example of how you pass currency and amount?

#

basically the idea of how you send metadata is an array. So you want to pass metadata[customer_id]=12345

cosmic fog
#

I see. so if I want 2 information to pass in metadata, then it has to be metadata[custid] = 12345 and metadata[custname] = 'abc'?

#

l_parm_names apex_application_global.vc_arr2;
l_parm_values apex_application_global.vc_arr2;

I pass like this

  l_parm_names(1) := 'amount';
  l_parm_values(1) := '50'; 
  
  l_parm_names(2) := 'currency';
  l_parm_values(2) := 'usd';
static root
#

yeah so the name would be metadata[customer_id]

#
l_parm_values(3) := 'aaa';
l_parm_names(4) := 'metadata[order_id]';
l_parm_values(5) := 'bbb';``` or something like this (never used that tool)
cosmic fog
#

ok I will try

#

thank you

#

Thanks it worked for matadata

static root
#

yay

cosmic fog
#

But when I use the same concept for
l_parm_names(7) := 'transfer_data[destination]';
l_parm_values(7) := 'TestAccountID';

#

I get "message": "Received unknown parameter: transfer_data[destination]",
"param": "transfer_data[destination]",

static root
#

can you give me an example request id for me to look at? req_123

cosmic fog
#

unfortunately I do not have access to the dashboard ๐Ÿ˜ฆ

static root
#

ah, I would recommend always doing this with Dashboard access

#

it's near impossible to debug things blindly without any access to logs and errors

#

you're the dev, you can create your own Stripe account, use your own Test API key and debug all of this

cosmic fog
#

but I would need bank account tied to it, right? My manager has his back account tied, and so only he has the access

static root
#

you don't need a bank account to create a Test Stripe account no

#

it takes a few minutes to register for an account, get your Test API key and the rest is history!

cosmic fog
#

let me see

static root
#

but otherwise just pass koopajah as the value for that param

#

I can then find the request log and understand what's going on

cosmic fog
#

ok i will do that now

#

just did that

static root
#

looking

#

you are updating a PaymentIntent. You can't set transfer_data on PI update

#

or rather not transfer_data[destination]

cosmic fog
#

I did login to my personal account in stripe, but to activate it, looks like I need to fill in back details

static root
#

you have to decide this on PI creation

cosmic fog
#

I see

#

thanks so much

static root
#

and you don't need to activate the account to use Test mode

cosmic fog
#

๐Ÿ™‚

#

hmmm really?

static root
#

yes really!

cosmic fog
#

How can i use the account then? more to learn ๐Ÿ™‚

#

thanks a lot koopajah

static root
#

you have an account already, you have Test mode access, you can use the API key from the account no?

cosmic fog
#

ok

#

I see publishable and secret keys

#

I had not seen them before