Skip to content

Commit ec73f11

Browse files
committed
Revert "Update UpdateClientConfigAPI call parameters to match mobile sdk."
This reverts commit d7d02aa.
1 parent 30b1292 commit ec73f11

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

PayPalWebPayments/src/main/java/com/paypal/android/paypalwebpayments/PayPalWebCheckoutClient.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class PayPalWebCheckoutClient internal constructor(
9090
if (request.fundingSource == PayPalWebCheckoutFundingSource.CARD) {
9191
val updateConfigResult = request.run {
9292
updateClientConfigAPI.updateClientConfig(
93-
orderId = orderId
93+
orderId = orderId,
94+
fundingSource = fundingSource
9495
)
9596
}
9697
if (updateConfigResult is UpdateClientConfigResult.Failure) {

PayPalWebPayments/src/main/java/com/paypal/android/paypalwebpayments/UpdateClientConfigAPI.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ internal class UpdateClientConfigAPI(
2525
ResourceLoader()
2626
)
2727

28-
suspend fun updateClientConfig(orderId: String): UpdateClientConfigResult {
28+
suspend fun updateClientConfig(
29+
orderId: String,
30+
fundingSource: PayPalWebCheckoutFundingSource
31+
): UpdateClientConfigResult {
2932
@RawRes val resId = R.raw.graphql_query_update_client_config
3033
return when (val result = resourceLoader.loadRawResource(applicationContext, resId)) {
3134
is LoadRawResourceResult.Success ->
3235
sendUpdateClientConfigGraphQLRequest(
3336
query = result.value,
34-
orderId = orderId
37+
orderId = orderId,
38+
fundingSource = fundingSource
3539
)
3640

3741
is LoadRawResourceResult.Failure -> UpdateClientConfigResult.Failure(
@@ -42,14 +46,15 @@ internal class UpdateClientConfigAPI(
4246

4347
private suspend fun sendUpdateClientConfigGraphQLRequest(
4448
query: String,
45-
orderId: String
49+
orderId: String,
50+
fundingSource: PayPalWebCheckoutFundingSource
4651
): UpdateClientConfigResult {
4752
val variables = JSONObject()
4853
.put("orderID", orderId)
49-
.put("fundingSource", "card")
50-
.put("integrationArtifact", "MOBILE_SDK")
54+
.put("fundingSource", fundingSource.value)
55+
.put("integrationArtifact", "PAYPAL_JS_SDK")
5156
.put("userExperienceFlow", "INCONTEXT")
52-
.put("productFlow", "MOBILE_SDK")
57+
.put("productFlow", "SMART_PAYMENT_BUTTONS")
5358
.put("buttonSessionId", JSONObject.NULL)
5459

5560
val graphQLRequest = JSONObject()

0 commit comments

Comments
 (0)