mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Set pui partner referrals config through filter
This commit is contained in:
parent
9dfa15acfc
commit
61973a6223
2 changed files with 50 additions and 61 deletions
|
@ -72,7 +72,9 @@ class PartnerReferralsData {
|
|||
* @return array
|
||||
*/
|
||||
public function data(): array {
|
||||
return array(
|
||||
return apply_filters(
|
||||
'ppcp_partner_referrals_data',
|
||||
array(
|
||||
'partner_config_override' => array(
|
||||
'partner_logo_url' => 'https://connect.woocommerce.com/images/woocommerce_logo.png',
|
||||
/**
|
||||
|
@ -91,7 +93,7 @@ class PartnerReferralsData {
|
|||
),
|
||||
'show_add_credit_card' => true,
|
||||
),
|
||||
//'products' => $this->products,
|
||||
'products' => $this->products,
|
||||
'legal_consents' => array(
|
||||
array(
|
||||
'type' => 'SHARE_DATA_CONSENT',
|
||||
|
@ -119,27 +121,7 @@ class PartnerReferralsData {
|
|||
),
|
||||
),
|
||||
),
|
||||
"products" => [
|
||||
"PAYMENT_METHODS"
|
||||
],
|
||||
"capabilities" => [
|
||||
"PAY_UPON_INVOICE"
|
||||
],
|
||||
"business_entity" => array(
|
||||
"business_type" => array(
|
||||
"type" => "INDIVIDUAL"
|
||||
),
|
||||
"addresses" => array(
|
||||
array(
|
||||
"address_line_1" => "Parkstr. 26",
|
||||
"admin_area_1" => "Berlin",
|
||||
"postal_code" => "90409",
|
||||
"country_code" => "DE",
|
||||
"type" => "WORK",
|
||||
),
|
||||
),
|
||||
),
|
||||
"tracking_id" => "testenterprices123122",
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,13 @@ class PayUponInvoice {
|
|||
}
|
||||
|
||||
public function init() {
|
||||
add_filter('ppcp_partner_referrals_data', function ($data) {
|
||||
$data['products'][] = 'PAYMENT_METHODS';
|
||||
$data['capabilities'][] = 'PAY_UPON_INVOICE';
|
||||
|
||||
return $data;
|
||||
});
|
||||
|
||||
add_action(
|
||||
'wp_footer',
|
||||
array( $this, 'add_parameter_block' )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue