Templates
Template Setup Guides

Magpie Payment GW Plugin

Link to plugin page: https://zeroqode.com/plugin/magpie-payment-plugin-1567769536887x690608670298867800

Introduction

The Magpie GW Plugin gives the ability to create customer account, create a card token, manage payments and account preferences. Uses HTTP methods and a RESTful endpoint structure .

Prerequisites

You must have an account with Magpie to interact with the API.

Initial Setup

  1. Create account on Magpie to interact with API

  2. Go to Developers tab to access API Keys

3. After plugin installation, enter your Private Key in the Username field in plugin Settings

4. You're all set to use plugin Actions.

Plugin Actions

Credit Card actions:

  1. Create a card token

Creates a single use token that wraps the details of a credit card. These tokens can only be used once: by creating a new charge, or attaching them to a customer. To create a token card you need your public key found in Magpie Dashboard, under the API Keys tab.

Parameters:

  • card -The card a token will represent.

Reference documentation (https://magpie.im/documentation/#operation/createToken).

2. Retrieve a token.

Retrieves the token with the given ID. Use your public key found in Magpie Dashboard, for this action.

Parameters:

  • token_id— The ID of the token to retrieve.

Reference documentation (https://magpie.im/documentation/#operation/retrieveToken).

Customer actions:

  1. Create a customer

Creates a new customer object with the given credentials: user’s email and some description.

Parameters:

  • email — (Required) Email address

  • description — (Required) A description of this account. Could be the name of the customer (ex: Juan de la Cruz), or any arbitrary text (ex: Created by App for Juan de la Cruz).

Reference documentation (https://magpie.im/documentation/#operation/createCustomer).

2. Retrieve a customer.

Retrieves the details of an existing customer. You need only to supply the unique customer identifier that was returned upon customer creation.

  • customer_id —The ID of the customer to retrieve.

Reference documentation (https://magpie.im/documentation/#operation/retrieveCustomer).

3. Update a customer

Updates the specified customer by setting the source parameter (i.e. a card ID), the card will be added to the customer’s payment sources.

This operation is required, because it binds a card to a customer, without this action it will be impossible to use the transaction action.

  • customer_id — The ID of the customer to update.

Reference documentation (https://magpie.im/documentation/#operation/updateCustomer).

4. Delete a customer.

Permanently delete a customer.

This cannot be undone.

Parameters:

  • customer_id — The ID of the customer to delete.

Reference documentation (https://magpie.im/documentation/#operation/deleteCustomer).

5. Delete customer fund source

Deletes a customer’s fund source.

Parameters:

  • customer_id — The ID of the customer to delete fund source from.

  • card_id — The ID of the fund source to delete.

Reference documentation (https://magpie.im/documentation/#operation/deleteCustomerFundSource)

Demo to preview the settings: