Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions inc/gateways/class-paypal-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,11 @@

$custom = ! empty($posted['custom']) ? explode('|', (string) $posted['custom']) : [];

if (is_array($custom) && ! empty($custom)) {
// `custom` is built as "payment_id|membership_id|customer_id" (see set_express_checkout()).
if (is_array($custom) && count($custom) >= 3) {
$payment = wu_get_payment(absint($custom[0]));
$membership = wu_get_payment(absint($custom[1]));
$customer = wu_get_payment(absint($custom[2]));
$membership = wu_get_membership(absint($custom[1]));
$customer = wu_get_customer(absint($custom[2]));
}

if ( ! empty($posted['recurring_payment_id'])) {
Expand Down Expand Up @@ -1387,17 +1388,17 @@
$membership->set_gateway_customer_id($details['PAYERID']);
$membership->set_gateway('paypal');

if (Payment_Status::COMPLETED === $payment_status) {

Check warning on line 1391 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected 4 tabs, found 3
$membership->add_to_times_billed(1);

Check warning on line 1392 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 5 tabs, found 4

/*

Check warning on line 1394 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 5 tabs, found 4
* Lets deal with upgrades, downgrades and addons

Check warning on line 1395 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 5 tabs, found 4 tabs and 1 spaces
*

Check warning on line 1396 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 5 tabs, found 4 tabs and 1 spaces
* Here, we just need to make sure we process

Check warning on line 1397 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 5 tabs, found 4 tabs and 1 spaces
* a membership swap.

Check warning on line 1398 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 5 tabs, found 4 tabs and 1 spaces
*/

Check warning on line 1399 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 5 tabs, found 4 tabs and 1 spaces
if ('upgrade' === $cart->get_cart_type() || 'addon' === $cart->get_cart_type()) {

Check warning on line 1400 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected 5 tabs, found 4
$membership->swap($cart);

Check warning on line 1401 in inc/gateways/class-paypal-gateway.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Line indented incorrectly; expected at least 6 tabs, found 5

$membership->renew(true);
} elseif ('downgrade' === $cart->get_cart_type()) {
Expand Down
Loading