AnsweredAssumed Answered

cURL and Stripe issue

Question asked by duncanbaker on Dec 20, 2017
Latest reply on Dec 21, 2017 by duncanbaker

Hey folks

 

I'm trying to integrate Stripe for taking payments using their API and cURL in FM16. It's kind of working but there's one issue. If I send a string, say description, then in the response I only get the first word before there's a space in the string.

 

In the script step these are the values being used:

URL: "https://api.stripe.com/v1/charges"

cURL: This is actually pointing at a field that contains the following:

-u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \

-d amount=2000 \

-d currency=usd \

-d capture=true \

-d description=Order Number 258490 \

 

There's actually more cURL options being sent but they're not relevant for the issue being looked at here. The response that I get from Stripe is this (again partial):

  "id": "ch_1Bb8o92eZvKYlo2Ci3vLz58Q",

  "object": "charge",

  "amount": 2000,

  "amount_refunded": 0,

  "application": null,

  "application_fee": null,

  "balance_transaction": "txn_1Bb8o92eZvKYlo2CW1Xnuzvy",

  "captured": true,

  "created": 1513781073,

  "currency": "usd",

  "customer": null,

  "description": "Order",

 

Note how the last line only contains "Order" and the rest of what was sent is not there.

 

I've tried putting the value in quotes like this: -d description="Order Number 258490" \

And I end up with this: "description": "\"Order",

 

Anyone got any ideas on what this is about and how to fix?

 

Many thanks

Outcomes