WordPress
The state of a WordPress plugin today, and what to use in the meantime.
A WordPress or WooCommerce site can still issue credentials today, because everything a plugin would do is an ordinary HTTP call. The shape is the same as any other integration:
Upsert the member
On registration or on a successful order,
PUT /v1/subjectswith your site's user id asexternalId.Issue
POST /v1/credentialswith the template key for that membership level.Deliver
POST /v1/distributionswithchannel: "email", or show the link in the member's account area.End it
On cancellation or refund,
POST /v1/credentials/{id}/revoke— orsuspendwhile a payment is being retried.
Issuing from PHP
$response = wp_remote_post( 'https://api.nomi-tech.com/v1/credentials', array(
'headers' => array(
'Authorization' => 'Bearer ' . NOMI_API_KEY,
'Content-Type' => 'application/json',
'Idempotency-Key' => 'order-' . $order_id,
),
'body' => wp_json_encode( array(
'subjectId' => $subject_id,
'templateKey' => 'membership_platinum',
'channels' => array( 'apple_wallet', 'google_wallet' ),
) ),
) );