@@ -25,13 +25,17 @@ internal class UpdateClientConfigAPI(
25
25
ResourceLoader ()
26
26
)
27
27
28
- suspend fun updateClientConfig (orderId : String ): UpdateClientConfigResult {
28
+ suspend fun updateClientConfig (
29
+ orderId : String ,
30
+ fundingSource : PayPalWebCheckoutFundingSource
31
+ ): UpdateClientConfigResult {
29
32
@RawRes val resId = R .raw.graphql_query_update_client_config
30
33
return when (val result = resourceLoader.loadRawResource(applicationContext, resId)) {
31
34
is LoadRawResourceResult .Success ->
32
35
sendUpdateClientConfigGraphQLRequest(
33
36
query = result.value,
34
- orderId = orderId
37
+ orderId = orderId,
38
+ fundingSource = fundingSource
35
39
)
36
40
37
41
is LoadRawResourceResult .Failure -> UpdateClientConfigResult .Failure (
@@ -42,14 +46,15 @@ internal class UpdateClientConfigAPI(
42
46
43
47
private suspend fun sendUpdateClientConfigGraphQLRequest (
44
48
query : String ,
45
- orderId : String
49
+ orderId : String ,
50
+ fundingSource : PayPalWebCheckoutFundingSource
46
51
): UpdateClientConfigResult {
47
52
val variables = JSONObject ()
48
53
.put(" orderID" , orderId)
49
- .put(" fundingSource" , " card " )
50
- .put(" integrationArtifact" , " MOBILE_SDK " )
54
+ .put(" fundingSource" , fundingSource.value )
55
+ .put(" integrationArtifact" , " PAYPAL_JS_SDK " )
51
56
.put(" userExperienceFlow" , " INCONTEXT" )
52
- .put(" productFlow" , " MOBILE_SDK " )
57
+ .put(" productFlow" , " SMART_PAYMENT_BUTTONS " )
53
58
.put(" buttonSessionId" , JSONObject .NULL )
54
59
55
60
val graphQLRequest = JSONObject ()
0 commit comments