Update payment method request with email.

This commit is contained in:
Alex Hart 2021-11-17 16:35:43 -04:00 committed by Cody Henthorne
parent 8aea20f147
commit 14aecc4684
2 changed files with 10 additions and 5 deletions

View file

@ -84,9 +84,9 @@ public final class FeatureFlags {
private static final String MAX_GROUP_CALL_RING_SIZE = "global.calling.maxGroupCallRingSize";
private static final String GROUP_CALL_RINGING = "android.calling.groupCallRinging";
private static final String CHANGE_NUMBER_ENABLED = "android.changeNumber";
private static final String DONOR_BADGES = "android.donorBadges.4";
private static final String DONOR_BADGES_MEGAPHONE = "android.donorBadges.megaphone.2";
private static final String DONOR_BADGES_DISPLAY = "android.donorBadges.display.2";
private static final String DONOR_BADGES = "android.donorBadges.5";
private static final String DONOR_BADGES_MEGAPHONE = "android.donorBadges.megaphone.3";
private static final String DONOR_BADGES_DISPLAY = "android.donorBadges.display.3";
private static final String CDSH = "android.cdsh";
/**

View file

@ -96,11 +96,16 @@ class StripeApi(
private fun createPaymentMethod(paymentSource: PaymentSource): Response {
val tokenizationData = paymentSource.parameterize()
val parameters = mapOf(
val parameters = mutableMapOf(
"card[token]" to JSONObject((tokenizationData.get("token") as String).replace("\n", "")).getString("id"),
"type" to "card"
"type" to "card",
)
val email = paymentSource.email()
if (email != null) {
parameters["billing_details[email]"] = email
}
return postForm("payment_methods", parameters)
}