Thursday, 7 November 2019

Altering a column: null to not null in SQL

In this article, I am explaining how to altering a column null to not null in Sql Server.

Query:-


First make all current NULL values disappear from that column

UPDATE [Table] SET [Column] = '' WHERE [Column] IS NULL

Then, update the column of table to disallow NULLs

ALTER TABLE [Table] ALTER COLUMN [Column] varchar(50) NOT NULL


Friday, 12 July 2019

Create Profile For CyberSource Secure Acceptance

Introduction
CyberSource is a payment gateway solution for businesses for online payment processing. In this article we will learn how to create an account on CyberSource.


Follow below steps to create new profile:

Step 1:-  Log in to CBS Business Center:

·         Live transactions: https://ebc.cybersource.com
·         Test transactions: https://ebctest.cybersource.com

Step 2:  Go to Payment Configuration  > Secure Acceptance Setting > New Profile (see SS below):




Step 3: Scroll down the popup and fill all details mentioned below:


Profile Name - [Name of the profile]
Description – Optional (Can be left blank)
Integration Methods: Choose Hosted Checkout option
Company Name: [Name of the company]
Contact Information: Optional (Can be left blank)
Added Value Services: Choose “Payment Tokenization” and “BIN Lookup” options. Also, choose “Enable full BIN Lookup service. A chargeable service that returns full information about the card used, where available.” option under “BIN Lookup”


Step 4: Click “SUBMIT” button (see SS below). Wait until it redirects to the new created profile. It will open in editable mode


Step 5: GO to “PAYMENT SETTINGS” tab of the Profile.
·         Click on “ADD CARD TYPES”, choose card types (Selected cards will show to customer) and click at any place outside the card type box.


Note:- Selected card type need to be approved from CBS.

Step 6: Click on the settings icon of each selected card types and choose all three options under CVN. Also, choose the currencies that need to be allowed or click select all if need to allow all currencies. Click on “SUBMIT” button.


Step 7

In “Payer Authentication 3DS Version” choose Default “3DS 1“ option.





Step 8

Under “Automatic Authorization Reversal” section choose both options “Fails AVS Check” and “Fails CVN Check”.


After doing above stuff click on “SAVE” button and click “Confirm”.

Step 9: GO to “SECURITY” tab. Click on “+” icon, put Key Name, click “CREATE” button and click “Confirm” (See SS below):



Step 10: Access key and Secret key will be created. We will use these keys on our site for Hosted Checkout. (See SS below):


Step 11: Click the “PAYMENT FORM” tab.

·         Under “Payment Form Flow” section choose “Single Page Form, Your customer completes the checkout process on a single, longer page”.
·         Under “Payment Information” section choose ”Mask sensitive fields (such as card or bank account numbers) after they are entered.”

See SS below:




Step 12: Click the “Notification” tab.

·         Under “Merchant Notifications”, choose “Merchant POST Email” section and Enter an email id. Notification will be sent to this email id.
·         Choose “Return BIN and last 4 digits of card number” option from drop down and then click “SAVE” button.

See SS below:


Step 13: Click the “Customer Response” tab and fill in the URL for the “Transaction Response Page” and “Customer Redirect after checkout”. In “Transaction Response Message” select “Decline Limit”  5 and then “SAVE” this setting:

change the callback URL of your profiles :

https://testing.com/cbs_hosted_checkout_response.aspx


See SS below:



Step 14: Click the “BRANDING” tab. Go to “Pay / Finish Button” section to change background color and text color accordingly. Choose “Change Button Custom Text” and change pay button text and click “Save” button.(See SS below):



Step 15: After saving these changes. We need to click on below button to active profile (See SS below):




After click on “Confirm” profile will be ready to use. Here we need to take “Profile Id”,  “Access key” and “Secret key” for implemented in your website.

Reference Doc of CyberSource:




Wednesday, 23 January 2019

Drop all tables and stored procedures

In this article, I am explaining how to drop all tables and procedures in Sql Server.

Query:-


SELECT 'DROP Procedure [' + SCHEMA_NAME(p.schema_id) + '].[' + p.NAME + '];'
FROM sys.procedures p

SELECT 'DROP TABLE [' + SCHEMA_NAME(p.schema_id) + '].[' + p.NAME + '];'
FROM sys.tables p


With the help of above queries, we got  drop statement for  all procedures and tables.