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
Parameter | Type | Description | Example |
apikey | required | Your api key | string |
class_id | required | Class id | integer |
card_number | required | Card number | 4242 4242 4242 4242 |
card_exp_month | required | Card expire month | 01 |
card_exp_year | required | card expire year | 2017 |
card_cvc | required | Card cvc | 141 |
student_email | required | Student Email address | [email protected] |
price_id | required | Price id | integer |
cancelUrl | required | Please enter base64 encode cancelUrl | string |
returnUrl | required | Please enter base64 encode returnUrl | string |
coupon_code | optional | Please enter class coupon code | string |
format | optional | Response data format | - xml for XML response, default JSON response |
Response XML Example
https://api.braincert.com/v2/apiclasspaymentSuccess 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/apiclasspaymentSuccess 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"
}]