Edit this Page

Coding Custom Payment Form

Warning : This section requires software development expertise.

For various reasons, you may want to develop your own payment form. If you want to develop your payment form, you must create 2 pages:

  • Payment page: Customer's payment information is collected in this web page.
  • Callback page: After the collection is completed, the customer is redirected to this web page.

Payment Page

To develop your own payment form, you must have the following parameters in your form.

Offer and Company Information

Subscriber Parameters

  • subscriber.name: John
  • subscriber.surname: Doe
  • subscriber.email: johndoe@gmail.com
  • subscriber.phoneNumber: 5555555

Payment Parameters

  • paymentType: CC
  • paymentCard.cardHolderName: John Doe
  • paymentCard.cardNumber: 4355 0843 5508 4358
  • paymentCard.expireMonth: 12
  • paymentCard.expireYear: 2019
  • paymentCard.cvc: 000

You need to send these parameters using HTTP POST method to:

https://${sitename}.subscreasy.com/na/subscription/start/4ds

Assuming that the subdomain that you use for your company is acme, in this case, you should POST to the following address:

https://acme.subscreasy.com/na/subscription/start/4ds

Sample HTML Form

<form method = "post" action = "https://acme.subscreasy.com/na/subscription/start/4ds">
<input type = "hidden" name = "offer.id" value = "4737" /> <br />
<input type = "hidden" name = "companySiteName" value = "acme" /> <br />
<input type = "hidden" name = "callbackUrl" value = "https://acme.subscreasy.com/payment3ds/success" /> <br />
<input type = "hidden" name = "errorCallbackUrl" value = "https://acme.subscreasy.com/payment3ds/failure" /> <br />

    Subscriber Name: <input type = "text" name = "subscriber.name" value = "" /> <br />
    Subscriber Surname: <input type = "text" name = "subscriber.surname" value = "" /> <br />
    Email: <input type = "text" name = "subscriber.email" value = "" /> <br />
    Phone Number: <input type = "text" name = "subscriber.phoneNumber" value = "" /> <br />

    Cardholder Name: <login type = "text" name = "paymentCard.cardHolderName" value = "" /> <br />
    Card Number: <input type = "text" name = "paymentCard.cardNumber" value = "" /> <br />
    Expiry Month: <input type = "text" name = "paymentCard.expireMonth" value = "" /> <br />
    Expiry Year: <input type = "text" name = "paymentCard.expireYear" value = "" /> <br />
    Security Code: <input type = "text" name = "paymentCard.cvc" value = "" /> <br />
<input type = "hidden" name = "paymentType" value = "CC" /> <br />

    <input type = "checkbox" name = "privacyPolicyUrl" value = "true" /> I accept privacy policy <br />
</form>

Sample Curl Request

curl 'https://acme.subscreasy.com/na/subscription/start/4ds' \
 --data 'offer.id = 4737 & \
 subscriber.name = John + & \
 subscriber.surname = Doe & \
 subscriber.email = johndoe% 40gmail.com & \
 subscriber.phoneNumber = 5555555 & \
 privacyPolicyUrl = true & \
 paymentType = CC & \
 paymentCard.cardHolderName = John + Doe & \
 paymentCard.cardNumber = 4355 + 0843 + 5508 + 4358 & \
 paymentCard.expireMonth = 12 & \
 paymentCard.expireYear = 2019 & \
 paymentCard.cvc = 000 & \
 companySiteName = acme & \
 callbackurl = https% 3A% 2F% 2facme.abone.io 2fpayment3ds%% 2fsuccess'

Success Callback Page

After the collection process is completed, the customer is redirected to this address. As in the following example, transaction results are returned to the callback page as query parameter:

https://acme.subscreasy.com/success?paymentıd=85693542&authcode=044970&subscriptionıd=4974&nextchargingdate=1549454371

The following parameters are returned to the callback page:

  • paymentId
  • authCode
  • subscriptionId
  • nextChargingDate
  • startDate
  • endDate
  • subscriberSecureId
  • offerId

It is the seller's discretion to keep these parameters for future use. You can always access payment information from the subscreasy dashboard or via API access.

Error Callback Page

If payment fails, the customer is redirected to this address. Error details are returned to error callback page as query parameter:

https://acme.subscreasy.com/payment3ds/failure?errorCode=10012&errorText=Geçersiz işlem

The following parameters are returned to the callback page:

  • errorCode
  • errorText