Edit in GitHubLog an issue

getPaymentSDK query

The getPaymentSDK query gets the payment paypal SDK URLs and other related values.

Syntax

Copied to your clipboard
{
getPaymentSDK(
location: PaymentLocation!
)GetPaymentSDKOutput
}

Example usage

The following example runs the getPaymentSDK query.

Request:

Copied to your clipboard
query {
getPaymentSDK(location: CHECKOUT) {
sdkParams {
code
params {
name
value
}
}
}
}

Response:

Copied to your clipboard
{
"data": {
"getPaymentSDK": {
"sdkParams": [
{
"code": "payment_services_paypal_smart_buttons",
"params": [
{
"name": "src",
"value": "https:\/\/www.paypal.com\/sdk\/js?client-id=..."
}
]
},
{
"code": "payment_services_paypal_apple_pay",
"params": [
{
"name": "src",
"value": "https:\/\/www.paypal.com\/sdk\/js?client-id=..."
}
]
},
{
"code": "payment_services_paypal_google_pay",
"params": [
{
"name": "src",
"value": "https:\/\/www.paypal.com\/sdk\/js?client-id=..."
}
]
},
{
"code": "payment_services_paypal_hosted_fields",
"params": [
{
"name": "src",
"value": "https:\/\/www.paypal.com\/sdk\/js?client-id=..."
},
{
"name": "data-partner-attribution-id",
"value": "MagentoPayments_SP_PCP_Int"
},
{
"name": "data-client-token",
"value": "eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiMTFiZmFjZGM5YWEyM2ZhZjdmNTQwMzc0NGZmYzEwMjI4YjFjODBmZjg4NDdlYjcyMjMyMmM1OTE0MTU3OWYzZHxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9NjNrdm4zN3Z0MjlxYjRkZiZjcmVhdGVkX2F0PTIwMjQtMDItMTNUMTU6Mjc6NTkuNDg5WiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiaWRUb2tlbiI6bnVsbCwiYWNjZXNzVG9rZW4iOiJBMjFBQUlEc1hFbHFlVzh6d1FTTGZsVFdkMHR1UkhIYlBYVTdfYTQzNVFxUVQ5MTRmUjhzclN1RTQzdlg4TnVXV0N1NHZIeUVoVG1BUnhVekdnU3R3VDJCNVFtczBrVjRnIn19"
},
{
"name": "data-expires-in",
"value": "3600"
}
]
}
]
}
}
}

Input attributes

The getPaymentSDK query must contain the following attribute:

AttributeData TypeDescription
location
PaymentLocation!
The origin location for that payment request. The possible values are PRODUCT_DETAIL, MINICART, CART, CHECKOUT, ADMIN

Output attributes

The GetPaymentSDKOutput object must contain the following attributes:

AttributeData TypeDescription
code
String
The payment method code as defined in the payment gateway
params
[SDKParams]
PayPal parameters required to load JS SDK

SDKParams object

The SDKParams object provides details about the SDK parameters:

AttributeData TypeDescription
name
String!
The name of the SDK parameter
value
String!
The value of the SDK parameter
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.