Process Class Payment

Method : POST

Base URL : https://api.braincert.com

API Endpoint : /v2/apiclasspayment

All requests are POST and sent to https://api.braincert.com/v2/apiclasspayment You will retrieve results assuming you have added your appKey, and require parameter.

Post parameters

ParameterTypeDescriptionExample
apikeyrequiredYour api keystring
class_idrequiredClass idinteger
card_numberrequiredCard number4242 4242 4242 4242
card_exp_monthrequiredCard expire month01
card_exp_yearrequiredcard expire year2017
card_cvcrequiredCard cvc 141
student_emailrequiredStudent Email address [email protected]
price_idrequiredPrice idinteger
cancelUrlrequiredPlease enter base64 encode cancelUrlstring
returnUrlrequiredPlease enter base64 encode returnUrlstring
coupon_codeoptionalPlease enter class coupon codestring
formatoptionalResponse data format- xml for XML response, default JSON response

Response XML Example

https://api.braincert.com/v2/apiclasspayment

Success Response

Stripe Response

<rsp status="ok">
  <method>apiclasspayment</method>
  <charge_id>ch_1BL9Ae2eZvKYlo2CWz1xDYF1</charge_id>
</rsp>

Paypal Response

<rsp status="ok">
  <payKey>AP-3TY011106S4428730</payKey>
</rsp>

Paypal Payment Form

<form action="https://www.paypal.com/webapps/adaptivepayment/flow/pay" target="PPDGFrame" class="standard" >
<input type="image" id="submitBtn" value="Pay with PayPal">
<input id="type" type="hidden" name="expType" value="lightbox">
<input id="paykey" type="hidden" name="paykey" value="[PAYKEY]">
</form>

Error Response

<rsp status="error">
  <message>error message</message >
</rsp>

Response JSON Example

https://api.braincert.com/v2/apiclasspayment

Success Response

Stripe Response

[{
   "status":"ok",
   "method":"apiclasspayment",
   "charge_id":ch_1BL9Ae2eZvKYlo2CWz1xDYF1
}]

Paypal Response

[{
   "status":"ok",
   "payKey":"AP-3TY011106S4428730"
}]

Paypal Payment Form

<form action="https://www.paypal.com/webapps/adaptivepayment/flow/pay" target="PPDGFrame" class="standard" >
<input type="image" id="submitBtn" value="Pay with PayPal">
<input id="type" type="hidden" name="expType" value="lightbox">
<input id="paykey" type="hidden" name="paykey" value="[PAYKEY]">
</form>

Error Response


[{
   "status":"error",
   "error":"Invalid API KEY"
}]