Log in

hypePaypalPayments

hypePaypalPayments

A wrapper for Paypal's PHP SDK

Webhooks

Configure your Paypal application to send webhooks to /payments/paypal/webhooks" data-qualifier="url" rel="nofollow">https:///payments/paypal/webhooks

To digest a webhook, register a plugin hook handler:

elgg_register_plugin_hook_handler('BILLING.SUBSCRIPTION.EXPIRED', 'paypal', HandleExpiredSubscription::class);

class HandleExpiredSubscription {
    public function __invoke(\Elgg\Hook $hook) {
        $webhook_data = $hook->getParam('data');

        // ... do stuff

        return $result; // Result will be reported back to paypal
    }
}

Paypal Button

To display a pay button:

echo elgg_view_field([
    '#type' => 'paypal/paypal',
    'required' => true,
]);

You can then retrieve the value of the Paypal's payment and payer ID your action:

$payment_id = get_input('paypal_payment_id');
$payer_id = get_input('payer_id');

elgg()->{'payments.gateways.paypal'}->pay($transaction, [
    'paypal_payment_id' => $payment_id,
    'paypal_payer_id' => $payer_id,
]);

Package Releases

VersionRelease Date
hypePaypalPayments 1.1.21.1.2
hypePaypalPayments 1.1.11.1.1
hypePaypalPayments 1.1.01.1.0
hypePaypalPayments 1.0.01.0.0

Changelog

1.1.2 (2018-07-09)

Bug Fixes

  • conf: correctly map environment parameter (cf77143)

1.1.1 (2018-07-06)

Bug Fixes

  • forms: use ajax Form api to verify required paypal authorization (212f245)

1.1.0 (2018-06-29)

Features

1.0.0 (2018-03-19)

Features

  • releases: initial commit (bae765f)

About

Dependencies

Requires
Elgg version >= 3.0
Plugin: hypePayments Any
Plugin: hypeAjax Any
Suggests
Plugin: hypeCountries Any