Dies ist der Json Codecod JSON Array PHP Ich möchte ein korrektes Beispiel
{"data":{"user":{"first_name":"xx","last_name":"xx","email":"xx","countryOfResidence":"GB","country":"LK","nationality":"LK"},"billing_address":{"line1":"xx","city":"xx","postal_code":"xx","country":"LK"},"shipping_address":{"first_name":"xx","last_name":"xx","line1":"xx","city":"xx","postal_code":"xx","country":"LK"},"phone":{"type":"Mobile","number":"xx","countryCode":"94"},"marketing_optin":true,"shipping_address_validation":false,"poma_flow":false,"prox_flow":false,"testParams":{},"content_identifier":"LK:en:2.0.287:signupTerms.signupC","card":{"type":"MASTERCARD","number":"xx","security_code":"xx","expiry_month":"xx","expiry_year":"xx"},"skipInitiateAuth":true},"meta":{"token":"xx","calc":"xx","csci":"xx","locale":{"country":"LK","language":"en"},"state":"ui_checkout_guest","app_name":"xoonboardingnodeweb"}}
Dies ist der PHP-Code, den ich den Code in korrekter Art und Weise schreiben möchten, und damit es funktioniert. Ich möchte wissen, wo meine Schuld ist. Kann jemand diese Datei von mir korrigieren? Bitte helfen Sie mit diesem Beispiel deutlich.
$link = "https://www.paypal.com/webscr?cmd=_express-checkout&token=EC-7Y207450BE832821N#/checkout/guest";
$post = "";
$s = _curl($link, json_encode($post), $cookie);
$post = json_encode($array);
$array = json_decode($json_string, true);
$link = "https://www.paypal.com/webapps/xoonboarding/api/onboard/guest";
$post = [
'data' => [
'user' => [
'first_name' => 'xx',
'last_name' => 'xx',
'email' => 'xx',
'countryOfResidence' => 'GB',
'country' => 'LK',
'nationality' => 'lk',
],
'billing_address' => [
'line1' => 'xx',
'city' => 'xx',
'postal_code' => 'xx',
'country' => 'lk',
],
'shipping_address' => [
'first_name' => 'xx',
'last_name' => 'xx',
'line1' => 'xx',
'city' => 'xx',
'postal_code' => 'xx',
'country' => 'lk',
],
'phone' => [
'type' => 'Mobile',
'number' => 'xx',
'countryCode' => '94',
],
'marketing_optin' => true,
'shipping_address_validation' => false,
'poma_flow' => false,
'prox_flow' => false,
'testParams' => [],
'content_identifier' => "LK:en:2.0.287:signupTerms.signupC",
'card' => [
'type' => 'xx',
'number' => xx,
'security_code' => xx,
'expiry_month' => xx,
'expiry_year' => xx,
],
'skipInitiateAuth' => true
],
'meta' => [
'token' => xx,
'calc' => xx,
'csci' => xx,
'locale' => [
'country' => 'LK',
'language' => 'en',
],
'state' => 'ui_checkout_guest',
'app_name' => 'xoonboardingnodeweb',
]
];
$s = _curl($link, json_encode($post), $cookie);
Können Sie diesen Code korrekt? –
Vergleicht man die beiden Strukturen, scheint der PHP-Code korrekt zu sein. Was die HTTP-Anfrage Antwort? – Schnapse
Ich brauche JSON zu Array PHP IN Beispiel –