Add a 'Pay with Cohort Go' button to the end of your shopping cart journey will enable a seamless handover from your cart directly through a Cohort Go payment. Through this flow, you can pass a variable amount of information depending upon how much you'd like to customise the student experience.
To initiate a payment, you'll need the referrer key which you can get it from your Cohort Go portal. The payment URL will have a URL like https://sample-agent.cohortgo.app
Assuming that you've generated invoice type, currency and amount as part of your flow, then you'll want to pass that through
to the button. This is done by adding ?a=<amount>&ccy=<currency>&it=<invoice_type>
parameters to your url. For example, if you
amount of $500, then you'd have a URL like https://sample-provider.cohortgo.app?a=500&ccy=AUD&it=tuition
.
Fields that are passed through are still edtiable. To disable/lock fields:
This can be done by including the fields into params _locked
. Forexample, if you want to lock the given_name, family_name, then you;d have a URL like ?_locked=[given_name,family_name]
. In this case, both of fields are now disabled since they are included in the _locked
params.
If your cart has additional information available, this can also be passed through to the payment page via the link.
Specifically, the following fields are the full options that can be sent in a GET query string:
Field | Key | Description | Example |
---|---|---|---|
Completion URL | complete | A URL to return to when the payment flow has been completed. A cps URL param will be included. | ?complete=http://app.example.com |
Cancel URL | cancel | A URL to return to if the flow encounters an issue or the user attempts to cancel. A reason and msg URL param will be included. Reasons include user_initiated , invalid_fingerprint and missing_param | ?cancel=http://app.example.com |
Amount (required) | a | Specify a total amount. | ?a=5000 |
Currency (required) | ccy | The currency of the invoice, i.e. the currency of the Amount field, in ISO 4217 format. See https://en.wikipedia.org/wiki/ISO_4217 | ?ccy=BRL |
Institution Name (required) | in | The name of the institution. | ?in=Learning Centre |
Invoice Type (required) | it | The type of invoice. Must be one of [tuition , living_expenses , accommodation_fees , guardian_fees , other ]. | ?it=living_expenses |
Invoice Document URL | doc | A PDF or image version of the invoice, e.g. a scan of the original invoice. This document will be attached to the payment. Note that if this leave blank, we will ask student to upload first before redirecting them to select payment method page. | ?doc=http://example.org/invoice001.png |
Student Number (required) | sn | The student's id number, assigned by the institution. | ?sn=12345678 |
Completion Date (required) | cd | The date the student will complete their study, in ISO 8601 format. See https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates | ?cd=2030-11-25 |
Email (required) | e | The student's email address. | [email protected] |
Home Country (required) | hc | The student's home country, used to drive the payment options available to the student. Specified as an ISO Alpha-2 country code. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a catalogue of codes. | ?hc=CN |
Destination Country (required) | dc | The student's destination country, used to drive the payment options available to the student. Specified as an ISO Alpha-2 country code. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a catalogue of codes. | ?dc=AU |
Given Name (required) | gn | The student's given name. | ?gn=Albert |
Family Name (required) | fn | The student's family name. | ?fn=Smith |
Date of Birth | dob | The student's date of birth in ISO 8601 format. See https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates | ?dob=1999-11-26 |
Phone Number | p | The student's phone number. | ?p=861083410308 |
Passport Country (required) | pc | The student's passport country. Specified as an ISO Alpha-2 country code. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a catalogue of codes. | ?pc=CN |
Passport Number (required) | pn | The student's passport number. | ?pn=M1234567 |
Locale (required) | locale | The language to be used. | ?locale=en |
See it in action:
If your system has already captured most of the details of a student, you can jump directly to the payment method selection page by submitting these details as a Form POST.
Specifically, the following fields are the full options that can be sent as a POST:
Field | Key | Description | Example |
---|---|---|---|
Completion URL | complete | A URL to return to when the payment flow has been completed. A cps URL param will be included. | ?complete=http://app.example.com |
Cancel URL | cancel | A URL to return to if the flow encounters an issue or the user attempts to cancel. A reason and msg URL param will be included. Reasons include user_initiated , invalid_fingerprint and missing_param | ?cancel=http://app.example.com |
Amount (required) | a | Specify a total amount. | ?a=5000 |
Currency (required) | ccy | The currency of the invoice, i.e. the currency of the Amount field, in ISO 4217 format. See https://en.wikipedia.org/wiki/ISO_4217 | ?ccy=BRL |
Institution Name (required) | in | The name of the institution. | ?in=Learning Centre |
Invoice Type (required) | it | The type of invoice. Must be one of [tuition , living_expenses , accommodation_fees , guardian_fees , other ]. | ?it=living_expenses |
Invoice Document URL | doc | A PDF or image version of the invoice, e.g. a scan of the original invoice. This document will be attached to the payment. Note that if this leave blank, we will ask student to upload first before redirecting them to select payment method page. | ?doc=http://example.org/invoice001.png |
Student Number (required) | sn | The student's id number, assigned by the institution. | ?sn=12345678 |
Completion Date (required) | cd | The date the student will complete their study, in ISO 8601 format. See https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates | ?cd=2030-11-25 |
Email (required) | e | The student's email address. | [email protected] |
Home Country (required) | hc | The student's home country, used to drive the payment options available to the student. Specified as an ISO Alpha-2 country code. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a catalogue of codes. | ?hc=CN |
Destination Country (required) | dc | The student's destination country, used to drive the payment options available to the student. Specified as an ISO Alpha-2 country code. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a catalogue of codes. | ?dc=AU |
Given Name (required) | gn | The student's given name. | ?gn=Albert |
Family Name (required) | fn | The student's family name. | ?fn=Smith |
Date of Birth | dob | The student's date of birth in ISO 8601 format. See https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates | ?dob=1999-11-26 |
Phone Number | p | The student's phone number. | ?p=861083410308 |
Passport Country (required) | pc | The student's passport country. Specified as an ISO Alpha-2 country code. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a catalogue of codes. | ?pc=CN |
Passport Number (required) | pn | The student's passport number. | ?pn=M1234567 |
Locale (required) | locale | The language to be used. | ?locale=en |
In cases where the payer is not the same as the student, you are also able to populate their details:
Field | Key | Description | Example |
---|---|---|---|
pe | The payers's email. | [email protected] | |
Given Name | pgn | The payers's given name. | ?pgn=George |
Family Name | pfn | The payers's family name. | ?pfn=Smith |
Date of Birth | pdob | The payers's date of birth in ISO 8601 format. See https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates | ?pdob=1999-11-26 |
Phone Number | pp | The payers's phone number. | ?pp=861083410308 |
Passport Country | ppc | The payers's passport country. Specified as an ISO Alpha-2 country code. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a catalogue of codes. | ?ppc=CN |
Passport Number | ppn | The payers's passport number. | ?ppn=M1234567 |
See it in action:
To prevent the user being directed away from your domain, the Cohort Go UI can be displayed in an <iframe>
tag. There are many
jQuery based libraries that can assist with this. For example, the Featherlight
jQuery plugin can enable this based purely upon data attributes:
<script src="//code.jquery.com/jquery-latest.js"></script>
<script src="//cdn.rawgit.com/noelboss/featherlight/1.7.13/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script>
<link href="//cdn.rawgit.com/noelboss/featherlight/1.7.13/release/featherlight.min.css" type="text/css" rel="stylesheet" />
<a href="https://agent-devsite-demo.demo.s.chrtpy.com?a=2000&ccy=SGD&cd=2021-08-26&dc=AU&e=user%40gmail.com&fn=User&gn=Test&hc=CN&in=QUT&it=tuition&locale=en&pn=A123456&sn=123123&complete=https://cohortgo.dev/guides/agent-payment-buttons&cancel=https://cohortgo.dev/guides/agent-payment-buttons" style="display: inline-block; padding: 5px 10px 2px 10px; background-color: #324A87; color: white; border-radius: 5px" data-featherlight="iframe" data-featherlight-iframe-height="800" data-featherlight-iframe-width="1000">Pay with Cohort Go</a>
See it in action:
The Cohort Go System can notify you when payment is funds received or settled via the email notification.
https://<REFERRER_KEY>.cohortgo.app?a=500&it=tuition&ccy=AUD