strangerstudios / pmpro-ccbill Goto Github PK
View Code? Open in Web Editor NEWCCBill Gateway for Paid Memberships Pro
Home Page: https://www.paidmembershipspro.com/add-ons/ccbill/
CCBill Gateway for Paid Memberships Pro
Home Page: https://www.paidmembershipspro.com/add-ons/ccbill/
=== Paid Memberships Pro - CCBill Add On === Contributors: strangerstudios Tags: paid memberships pro, payment gateway, ccbill Requires at least: 5.5 Tested up to: 6.6 Stable tag: 0.5.1 Adds the ability to accept payments using the CCBill Payment Gateway == Description == Adds CCBill as a payment gateway to your list of accepted payment gateways. CCBill makes use of an off-site payment method process. This Add On is currently in Beta. [Read the full documentation for the CCBill Add On](https://www.paidmembershipspro.com/add-ons/ccbill-payment-gateway/) = Official Paid Memberships Pro Add On = This is an official Add On for [Paid Memberships Pro](https://www.paidmembershipspro.com), the most complete member management and membership subscriptions plugin for WordPress. == Installation == 1. Make sure you have the Paid Memberships Pro plugin installed and activated. 1. Upload the `pmpro-ccbill` directory to the `/wp-content/plugins/` directory of your site. 1. Activate the plugin through the 'Plugins' menu in WordPress. Navigate to Memberships > Settings > Payment Gateways & SSL and select the CCBill payment gateway. You will then need to fill out the required account credentials to connect your website to the payment gateway. == Frequently Asked Questions == = I found a bug in the plugin. = Please post it in the GitHub issue tracker here: https://github.com/strangerstudios/pmpro-ccbill/issues = I need help installing, configuring, or customizing the plugin. = Please visit our premium support site at http://www.paidmembershipspro.com for more documentation and our support forums. == Changelog == = 0.5.1 - 2024-08-14 = * BUG FIX: Fixed an issue where recurring orders would show an incorrect date. (Thanks @misfist) = 0.5 - 2024-07-15 = * ENHANCEMENT: Added improved support for renewals and renewal failures. (Thanks @misfist for your contribution) * ENHANCEMENT: Added support for "Expired" webhook event types, when a subscription has expired. (@andrewlimaza) * REFACTOR: Adjusted the HTML for the checkout button to support newer versions of PMPro and improved accessibility. (@kimcoleman) = 0.4.2 - 2023-10-05 = * BUG FIX: Fixed an issue where the initialPeriod was incorrectly set for levels with an expiration. = 0.4.1 - 2023-08-15 = * BUG FIX: Fixed an issue where webhook wasn't being verified correctly. = 0.4 - 2023-07-27 = * SECURITY: Fixed a minor issue to verify the webhook received is related to the correct CCBill account. = 0.3 - 2023-05-05 = * BUG FIX: Fixed issue where cancellations in PMPro were not being sent to CCBill. * BUG FIX: Fixed issue where "failed cancellation" emails may be incorrectly sent. * BUG FIX: Handling undefined variable in cancellation webhook code. = 0.2 - 2023-04-09 = * BUG FIX: Only cancel relevant URL on sub cancellation. * BUG FIX: Fixed calculation of the initialPeriod value passed to CCBill. * BUG FIX: Fixed errors in the webhook code. = 0.1 - 2022-10-05 = * Initial Release
CCBill's admin interface can be confusing and our integration requires a lot of different credentials to completely function correctly. We should probably provide more guidance as to how to set the plugin up in the Payment Settings page in addition to whatever plugin set up documentation we provide. This needs more discussion.
Describe the bug
The cancellation event cancels the member's membership rather than just the subscription.
What should happen is that the subscription is canceled so they're no longer billed, but the membership should remain active until the next bill date.
https://github.com/strangerstudios/pmpro-ccbill/blob/dev/webhook.php#L348-L367
To Reproduce
Steps to reproduce the behavior:
Event sent to:
https://{{base_url}}/wp-admin/admin-ajax.php?action=ccbill-webhook&eventType=Cancellation&clientAccnum={{clientAccnum}}&clientSubacc={{clientSubacc}}&eventGroup={{eventGroup}}&validate=true&creationDate=2024-07-14T05:24:49.122Z
Event data sent:
subscriptionId {{subscriptionId}}
transactionId 14621b22-b4a1-4d50-80f7-a4e69eadf8a3
timestamp 2024-07-14T05:20:50.703Z
reason Invalid Input.
source FORM
Screenshots
If applicable, please attach a screenshot to make your issue clearer.
Expected behavior
A clear and concise description of what you expected to happen.
Describe the bug
After installing and activating the Cancel on Next Payment Date Add On, cancelling in PMPro cancels the membership level immediately.
To Reproduce
Steps to reproduce the behavior:
Ticket reference: #552340
Isolating the problem (mark completed items with an [x]):
We need to add in functionality that updates the billing details when making changes on the PMPro Billing Page
We need to take into account:
Hi there,
I have read in the description that the plugin is not complete. is it still the case? i really need to integrate ccbill to my webiste.
Your help is much appreciated.
Describe the bug
When a user changes their membership level, it correctly changes the membership and subscription on the site, but doesn't remove the previous subscription. This would cause a member to continue being billed for the previous level.
Essentially, a new subscription is successfully created in CCBill, but the old one isn't cancelled.
It's possible that this is related to the fact cancelled subscriptions aren't being cancelled in CCBill.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Expected behavior
The previous subscription should be cancelled in CCBill, so that only the new subscription remains active in CCBill.
Orders for one-time payments (not recurring subscriptions) are being saved with a subscription transaction ID which may be confusing or cause other issues later.
Testing:
When testing payments through ccbill everything works fine but I am receiving an email over and over again. The testing of payment works good and the user is changed to the member status they purchased.
But immediately after the test I start receiving this email over and over again:
Anyone know why I am receiving this email even though the user hasn't cancelled?
Needs to be tested further, but the discount code field is disabled when the plugin is active. Should check:
Describe the bug
Orders created from webhook action, improperly save the date from timestamp.
Timestamp Sent: "1723351963"
Database Entry: 1970-01-01 00:33:44
Order Screen: December 31, 1969 at 4:33 pm
Timestamp Sent: "2024-08-11T04:49:48.159Z"
Database Entry: 1970-01-01 00:33:44
Order Screen: December 31, 1969 at 4:33 pm
Timestamp Sent: "2024-08-11"
Database Entry: 1970-01-01 00:33:44
Order Screen: December 31, 1969 at 4:33 pm
This seems to be caused by formatting the date
Line 20 in fd84a9a
Once that line is removed, the date saves properly if it's sent as a UNIX timestamp.
Incoming Timestamp: "1723351963"
Database Entry: 2024-08-11 04:52:43
Database Entry: August 10, 2024 at 9:52 pm
To Reproduce
Steps to reproduce the behavior:
Screenshots
[If applicable, please attach a screenshot to make your issue clearer.]()
Expected behavior
Orders created through webhook should display correct date.
Isolating the problem (mark completed items with an [x]):
When accessing the webhook handler directly (e.g. https://example.com/wp-content/plugins/pmpro-ccbill/webhook.php ) the plugin causes fatal errors.
We should make sure WP is always loaded like we do in other IPN/webhook handlers:
https://github.com/strangerstudios/paid-memberships-pro/blob/dev/services/ipnhandler.php#L2-L9
Describe the bug
Debug flag isn't working.
As instructed on line 4, use true
instead of 'log'
to indicate events should be logged.
Instructions state:
//set this in your wp-config.php for debugging
//define( 'PMPRO_CCBILL_DEBUG', true );
Code was looking for:
PMPRO_CCBILL_DEBUG === "log"
To Reproduce
Steps to reproduce the behavior:
define( 'PMPRO_CCBILL_DEBUG', true );
to ./wp-config.php
./wp-content/plugins/pmpro-ccbill/logs/ccbill_webhook.txt
Expected behavior
When define( 'PMPRO_CCBILL_DEBUG', true );
is set in ./wp-config.php
, log file should be present and logging incoming webhook event data.
Isolating the problem (mark completed items with an [x]):
Currently there is no functionality to update a user's billing information from the Billing page, even though clicking the "Update Billing" button appears to be working correctly.
We should link to CCBill from the Billing page like we do with PayPal Express, so it's not misleading at least.
Maybe later we can actually update the billing info using their DataLink API.
An email notifying the admin that cancelling the recurring subscription may have failed is being sent incorrectly. It seems to be occurring from both failed cancellations from the Cancel page and successful cancellations via webhook. There may be other cases where it's being sent incorrectly as well.
Cancelling a membership from the account page results in a success message of 'membership has been cancelled' however it does not take effect in CCBill itself.
This issue originates from ticket #491690 (mods only)
Describe the bug
Successful renewals webhook events are not saved as a member order.
To Reproduce
Steps to reproduce the behavior:
RenewalSuccess
eventSubscription ID: 0220000000000000002
Event: RenewalSuccess
Response Code: 200
URL: https://example.com/wp-admin/admin-ajax.php?action=ccbill-webhook
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ENSEventMessage
clientAccnum="940000"
clientSubacc="01"
eventType="RenewalSuccess"
eventGroup="Subscription"
creationDate="20240517201114"
validate="true">
<subscriptionId>0224108301000365797</subscriptionId>
<transactionId>0124138501000194835</transactionId>
<timestamp>2024-05-17 20:11:14</timestamp>
<accountingAmount>3.00</accountingAmount>
<accountingCurrency>USD</accountingCurrency>
<accountingCurrencyCode>840</accountingCurrencyCode>
<billedAmount>3.00</billedAmount>
<billedCurrency>USD</billedCurrency>
<billedCurrencyCode>840</billedCurrencyCode>
<cardType>VISA</cardType>
<clientAccnum>942299</clientAccnum>
<clientSubacc>0010</clientSubacc>
<expDate>1024</expDate>
<last4>3992</last4>
<nextRenewalDate>2024-06-16</nextRenewalDate>
<paymentAccount>720b797f2ee582eb1000000319514b5</paymentAccount>
<paymentType>CREDIT</paymentType>
<renewalDate>2024-05-17</renewalDate>
</ENSEventMessage>
In ./pmpro-ccbill/webhook.php
, RenewalSuccess
event case is run
Code looks for X-pmpro_orderid
in response, which doesn't exist
new MemberOrder( $order_id )
fails because $order_id
is undefined
Expected behavior
RenewalSuccess event should create a new order for the user's membership.
Isolating the problem (mark completed items with an [x]):
WordPress Environment
version: 6.5.3
site_language: en_US
user_language: en_US
timezone: America/Los_Angeles
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: undefined
environment_type: production
user_count: 14
dotorg_communication: true
server_architecture: Linux 5.15.0-97-generic x86_64
httpd_software: Apache
php_version: 8.1.27 64bit
php_sapi: cgi-fcgi
max_input_variables: 1000
time_limit: 120
memory_limit: 256M
max_input_time: -1
upload_max_filesize: 512M
php_post_max_size: 512M
curl_version: 7.68.0 OpenSSL/1.1.1f
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true
current: 2024-05-18T03:44:13+00:00
utc-time: Saturday, 18-May-24 03:44:13 UTC
server-time: 2024-05-17T20:44:11-07:00
extension: mysqli
server_version: 8.0.34-0ubuntu0.22.04.1
client_version: mysqlnd 8.1.27
max_allowed_packet: 33554432
max_connections: 200
</details>
PHP Parse error: syntax error, unexpected token "," in /*************************/pmpro-ccbill-0.1/webhook.php on line 160
Cancelling a recurring subscription from PMPro's Cancel page fails to cancel the subscription, even though PMPro displays a success message. The membership is successfully cancelled.
PMPro then sends an email saying the subscription may not have been cancelled.
This came up in a support thread (mods only) https://www.paidmembershipspro.com/forums/topic/i-have-configured-ccbill-with-the-main-account-how-do-i-setup-the-sub-accounts/
Perhaps we can add a global sub-account and then a field per level where you can specify a sub-account for that specific level.
CCBill doesn't seem to support this interval
To reproduce, either try to enable this plugin with PMPro enabled or disable PMPro with this plugin enabled.
I am getting this issue when trying to test this.
"There are JavaScript errors on the page. Please contact the webmaster."
When CCBill is set as the primary gateway, the "Next step: Set up your SSL certificate and payment gateway." is displayed on all PMPro settings pages.
Website IP Address is required when setting up a Datalink user. Showing this IP address on the settings page will be make it easier to get setup
https://kb.ccbill.com/Data+Link+Extract+System+User+Guide
Initial Period (integer) | Length of the first billing period. The initial period denotes the trial period if the subscription began with a trial. |
---|
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.