Skip to content

Commit

Permalink
Update sample codes according to 2d14fac
Browse files Browse the repository at this point in the history
  • Loading branch information
diegotid committed Dec 12, 2024
1 parent a538e99 commit dc0fa71
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion callflows/authorization/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The flow triggers as a POST request for an authorization from your application's

Your application's backend needs to include the following parameters in the request body:
- `login_hint`: The login hint to be used by the operator to identify the end-user, in the following format `<identifier_type>:<identifier>`, those being:
- `tel` for phone numbers. The `login_hint` must be a tel URI as defined in [RFC 3966](https://www.rfc-editor.org/info/rfc3966) for global phone numbers without visual separators in [E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en) format, including "+". For example, `tel:+34666666666` or `phone_number:+34666666666`.
- `tel` for phone numbers. The `login_hint` must be a tel URI as defined in [RFC 3966](https://www.rfc-editor.org/info/rfc3966) for global phone numbers without visual separators in [E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en) format, including "+". For example, `tel:+34666666666`.
- `ipport` for IPv4 and IPv6 addresses, that can optionally include a port. For example, `ipport:80.90.34.2:16790`, `ipport:80.90.34.2`, `ipport:[2001:db8::1]:8080` or `ipport:[2001:db8::1]`
- `scope`: The scope and purpose of the API call, according to the Open Gateway API product subscribed. It actually includes both the value for the W3C standard DPV purpose and a value for the scope in the following format `dpv:<w3c_purpose>#<scope>`. You can find the proper value for this parameter, for each API, in the API Reference section.

Expand Down
2 changes: 1 addition & 1 deletion callflows/authorization/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Your application's frontend needs to include the following parameters in the req
> 📘 If your are using our Sandbox
> An optional parameter, according to OpenID Connect, `login_hint` must be always passed with the end-user's phone number if you are testing on a production environment. This is a requirement for the Sandbox if you want to test on your real mobile line, which must be whitelisted for privacy reasons. Check the [Sandbox line whitelist](/docs/whitelist) guide for more information.
> - `login_hint`: The login hint to be used by the operator to identify the end-user, in the following format `<identifier_type>:<identifier>`, those being:
> - `tel` or `phone_number` for phone numbers. The `login_hint` must be a tel URI as defined in [RFC 3966](https://www.rfc-editor.org/info/rfc3966) for global phone numbers without visual separators in [E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en) format. For example, `tel:+34666666666` or `phone_number:+34666666666`.
> - `tel` for phone numbers. The `login_hint` must be a tel URI as defined in [RFC 3966](https://www.rfc-editor.org/info/rfc3966) for global phone numbers without visual separators in [E.164](https://www.itu.int/rec/T-REC-E.164-201011-I/en) format. For example, `tel:+34666666666`.
> - `ipport` for IPv4 and IPv6 addresses, that can optionally include a port. For example, `ipport:80.90.34.2:16790`, `ipport:80.90.34.2`, `ipport:[2001:db8::1]:8080` or `ipport:[2001:db8::1]`
#### Handling the response
Expand Down
10 changes: 5 additions & 5 deletions catalog/devicelocation/samplecode_devicelocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", `Basic ${appCredentials}`);
const urlencoded = new URLSearchParams();
urlencoded.append("login_hint", `phone_number:${customerPhoneNumber}`);
urlencoded.append("login_hint", `tel:${customerPhoneNumber}`);
urlencoded.append("scope", apiScope);
const requestOptions = {
Expand Down Expand Up @@ -161,7 +161,7 @@ String apiScope = "dpv:FraudPreventionAndDetection#device-location-read";
HttpClient client = HttpClient.newHttpClient();

Map<Object, Object> data = new HashMap<>();
data.put("login_hint", "phone_number:" + customerPhoneNumber);
data.put("login_hint", "tel:" + customerPhoneNumber);
data.put("scope", apiScope);

StringBuilder requestBody = new StringBuilder();
Expand Down Expand Up @@ -232,7 +232,7 @@ headers = {
}

data = {
"login_hint": f"phone_number:{customer_phone_number}",
"login_hint": f"tel:{customer_phone_number}",
"scope": api_scope
}

Expand Down Expand Up @@ -403,7 +403,7 @@ const params = {
response_type: "code",
scope: apiScope,
redirect_uri: myCallbackEndpoint,
login_hint: `phone_number:${userPhoneNumber}`,
login_hint: `tel:${userPhoneNumber}`,
state: encodeURIComponent(JSON.stringify(deviceLocationParams)) // Using `state` as the parameter that is always forwarded to the redirect_uri
};
Expand Down Expand Up @@ -447,7 +447,7 @@ fetch(url, requestOptions);
accuracy: parseFloat(accuracy)
};
document.getElementById('login_hint').value = 'phone_number:' + phoneInput;
document.getElementById('login_hint').value = 'tel:' + phoneInput;
document.getElementById('state').value = encodeURIComponent(JSON.stringify(deviceLocationParams));
document.getElementById('apiRequestForm').submit();
Expand Down
10 changes: 5 additions & 5 deletions catalog/devicestatus/samplecode_devicestatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", `Basic ${appCredentials}`);
const urlencoded = new URLSearchParams();
urlencoded.append("login_hint", `phone_number:${customerPhoneNumber}`);
urlencoded.append("login_hint", `tel:${customerPhoneNumber}`);
urlencoded.append("scope", apiScope);
const requestOptions = {
Expand Down Expand Up @@ -151,7 +151,7 @@ String apiScope = "dpv:FraudPreventionAndDetection#device-status-roaming-read";
HttpClient client = HttpClient.newHttpClient();

Map<Object, Object> data = new HashMap<>();
data.put("login_hint", "phone_number:" + customerPhoneNumber);
data.put("login_hint", "tel:" + customerPhoneNumber);
data.put("scope", apiScope);

StringBuilder requestBody = new StringBuilder();
Expand Down Expand Up @@ -222,7 +222,7 @@ headers = {
}

data = {
"login_hint": f"phone_number:{customer_phone_number}",
"login_hint": f"tel:{customer_phone_number}",
"scope": api_scope
}

Expand Down Expand Up @@ -383,7 +383,7 @@ const params = {
response_type: "code",
scope: apiScope,
redirect_uri: myCallbackEndpoint,
login_hint: `phone_number:${userPhoneNumber}`,
login_hint: `tel:${userPhoneNumber}`,
state: encodeURIComponent(JSON.stringify(deviceStatusParams)) // Using `state` as the parameter that is always forwarded to the redirect_uri
};
Expand Down Expand Up @@ -421,7 +421,7 @@ fetch(url, requestOptions);
phone_number: phoneInput
};
document.getElementById('login_hint').value = 'phone_number:' + phoneInput;
document.getElementById('login_hint').value = 'tel:' + phoneInput;
document.getElementById('state').value = encodeURIComponent(JSON.stringify(deviceStatusParams));
document.getElementById('apiRequestForm').submit();
Expand Down
10 changes: 5 additions & 5 deletions catalog/deviceswap/samplecode_deviceswap.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", `Basic ${appCredentials}`);
const urlencoded = new URLSearchParams();
urlencoded.append("login_hint", `phone_number:${customerPhoneNumber}`);
urlencoded.append("login_hint", `tel:${customerPhoneNumber}`);
urlencoded.append("scope", apiScope);
const requestOptions = {
Expand Down Expand Up @@ -149,7 +149,7 @@ String apiScope = "dpv:FraudPreventionAndDetection#device-swap";
HttpClient client = HttpClient.newHttpClient();

Map<Object, Object> data = new HashMap<>();
data.put("login_hint", "phone_number:" + customerPhoneNumber);
data.put("login_hint", "tel:" + customerPhoneNumber);
data.put("scope", apiScope);

StringBuilder requestBody = new StringBuilder();
Expand Down Expand Up @@ -220,7 +220,7 @@ headers = {
}

data = {
"login_hint": f"phone_number:{customer_phone_number}",
"login_hint": f"tel:{customer_phone_number}",
"scope": api_scope
}

Expand Down Expand Up @@ -369,7 +369,7 @@ const params = {
response_type: "code",
scope: apiScope,
redirect_uri: myCallbackEndpoint,
login_hint: `phone_number:${userPhoneNumber}`,
login_hint: `tel:${userPhoneNumber}`,
state: encodeURIComponent(JSON.stringify({phoneNumber: userPhoneNumber})) // Using `state` as the parameter that is always forwarded to the redirect_uri
};
Expand Down Expand Up @@ -403,7 +403,7 @@ fetch(url, requestOptions);
function submitForm() {
var phoneNumber = document.getElementById('phone_number').value;
document.getElementById('login_hint').value = 'phone_number:' + phoneInput;
document.getElementById('login_hint').value = 'tel:' + phoneInput;
document.getElementById('state').value = encodeURIComponent(JSON.stringify({ phoneNumber: phoneNumber }));
document.getElementById('apiRequestForm').submit();
Expand Down
10 changes: 5 additions & 5 deletions catalog/knowyourcustomer/samplecode_knowyourcustomer.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", `Basic ${appCredentials}`);
const urlencoded = new URLSearchParams();
urlencoded.append("login_hint", `phone_number:${customerPhoneNumber}`);
urlencoded.append("login_hint", `tel:${customerPhoneNumber}`);
urlencoded.append("scope", apiScope);
const requestOptions = {
Expand Down Expand Up @@ -149,7 +149,7 @@ String apiScope = "dpv:FraudPreventionAndDetection#kyc-match:match";
HttpClient client = HttpClient.newHttpClient();

Map<Object, Object> data = new HashMap<>();
data.put("login_hint", "phone_number:" + customerPhoneNumber);
data.put("login_hint", "tel:" + customerPhoneNumber);
data.put("scope", apiScope);

StringBuilder requestBody = new StringBuilder();
Expand Down Expand Up @@ -220,7 +220,7 @@ headers = {
}

data = {
"login_hint": f"phone_number:{customer_phone_number}",
"login_hint": f"tel:{customer_phone_number}",
"scope": api_scope
}

Expand Down Expand Up @@ -436,7 +436,7 @@ const params = {
response_type: "code",
scope: apiScope,
redirect_uri: myCallbackEndpoint,
login_hint: `phone_number:${userPhoneNumber}`,
login_hint: `tel:${userPhoneNumber}`,
state: encodeURIComponent(JSON.stringify(kycMatchParams)) // Using `state` as the parameter that is always forwarded to the redirect_uri
};
Expand Down Expand Up @@ -480,7 +480,7 @@ fetch(url, requestOptions);
postalCode: postalCode
};
document.getElementById('login_hint').value = 'phone_number:' + phoneInput;
document.getElementById('login_hint').value = 'tel:' + phoneInput;
document.getElementById('state').value = encodeURIComponent(JSON.stringify(kycMatchParams));
document.getElementById('apiRequestForm').submit();
Expand Down
6 changes: 3 additions & 3 deletions catalog/simswap/samplecode_simswap.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", `Basic ${appCredentials}`);
const urlencoded = new URLSearchParams();
urlencoded.append("login_hint", `phone_number:${customerPhoneNumber}`);
urlencoded.append("login_hint", `tel:${customerPhoneNumber}`);
urlencoded.append("scope", apiScope);
const requestOptions = {
Expand Down Expand Up @@ -159,7 +159,7 @@ String apiScope = "dpv:FraudPreventionAndDetection#sim-swap";
HttpClient client = HttpClient.newHttpClient();

Map<Object, Object> data = new HashMap<>();
data.put("login_hint", "phone_number:" + customerPhoneNumber);
data.put("login_hint", "tel:" + customerPhoneNumber);
data.put("scope", apiScope);

StringBuilder requestBody = new StringBuilder();
Expand Down Expand Up @@ -229,7 +229,7 @@ headers = {
}

data = {
"login_hint": f"phone_number:{customer_phone_number}",
"login_hint": f"tel:{customer_phone_number}",
"scope": api_scope
}

Expand Down

0 comments on commit dc0fa71

Please sign in to comment.