Create recurring subscriptions with the Accept Blue platform.
npm install @pinelab/vendure-plugin-accept-blue
Create recurring subscriptions with the Accept Blue platform.
addPaymentToOrder
and supplies credit card details:
PaymentSettled
:warning: Set Use test mode
in your payment handler in the admin UI to use Accept Blue in test mode.
These are the different payment methods you can use to pay for an order. Keep in mind that these examples use sample input data.
You can use the query eligibleAcceptBluePaymentMethods
to check what payment methods and card types are enabled. This is configured in Vendure: your Accept Blue API Key should have all methods enabled for this to work.
If a customer already has a payment method saved in Accept Blue, you can use that to pay for an order.
With the hosted tokenization form, you can obtain a token that represents a credit card, and use that to pay for an order. More info on hosted tokenization here: https://docs.accept.blue/tokenization/v0.2
You can fetch payment methods on a customer: on active customer when you are logged in, or on any customer via the Admin API.
To update payment methods, you can use the following mutations. For the Shop API, you need to be logged in as the customer and be owner of the payment method. For the Admin API, you only need to be logged in as an admin and have UpdateCustomer
permissions.
Or for a check payment method:
For creating a a card payment method, you need to use Hosted Tokenization (see Pay with Nonce/Tokenized card
above). After getting a nonce token, you can use the following mutation to create a card payment method. For the Shop API, you need to be logged in. For the Admin API, you need to pass an Accept Blue customer ID into the mutation.
To create a check payment method, you can use the createAcceptBlueCheckPaymentMethod
mutation.
To connect a new payment method to a subscription, you can use the updateAcceptBlueSubscription
mutation.
For the Shop API, you need to be logged in as the customer and be owner of the payment method and the recurring schedule. For the Admin API, you only need to be logged in as an admin and have UpdateOrder
permissions.
After an order is placed, the order.lines.acceptBlueSubscriptions
is populated with the actual subscription values from the Accept Blue platform, so it will not call your strategy anymore. This is to better reflect the subscription that was actually created at the time of ordering.
This means you can now also get the transactions per subscriptions with the field order.lines.acceptBlueSubscriptions.transactions
. To refund a transaction, you first need to get the transaction id.
Only the initial payment is handled as a Vendure payment, any other refunds are done via a dedicated mutation:
The arguments amount
and cvv2
are optional, see the Accept Blue Docs for more info.
You can update created subscriptions in Accept Blue as Admin via de admin-api with UpdateOrder
permissions:
This wil emit an AcceptBlueSubscriptionEvent
of type updated
.
You can use the query acceptBlueSurcharge
to see what surcharges your account has configured.
If you run into CORS issues loading the Accept Blue hosted tokenization javascript library, you might need to remove the cross-origin
key on your script
tag.
This plugin emits an AcceptBlueTransactionEvent
whenever it receives a webhook with a transaction update from Accept Blue.
This plugin also allows you to integration Google Pay. You will need to implement the Google Pay button on your storefront first.
After that, you end up with a token
you receive from Google. Send that data to Vendure like so:
Make sure that your amount equals the amount of the order! The amount is passed in as whole amount, not in cents, because this is how you will receive it from Google.
You can configure the Merchant ID and Gateway Merchant ID on the payment method in Vendure, and fetch them via eligiblePaymentMethods
or eligibleAcceptBluePaymentMethods
.