File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,28 @@ gem 'square.rb', '~> 44.0.0'
2828
2929For more information, see [ Using the Square Ruby SDK] ( https://developer.squareup.com/docs/sdks/ruby/using-ruby-sdk ) .
3030
31+ ``` ruby
32+ require " square"
33+
34+ square = Square ::Client .new (
35+ token: ' YOUR_API_KEY'
36+ )
37+
38+ image_file = Square ::FileParam .from_filepath(
39+ filepath: fixture_path(" small.png" ),
40+ content_type: " image/png"
41+ )
42+
43+ response = square.invoices.create_invoice_attachment(
44+ invoice_id: " inv:0-ChA4-3sU9GPd-uOC3HgvFjMWEL4N" ,
45+ request: {
46+ idempotency_key: SecureRandom .uuid,
47+ description: " A test invoice attachment"
48+ },
49+ image_file: image_file
50+ )
51+ ```
52+
3153## Legacy SDK
3254
3355While the new SDK has a lot of improvements, we at Square understand that it takes time to upgrade when there are breaking changes.
You can’t perform that action at this time.
0 commit comments