Skip to content

Commit 30b1292

Browse files
committed
Update UpdateClientConfigAPI call parameters to match mobile sdk.
1 parent 776bb74 commit 30b1292

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

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

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

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

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

28-
suspend fun updateClientConfig(
29-
orderId: String,
30-
fundingSource: PayPalWebCheckoutFundingSource
31-
): UpdateClientConfigResult {
28+
suspend fun updateClientConfig(orderId: String): UpdateClientConfigResult {
3229
@RawRes val resId = R.raw.graphql_query_update_client_config
3330
return when (val result = resourceLoader.loadRawResource(applicationContext, resId)) {
3431
is LoadRawResourceResult.Success ->
3532
sendUpdateClientConfigGraphQLRequest(
3633
query = result.value,
37-
orderId = orderId,
38-
fundingSource = fundingSource
34+
orderId = orderId
3935
)
4036

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

4743
private suspend fun sendUpdateClientConfigGraphQLRequest(
4844
query: String,
49-
orderId: String,
50-
fundingSource: PayPalWebCheckoutFundingSource
45+
orderId: String
5146
): UpdateClientConfigResult {
5247
val variables = JSONObject()
5348
.put("orderID", orderId)
54-
.put("fundingSource", fundingSource.value)
55-
.put("integrationArtifact", "PAYPAL_JS_SDK")
49+
.put("fundingSource", "card")
50+
.put("integrationArtifact", "MOBILE_SDK")
5651
.put("userExperienceFlow", "INCONTEXT")
57-
.put("productFlow", "SMART_PAYMENT_BUTTONS")
52+
.put("productFlow", "MOBILE_SDK")
5853
.put("buttonSessionId", JSONObject.NULL)
5954

6055
val graphQLRequest = JSONObject()

0 commit comments

Comments
 (0)