Questions tagged [square]

Square APIs lets developers process payments online & in-person as well as accessing different information in Square merchant accounts.

Square offers Rest APIs for accessing merchant account data (with their permission of course!) as well as e-commerce. You can also integrate with Square's hardware in your mobile devices with the Point of Sale API for Android, iOS and the web.

Learn more about Square's offerings for developers at Square.com/developers

657 questions
165
votes
8 answers

How can I handle empty response body with Retrofit 2?

Recently I started using Retrofit 2 and I faced an issue with parsing empty response body. I have a server which responds only with http code without any content inside the response body. How can I handle only meta information about server response…
Yevgen Derkach
  • 1,688
  • 2
  • 11
  • 10
75
votes
5 answers

Retrofit - @Body parameters cannot be used with form or multi-part encoding

I m trying to make a request in which I want to include a Header , a form-urlencoded field and a json body. My Retrofit interface is as follows @FormUrlEncoded @POST("/api/register") Observable register( …
Chris
  • 1,641
  • 1
  • 16
  • 17
61
votes
7 answers

How to specify a default user agent for okhttp 2.x requests

I am using okhttp 2.0 in my Android app and didn't find a way to set some common User Agent for all outgoing requests. I thought I could do something like OkHttpClient client = new OkHttpClient(); client.setDefaultUserAgent(...) ...but there's no…
dimsuz
  • 8,969
  • 8
  • 54
  • 88
24
votes
7 answers

Square LeakCanary Cannot find symbol

build.gradle has been configured as per github insturctions.LeakCanary class doesn't seem to be included. dependencies { debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3' releaseCompile…
WenChao
  • 3,586
  • 6
  • 32
  • 46
21
votes
5 answers

How does Square's CardCase app automatically populate the user's details from the address book?

Square's new card case iOS app has a "Create Account" feature. Tap it and it shows a form PREPOPULATED with the user's entry from the Address book. How is this possible? Anyone know? I thought this was unpossible, to get the user's info this way.…
Genericrich
  • 4,611
  • 5
  • 36
  • 55
20
votes
3 answers

Custom converter to subclass with Moshi

I have a User class. And two subclasses. Parent and Child. I get json from my server with {"user":"..."} and need to convert it to parent or to child depending on user.type As I understand I need to add custom converter this way: Moshi moshi…
Defuera
  • 5,356
  • 3
  • 32
  • 38
14
votes
4 answers

How to use SSL in Square MockWebServer?

I try to enable SSL on Square's MockWebServer to mock all webservice calls in my Android App under Test. I want to enable SSL to get the same errors like under real conditions. I don't want to disable SSL for the tests or implement a SSL-ignoring…
StefanTo
  • 971
  • 1
  • 10
  • 28
11
votes
1 answer

Square Flow + Mortar tablet examples

I've been experimenting with using flow and mortar as an alternative architecture for our Android apps. I've been working on an app which at the minute is only a single phone layout, but I was wondering how the flow and mortar architecture might…
matto1990
  • 3,766
  • 2
  • 27
  • 32
9
votes
1 answer

Retrofit 1.9 with OkHttp 2.2 and interceptors

I thought that these recent versions were supposed to be compatible. There is this tweet; https://twitter.com/JakeWharton/status/553066921675857922 and the changelog of Retrofit 1.9 mentions it too. However when I try this: OkHttpClient…
dzan
  • 425
  • 3
  • 14
9
votes
1 answer

Dagger scopes in Android

Jake Wharton's talk at Devoxx 2013, Architecting Android Applications with Dagger, talked about creating a Dagger scope for logged in users only. This sort of thing sounds really clean, and I want to do this in my applications. The code that was…
Bradley Campbell
  • 9,298
  • 6
  • 37
  • 47
8
votes
2 answers

Android-Studio-1.2.RC Proguard warnings on Square's Okio library reference

WIth Android Studio: 1.2.RC I enabled proguard in .gradle: ``` minifyEnabled=true and added these rules to my proguard-rules.pro: -dontwarn com.squareup.** -dontwarn okio.** and added these lint rules to my .gradle file: warningsAsErrors…
Bodhi Hu
  • 196
  • 4
  • 11
7
votes
2 answers

How can I fix the Lighthouse returned error: NOT_HTML. The page provided is not HTML (served as MIME type ) error for square/weebly website?

I am trying to use PageSpeed Insights in Google Search Console for Weebly/Square website and getting an error: Lighthouse returned error: NOT_HTML. The page provided is not HTML (served as MIME type ) It worked for me at the beginning (I tested 2-3…
7
votes
4 answers

Retrofit call returning 400, cURL request working perfectly fine, syntax issue

I've tried making a retrofit call to an API endpoint, but it's returning a 400 error, however my curl request is working perfectly fine. I can't seem to spot the error, could someone double check my work to see where I made a mistake? The curl call…
DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
7
votes
1 answer

Chaining Retrofit services w/ RxJava support

I am having trouble with chaining observables using retrofit's RxJava support. I'm probably misunderstanding how to use it, otherwise it could be a bug in retrofit. Hopefully someone here can help me understand what's going on. Edit: I am using the…
Bradley Campbell
  • 9,298
  • 6
  • 37
  • 47
6
votes
0 answers

URL/Deeplink to send money using CashApp

I am trying to integrate CashApp's P2P payment services for an iOS app. I can't find any SDKs to make things easy online, so I've recently accepted that using deep-links might be fine for now. I found this post URL to open a CashApp payment? which…
1
2 3
43 44