mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
Merge branch 'trunk' into PCP-417-new-feature---pay-upon-invoice
This commit is contained in:
commit
0262549382
5 changed files with 4 additions and 21 deletions
|
@ -69,13 +69,8 @@ class AddressFactory {
|
|||
* @throws RuntimeException When JSON object is malformed.
|
||||
*/
|
||||
public function from_paypal_response( \stdClass $data ): Address {
|
||||
if ( ! isset( $data->country_code ) ) {
|
||||
throw new RuntimeException(
|
||||
__( 'No country given for address.', 'woocommerce-paypal-payments' )
|
||||
);
|
||||
}
|
||||
return new Address(
|
||||
$data->country_code,
|
||||
( isset( $data->country_code ) ) ? $data->country_code : '',
|
||||
( isset( $data->address_line_1 ) ) ? $data->address_line_1 : '',
|
||||
( isset( $data->address_line_2 ) ) ? $data->address_line_2 : '',
|
||||
( isset( $data->admin_area_1 ) ) ? $data->admin_area_1 : '',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue