@@ -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