Skip to content

Commit 12c39a7

Browse files
committed
fix(payment): establish relationship if not yet established
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent af2bbe6 commit 12c39a7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

api/src/main/java/com/getcode/network/repository/PaymentRepository.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,16 @@ class PaymentRepository @Inject constructor(
133133
val organizer =
134134
SessionManager.getOrganizer() ?: throw PaymentError.OrganizerNotFound()
135135

136-
/// 4. Establish a relationship if a domain is provided. If a verifier
136+
// 4. Establish a relationship if a domain is provided. If a verifier
137137
// is present that means the domain has been verified by the server.
138138
val domain = receiveRequest.domain
139-
if (domain != null && receiveRequest.verifier != null && organizer.relationshipFor(domain) != null
140-
) {
141-
client.establishRelationshipSingle(organizer, domain).blockingGet()
139+
if (domain != null) {
140+
if (
141+
receiveRequest.verifier != null &&
142+
organizer.relationshipFor(domain) == null
143+
) {
144+
client.establishRelationshipSingle(organizer, domain).blockingGet()
145+
}
142146
}
143147

144148
// 5. Complete the transfer.

0 commit comments

Comments
 (0)