I\'m trying to implement the API
of PayPal payment
with Laravel 5.1
. But when I log in to PayPal (sandbox)
, it uses the addre
After you have created the payment, try updating the address as shown in this example.
$paymentId = $createdPayment->getId();
$patch = new \PayPal\Api\Patch();
$patch->setOp('add')
->setPath('/transactions/0/item_list/shipping_address')
->setValue([
"recipient_name" => "Gruneberg, Anna",
"line1" => "52 N Main St",
"city" => "San Jose",
"state" => "CA",
"postal_code" => "95112",
"country_code" => "US"
]);
$patchRequest = new \PayPal\Api\PatchRequest();
$patchRequest->setPatches([$patch]);
$result = $createdPayment->update($patchRequest, $apiContext);
I also reviewed this link but it seems like it cannot answer my problem. Also, what if the country has a province? How can we add that?
Use the state codes listed here.