return_url = $return_url; $this->cancel_url = $cancel_url; $this->brand_name = $brand_name; $this->locale = $locale; $this->landing_page = $landing_page; $this->shipping_preference = $shipping_preference; $this->user_action = $user_action; $this->payment_method_preference = $payment_method_preference; } /** * Returns the brand name. * * @return string */ public function brand_name(): string { return $this->brand_name; } /** * Returns the locale. * * @return string */ public function locale(): string { return $this->locale; } /** * Returns the landing page. * * @return string */ public function landing_page(): string { return $this->landing_page; } /** * Returns the shipping preference. * * @return string */ public function shipping_preference(): string { return $this->shipping_preference; } /** * Returns the user action. * * @return string */ public function user_action(): string { return $this->user_action; } /** * Returns the return URL. * * @return string */ public function return_url(): string { return $this->return_url; } /** * Returns the cancel URL. * * @return string */ public function cancel_url(): string { return $this->cancel_url; } /** * Returns the payment method preference. */ public function payment_method_preference(): string { return $this->payment_method_preference; } /** * Returns the object as array. * * @return array */ public function to_array(): array { $data = array(); if ( $this->user_action() ) { $data['user_action'] = $this->user_action(); } if ( $this->shipping_preference() ) { $data['shipping_preference'] = $this->shipping_preference(); } if ( $this->landing_page() ) { $data['landing_page'] = $this->landing_page(); } if ( $this->locale() ) { $data['locale'] = $this->locale(); } if ( $this->brand_name() ) { $data['brand_name'] = $this->brand_name(); } if ( $this->return_url() ) { $data['return_url'] = $this->return_url(); } if ( $this->cancel_url() ) { $data['cancel_url'] = $this->cancel_url(); } if ( $this->payment_method_preference ) { $data['payment_method'] = array( 'payee_preferred' => $this->payment_method_preference, ); } return $data; } }